ADC offset

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC offset

819 Views
pietrodicastri
Senior Contributor II

Good morning

I need to use the offset feature of the ADC. After the chip calibration I need the system calibration.

I read the result of conversion with my zero reference as a value: 2090, and it should be 2047 as midscale.

The offset register shows the value 0xFFFF. I don t find a good strategy for writing the right compensation value

there to produce what I want. I verify that writing 340 I have what I need but what is the logic?

I am using the 12 bits resolution

Thank You...

Labels (1)
5 Replies

540 Views
pietrodicastri
Senior Contributor II

Thank You

Now it is clear..

540 Views
ankur_kala
NXP Employee
NXP Employee

Hi,

Generally the Offset registers find usage in environment where the measured signals are not referenced with ground but with some other value. For example to measure a sinewave with amplitude +Vac to -Vac, the voltage would be scaled down on the hardware and provided an offset of Vdda/2 (MCU Analog Supply/2). The corresponding digital value would be written on the offset register. This in turn automatically gets adjusted in the result registers. As far as seeing 2090 instead of 2047 is concerned, it might be due to non linearity of resistor divider (tolerance levels) or a slight deviation of Vref (analog reference supply). The offset registers need to be written by the user, the value depending on the hardware configuration and application requirement.

0 Kudos

540 Views
pietrodicastri
Senior Contributor II

Hi

Thank You for support. I see I can write to the offset register a value of 340 and I will read 2048, so the compensation is got. But rather than try some values I need to calculate the reasonable offset for getting a reading of 2047 when the input is my 0, that is MCU Analog Supply/2. So the question is if I read 2090 but I would like to read with the same input 2047 what is the value to write in the offset register? I am using now 12 bits..

Thank You

0 Kudos

540 Views
bryancole-b4682
NXP Employee
NXP Employee

Hi Pietro,

The formatting of the offset register (ADCx_OFS) is different than the data result register (ADCx_Rn). The data held in the offset register value should be written left-justified in 2's complement form. The OFS[15] bit indicates the sign (positive or negative) of the offset value. In 12-bit single-ended mode, the offset register bits OFS[14:3] are subtracted from Rn[11:0] and bits OFS[2:0] are ignored. When subtracting the value stored in OFS from the ADC result register, the binary weight of bits OFS[14:3] will correspond to those of Rn[11:0].

- Bryan

540 Views
pietrodicastri
Senior Contributor II

No one has answers??

0 Kudos