Using Direct Memory Access (DMA) in STM32 projects

In many microcontroller projects, you need to read and write data. It can read data from the peripheral unit like ADC and write values to RAM. In another case, maybe you need to send chunks of data using SPI. Again you need to read it from RAM and continuously write to the SPI data register. When you do this using processor – you lose a significant amount of processing time. Most advanced microcontrollers have a Direct Memory Access (DMA) controller to avoid occupying the CPU. As its name says – DMA does data transfers between memory locations without the need for a CPU. Low and medium-density ST32 microcontrollers have a single 7-channel DMA unit, while high-density devices have two DMA controllers with 12 independent channels. In STM32VLDiscovery, their ST32F100RB microcontroller with a single DMA unit having 7 channels.

Continue reading