Showing results for 
Search instead for 
Did you mean: 

Measure Circuit returns wrong value after connect to G4 chip

Associate II

I am using the STM32 G431RBT6 chip. There is a circuit for measuring voltage, current, and other parameters.

When the circuit is not connected to the chip, the voltage divider works perfectly. However, when the circuit is connected to the chip (with the code uploaded), the voltage readings are incorrect (for example, 50V reads as 40V), and this issue occurs inconsistently across channels.

It is important to note that this discrepancy is not due to incorrect ADC results, but the voltage divider output itself is incorrect. The ADC channels are configured with no pull.

What could be causing this issue, and how can I resolve it?

Senior II

It depends on the impedance of the divider.  If you use high value resistor,  use buffer opamp. 

Before using this chip, I've used another G4 one and everything work well, this happens only when I switch to new G4 chip. So, it still relates to  the divider?

Do you run the same program? Is it possible that io is not configured as analog input. We can only suggest that the voltage drops when the loading is more. This can be due to pin misconfigured as output, pull down enabled etc.

 Can you please confirm the voltage when you keep the reset kept pressed? At this condition, the io is in input mode. Make sure that the divider voltage doesn't go beyond 3.3v when the divider input is max voltage.  Check the datasheet if this voltage exceed the absolute max voltage when  vcc is not applied. 

As per datasheet the input impedance is 50k. 

Chek if vdda is proper and the pins are soldered properly. 

I realize that if I just add just 1 or 2 code line the ADC will return wrong value. I mean that there something makes wrong value (effect directly to hardware)  that just by code. Could you explain this? 


That seems to be a clue..

What does that line contain? Where do you insert code line? please add the code and mark it for us to understand