Skip to main content
bjeon.1
Associate
Jun 10, 2021 5:47 AM UTC
Question

STM32G0 ADC Wrong Value

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
Jun 10, 2021 7:01 AM UTC

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
Jun 10, 2021 9:01 AM UTC

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
Jun 14, 2021 2:43 AM UTC

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 !