cancel
Showing results for 
Search instead for 
Did you mean: 

Adc for dynamic channel with DMA

gokhannsahin
Associate II
Posted on June 17, 2017 at 12:46

0

https://stackoverflow.com/questions/44599420/stm32f302-adc-with-dma-for-different-size-and-channel

I'm using STM32F302 QFN32 and unfortunately, it has only one ADC module. One channel must get around 500 samples in one period and it must be sync with and PWM (thinking using a timer and this i/o will be toggled in callback, because while reading its ADC channel, I must know the i/o whether high or low, so that according to this I/O, will decide value). Furthermore, there are 4 more channels which must be read.(More samples doesn't need there like before, 8 or 16 samples will be enough.) However, it has only one ADC module. Consequently, Can I do this? If yes, how? Thank you.

#adc-reads
2 REPLIES 2
S.Ma
Principal
Posted on June 18, 2017 at 10:21

Not quite sure of what is needed to be done here.

ADC can sweep through multiple analog inputs sequentially and cyclically. These 'interleaved' ADC result data can be stored by DMA in RAM for each inputs.

You can trigger the single sequence using a trigger input pin which can come from a timer or PWM

As far as the 'read pin level', if this is the analog input, then read the ADC value and check if it is higher or lower than a mid range for example. Thanks to clarify

Posted on June 18, 2017 at 23:01

Thank you for your answer.

According to what you say that I can use sequential so multichannel to do this, but then will need more memory, e.g each channel needs 500byte and if there are 5 channels, I will need 2.5Kand it will be huge size.