Skip to main content
bjeon.1
Associate
June 10, 2021
Question

STM32G0 ADC Wrong Value

  • June 10, 2021
  • 3 replies
  • 2482 views

Hello Guys,

I'm developing some device that measure voltage.

My first selection was STM32CubeIDE cause it ws free. But if i try to print float in serial, it goes more than 32K

So i change IDE to IAR and now it can print float with half size program size,

But it can't read ADC correctly.

Below picture shows the Serial output, and IDE

both has same h/w , cube setting , same code..

I have no idea why both print diffrent value.

i attach my main, I hope you can help.

0693W00000BaaHJQAZ.png 

Regard

Jay,

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
June 10, 2021

What exactly is the difference? What is the signal source? How do you set up the ADC? Do you perform the ADC calibration before use?

Read out and check/compare the ADC registers settings.

JW

DWeb_2
Associate III
June 10, 2021

Are you trying to print floats? First thing that came into my mind: Eclipse Project > Properties > C/C++ Build > Settings > Tool Settings :0693W00000BabHyQAJ.png

bjeon.1
bjeon.1Author
Associate
June 14, 2021

Hello ​, Sorry for my late reply.

To @DWeb_2​ 

  • I've done that. printing the float is not my problem , Thank you.

To @Community member​ 

  • I've also done ADC Cal, But the result was same.
  • signal Source OP Filter -> RC filter / IMA09 -> OPAMP OUT / Temp -> Resistor Divider
  • I'll check the register Thank you !