cancel
Showing results for 
Search instead for 
Did you mean: 

ADC using DMA

Erwan03
Associate III

Hello, @SofLit 

 

I would like to measure the voltage on analog pin A0 and A1 simultaneously, using ADC in DMA mode. I configured my ADC settings as SCAN, CONTINUOUS mode to measure continuously the whole group. The DMA is also configured and linked to the ADC1. However, the results that i am trying to display on the serial screen from UART communication, are all the same, even though with applying a sinewave evolving from 0V to 5V at 1Hz. Here are the .ioc and main.c files attached.

 

Thanks in advance for help.

2 REPLIES 2
Muhammed Güler
Senior III

You should not apply a voltage higher than VDDA voltage to the ADC input.
You should also enable the DMA Continuous Requests parameter. Below is the description of the relevant setting in CubeMX.

DMA Continuous Requests Parameter Description: This parameter is used only when a DMA Request is configured. Otherwise it is not relevant. When the DMA Request for this ADC instance this parameter specifies whether the DMA requests are performed in one shot mode (DMA transfer stops when number of conversions is reached) or are performed in continuous mode (DMA transfer unlimited, whatever number of conversions). Note: In continuous mode, DMA must be configured in circular mode. Otherwise an overrun will be triggered when DMA buffer maximum pointer is reached

I wan not able to make it work using DMA so i changed to interrupt mode without DMA, thanks