Showing results for 
Search instead for 
Did you mean: 

Issue with STM32G0: Intermittent ADC Data Reading. Spikes to 0

Associate II

Hello everyone,

I’m working with an STM32 G0 microcontroller and encountering an issue with reading data from two sensors. One of the sensors provides consistent and accurate readings, however, the second sensor shows intermittent spikes to zero in the readings. These spikes occur periodically and affect the integrity of the data.

I’ve checked both hardware and software configurations, but haven’t found any obvious issues. Has anyone experienced a similar problem or have any idea what might be causing these zero spikes in the sensor data reading?

I know I’m not showing any information about my configuration but if anywho thinks could help me i share as much as i have

I left the signal reading of the adc that goes wrong


I appreciate any suggestions or advice to resolve this issue! Thank you in advance!


Associate II

The moment I published the questions, I didn’t have access to my computer. That was the reason for not showing much of the software itself.

The more detailed problem is as follows : I need to reed two pressure sensor. For one the readings are fine, for the other one, every 6.5 secs the pattern shown in the picture of the original post appears, because of that some calculations done with that data acts really weird due the sudden change. Hear I attach my configuration:




This is how I set up my periferics, where the following are used for ADC conversion


The problem ocurrs with BK_R, while BK_F works fine.

ADC configuration is:







To read the data it is used this:





I also got a tim2 setup, I strongly believe that it is really difficult for it to cause some interference. But due to the periodic behaviour of the issue, maybe are related.


Lastly, I want to mention a few things. Firstly, I'm not a native English speaker, so please be patient while reading 😁. Also, if any further information is needed, please let me know. Thank you all in advance! Any information would be of tremendous value!




Is the problem with the channel going into adc.reading[3]?

That's the one to which you are assinging a value, so what if that's the reason for your problem. Try not to process the data at all and just observe them - still zeros?


To start with , thanks you a lot for your comment.


I will try it when I have the possibility.But it will make a lot of sense that this were the problem.