Skip to main content
DMark.1
Associate
March 13, 2022
Solved

Is it a must to use DMA for ADC when we have more than one channel?

  • March 13, 2022
  • 2 replies
  • 1123 views

Hi!

I am using ADC1 to convert two channels continuously. The two channels are VrefINT and Temperature sensor. However, for some sampling rate I find that ADC1->DR contains only temperature data and for other sampling rate, ADC1->DR contains only VrefINT data.

Is it possible to read the conversion result for those two channels properly without using DMA? Or in this case, DMA is a must?

This topic has been closed for replies.
Best answer by KnarfB

It is possible without DMA by using Discontinous Conversion Mode. You need to poll for each result because there is only 1 data register for all channels.

hth

KnarfB

2 replies

KnarfB
KnarfBBest answer
Super User
March 13, 2022

It is possible without DMA by using Discontinous Conversion Mode. You need to poll for each result because there is only 1 data register for all channels.

hth

KnarfB

S.Ma
Principal
March 13, 2022

Yes, as long as sampling rate is non critical (it depends on the response time or each input). So you can operate the ADC in one channel one shot mode, all manual.

Read the spec, there are minimum sampling time for each, and adc calibration should be done once after init the adc.

Remember that to calculate vdd or temperature, you need to carefully read the ref man and the datasheet. There maybe exemples in a nucleo project.