cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 ADC Wrong Value

bjeon.1
Associate

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,

3 REPLIES 3

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

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
Associate

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 !