{"id":12005,"date":"2024-01-29T00:21:25","date_gmt":"2024-01-28T22:21:25","guid":{"rendered":"https:\/\/deepbluembedded.com\/?p=12005"},"modified":"2024-02-01T09:44:41","modified_gmt":"2024-02-01T07:44:41","slug":"stm32-adc-multi-channel-scan-continuous-mode-dma-poll-examples","status":"publish","type":"post","link":"https:\/\/deepbluembedded.com\/stm32-adc-multi-channel-scan-continuous-mode-dma-poll-examples\/","title":{"rendered":"STM32 ADC Multi-Channel Scan Continuous Mode DMA Example"},"content":{"rendered":"\n
In this tutorial, we’ll discuss the STM32 ADC Multi-Channel Scan Continuous Conversion Mode with DMA<\/strong> for reading the ADC conversion results of a regular group of channels. You’ll learn how STM32 ADC Multi-Channel Scan mode works and how to use it to read a regular group of multiple ADC channels and get the conversion data using DMA with the STM32 HAL API functions.<\/p>\n\n\n\n The practical example we’ll implement in this tutorial is an STM32 LED dimmer using multiple potentiometers on multiple analog input pins and multiple PWM outputs to control the brightness of some LEDs. We’ll read the multiple analog input channels (regular group) in continuous-conversion mode using the DMA. Without further ado, let’s get right into it!<\/p>\n\n\n In this tutorial, we’ll explore the STM32 ADC Multi-Channel Scan Mode<\/strong> in continuous-conversion mode. In this mode, the ADC will start converting the configured regular group of channels one by one according to the channel ranks (from low to high) till the end of the group where it stops and generates an interrupt signal indicating the end of the regular group’s conversion process.<\/p>\n\n\n\n The ADC will then “automatically<\/strong>” restart\/re-trigger itself to start converting the regular group channels one by one again and keep repeating forever. This is unlike the Multi-Channel Scan Single-Conversion Mode<\/a><\/strong> that we’ve discussed in a previous tutorial. Where the ADC stops at the end of the regular group conversion and it needs to be “manually<\/strong>” started again.<\/p>\n\n\n\n The STM32 ADC Multi-Channel Scan Continuous Mode can only be used with DMA to get the ADC reading results as soon as the group conversion is completed. And that’s what we’ll do in the practical example project hereafter in this tutorial.<\/p>\n\n\n\nTable of Contents<\/h2>\n
\n
\n\n\nSTM32 ADC Multi-Channel Scan (Continuous-Conversion)<\/strong><\/h2>\n\n\n