DMA:
1. Why can I configure the I/O port to enable the input mode when I/O port is used to output the converted analog signal through the I/O port?
PS: The stm32 Manual defines that pa4 and pa5 are connected to the dac1 channel and the dac2 channel respectively;
Dma1 and dma2 use the following channels:
How is DMA used to transmit waveform data from memory with DAC? :
/* Configure dma2 */
Dma_initstructure.dma_peripheralbaseaddr = dac_dhr12rd_address; // peripheral data address
Dma_initstructure.dma_memorybaseaddr = (uint32_t) & dualsine12bit; // memory data address dualsine12bit
Dma_initstructure.dma_dir = dma_dir_peripheraldst; // Data Transmission Direction memory to peripherals
Dma_initstructure.dma_buffersize = 32;// The cache size is 32 bytes.
Dma_initstructure.dma_peripheralinc = dma_peripheralinc_disable; // The peripheral data address is fixed.
Dma_initstructure.dma_memoryinc = dma_memoryinc_enable; // memory data address auto-Increment
Dma_initstructure.dma_peripheraldatasize = dma_peripheraldatasize_word; // The peripheral data is in the unit of words.
Dma_initstructure.dma_memorydatasize = dma_memorydatasize_word; // The memory data is in the unit of words.
Dma_initstructure.dma_mode = dma_mode_circular;// Loop mode
Dma_initstructure.dma_priority = dma_priority_high; // high DMA channel priority
Dma_initstructure.dma_m2m = dma_m2m_disable; // non-memory to memory mode
Dma_init (dma2_channel4, & dma_initstructure );
When the data size transmitted is 32 bits, it is sent to the DAC for conversion,
Stm32 learning Summary