0
\$\begingroup\$

I am trying to figure out how the STM32 multiple channels ADC conversion works (regular group). Lets say I want to convert on two channels, channel 1 and channel 2, on ADC1 and the sampling rates are 1 Hz and 10 Hz respectively (not actual numbers). I enable the setting to get an ADC EOC interrupt on each conversion (EOCS bit), which mean for each converted value the ISR is triggered and run.

I assume for the given sampling rates that the ISR will be triggered once every second for channel 1 and ten times every second for channel 2.

In the ISR, do I have to keep a track on which channel triggered the ISR or is there some register i can check that contains this information? How is this usually done?

If I were to use the DMA, how would the data be arranged? Would it be an array where every 11th value would be the channel 1 data and the rest channel 2 data?

\$\endgroup\$
  • 1
    \$\begingroup\$ Which STM32 are you using? \$\endgroup\$ – gbulmer Oct 23 '14 at 12:44
  • \$\begingroup\$ I am using STM32F429. \$\endgroup\$ – iQt Oct 23 '14 at 13:05
  • \$\begingroup\$ I don't think it's possible with pure hardware. Changing the channel involves register writes. With F429 it will be easier to just use separate ADCs for this, possibly started from timer ISRs or software. \$\endgroup\$ – Jan Dorniak Oct 29 '18 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.