Hiii, i am using internal adc of STM controller which is giving me offset voltage around 2v.
how can i reduce this error in C.is there specific way or some calculation.
Thanks!!
Many ADCs are differential. If one input is
grounded or left to float you might see such
misbehaviors.
But that would likelier be fixed with a soldering
iron or a PCB jumper or perhaps even an
internal register bit (like maybe the ADC can be
configured variously, like single ended / differential,
unipolar / bipolar). "Fixing it in C" seems like a
long shot, other than the register-bit possibility.
Many ADCs are differential. If one input is
grounded or left to float you might see such
misbehaviors.
But that would likelier be fixed with a soldering
iron or a PCB jumper or perhaps even an
internal register bit (like maybe the ADC can be
configured variously, like single ended / differential,
unipolar / bipolar). "Fixing it in C" seems like a
long shot, other than the register-bit possibility.
If you need forum assistance: read the posts above and give the missing informations.
Without knowing what you have done ... we can't help.
For your own work:
Read the datasheets, especially about offset measurement conditions.
Btw: in the datasheet you will find typical and maximum offset specifications. They should be in the millivolts range.
Be sure the microcontroller will be within the maximum limits. If not, then most probably because you did something wrong. But currently you hide a lot of informations.
General information for a C program.
Offset correction is just a subtraction: ADC_corrected = ADC_raw - ADC_offset.
Where ADC_offset may be a constant, a value continously calculated, a value determined on pressing a "zero" button...
We don't know what's your idea...