Hi,
I was just wondering if someone could explain how the ADC conversion equations were determined for these posts:
https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862734/thread-id/4896
https://community.nxp.com/t5/Other-NXP-Products/NHS3152-reading-data-form-NFC/td-p/1585506
I am currently just trying to read voltage to one analog pin.
Hello Isaac,
The ADC conversion has non-linear behavior at 0V and at the maximum of the input range, therefore it is more accurate to use the Via, min and Via, max values from the datasheet as the voltages corresponding to raw ADC values 0 and 4095. See graph below.
The conversion formula from raw ADC to ADC input voltage (Via) is then:
Via = Via, min + (Via, max - Via, min) * ADCraw / 4095.0
Values outside the Via, min and Via, max cannot be measured: raw value clipped at 0 or 4095.
A example measurement showing the behaviour at the top and bottom of the voltage range:
The Via, min and Via, max values for both ranges, from the NHS3152 datasheet:
Kind regards,
Patrick