I’m having problems using XBee S2C ADC Channels?
I’m trying to make sense of the results I’m getting from my ADC when measuring voltage.
The documentation suggests using the formula found on page 131 of the XBee / XBee-PRO ZigBee RF Modules User Guide PN: 90002002 T
I/O Sampling - Convert A/D reading to mV
0x0000 represents 0 V
0x3FF = 1.2 V
AD(mV) = (A/D reading * 1200mV) / 1023
I’m using XCTU v6.2 Console to view the results and I’ve tied the A0 to Gnd 0V using a 1K resistor the output shows 0x010. Strange! When I tie the A0 to VCC 3.3V VCC using a 1K resistor the output shows 0x3FF. Great!
The Formula is wrong or my ADC is wrong or XCTU is wrong. Which is it?
If it’s the formula, could I have the correct one and the documentation needs updating?
If it’s the ADC then what do I do?
If it’s the XTCU then what do I do?
My updated formula to Convert A/D reading to mV
0x010 (16 Dec) = 0mV
0x3FF (1023 Dec) = 1200mV
ADC_Offset = (1023-ADC)*(16/(1023-16))
AD(mV) = ((ADC_reading - ADC_Offset) * 1200mV) / 1023