cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 ADC issue

basavanagouda
Associate II
Posted on November 03, 2017 at 06:50

Hi All,

We are using STM32F0 controller in our project. we tried enable ADC with DMA one shot mode. Currently we configured 6 ADC channels(ch1, ch2, ch3, ch7,ch8 and ch9) with DMA support and we tried access other ADC channels in polling. We observed following 

1. We are enabling 6  ADC  channels in the 100us timer ISR, so DMA will get data every 100us.

2.But in the above configuration we are not getting data from the Polling ADC channels. We observed it is caused by overlap bwn DMA read in 100us timer and ADC polling read.

We need both DMA data(6 ADC channels data) and polling ADC channels data. How we can achieve this with out disabling the 100us timer interrupt.

Please help us to solve this issue.

Thanks in advance,

Basavanagouda.

#adc-poll #dma-adc #stm32f0 #timer-interrupts
1 REPLY 1
S.Ma
Principal
Posted on November 03, 2017 at 18:44

Before optimizing, use the DMA to read all the ADC channels you need all the time and fill up an array in circular mode.

At 100 us, you have more than enough time to run all channels you need. Then read the array whenever you need it. You get the latest values without waiting for the conversion.

After this works, you may optimize. Use STM32 Cube board examples in HAL or LL to get some guidance.