cancel
Showing results for 
Search instead for 
Did you mean: 

How can I reset ADC measurement for the next measurement?

KKIM.6
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions
raptorhal2
Lead

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.

View solution in original post

2 REPLIES 2
raptorhal2
Lead

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.

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.