Skip to main content
Visitor II
February 27, 2024
Question

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

  • February 27, 2024
  • 2 replies
  • 1772 views

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

4be05f0a-356c-4b77-8063-3e2fe09b96fc.jpeg

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

 

    This topic has been closed for replies.

    2 replies

    esxuAuthor
    Visitor II
    February 28, 2024

    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:

    esxu_0-1709122343923.png

    esxu_10-1709123978763.png

     

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

    esxu_1-1709122599204.png

    The problem ocurrs with BK_R, while BK_F works fine.

    ADC configuration is:

    esxu_2-1709122603339.png

    esxu_7-1709123835737.png

     

    esxu_8-1709123903917.pngesxu_9-1709123906126.png

     

    esxu_6-1709123248463.png

    To read the data it is used this:

    esxu_12-1709124480921.png

    esxu_13-1709124485782.png

     

     

    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.

    esxu_11-1709124159139.png

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

     

     

     

    Super User
    February 29, 2024

    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?

    JW

    esxuAuthor
    Visitor II
    March 1, 2024

    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.