Skip to main content
KKIM.6
Senior
October 27, 2022
Solved

How can I reset ADC measurement for the next measurement?

  • October 27, 2022
  • 1 reply
  • 1634 views

Right now, I'm focusing on increasing ADC channel.

I assembled the STM32WB55VG microcontroller and 8:1 mux.

The mux is contolled by three GPIO pin for [2:0] encoding to select channel.

The output of mux is connected to the ADC and I can see the ADC data using DMA.

If I select one channel in the mux, I can collect data exactly.

However, if I operate the mux with switching channel (I gave ~1 ms of interval for each channel), the most recent channel data is filled to the previous channel (last channel data only appears in all the channel data).

I know that the microcontroller has single ADC and multiple channel itself and it works very well when I use scan conversion mode. It imply that there is a very quick reset state in the ADC to restart measurement for next channel.

So, I wonder how can I force to reset ADC measurement for the next channel in the coding and whether it is possible.

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

So, I wonder how can I force to reset ADC measurement for the next channel,,,,,

After switching the mux, restart the ADC conversion for its one channel and wait for DMA complete before reading the result.

1 reply

raptorhal2
raptorhal2Best answer
Lead
October 27, 2022

So, I wonder how can I force to reset ADC measurement for the next channel,,,,,

After switching the mux, restart the ADC conversion for its one channel and wait for DMA complete before reading the result.

KKIM.6
KKIM.6Author
Senior
October 28, 2022

Oh!! it's working.

You are right. If I add HAL_ADC_Start(&hadc1); every time after changing MUX channel, the cross talking disappear!

Thanks man.