Skip to main content
oziesin
Associate III
August 25, 2021
Solved

ADC returns wrong value

I have a hardware that have on stm32g071 chip and mcp9700 temperature sensor. I tried reading temperature and i read 2040.(ADC 12bit resolution).

I also measured directly on hardware using multimeter and i read about 0.7 V So ADC measures wrong. 

Addition:

I read temperature using nucleo board that have on g0 series microprocessor. Is it about hardware ? Any suggestion would be appriciate.

This topic has been closed for replies.
oziesin
oziesinBest answer
Associate III
August 26, 2021

Thank you very much. When I cabled vref+ and vdda it is correctly working.

12 replies

Javier1
Principal
August 25, 2021

You should take a look at this : https://deepbluembedded.com/stm32-adc-tutorial-complete-guide-with-examples/

Maybe you can try enabling Continuous conversion mode?

hit me up in https://www.linkedin.com/in/javiermuñoz/
oziesin
oziesinAuthor
Associate III
August 25, 2021

Thank you but i 've already try continuous  mode , it did not change anything.

Javier1
Principal
August 25, 2021

is this board custom hardware?

hit me up in https://www.linkedin.com/in/javiermuñoz/
TDK
August 25, 2021

I don't think the bug is in anything that you've shown us. It's possible in your hardware connection to the device. Maybe you're not measuring the pin you think.

There is also some some possibility that the ADC was damaged.

"If you feel a post has answered your question, please click ""Accept as Solution""."
oziesin
oziesinAuthor
Associate III
August 26, 2021

Thank you to reply. Is it possible that is reference voltage issue ?

Piranha
Principal III
August 26, 2021

Of course the VREF pins, if present, must be correctly connected - read AN5096. If you've not connected those pins, take a look on internal voltage reference.