Logo

How to read the actual N76E003 band-gap voltage?

, 2017年3月27日|
0
3495
0
The N76E003 ADC can select an internal band-gap voltage as the input pin, which can be used to get the ADC reference voltage, for more accurate ADC results.
At room temperature, all N76E003 band-gap voltage values will be calibrated within the range of 1.17V to 1.27V. If you want to get the actual band-gap value for N76E003, read the 2 bytes value after the UID address.
There are 2 bytes after the UID address that store the actual band-gap value, but the actually valid bit is 12.
The first byte is the upper 8 bits, and the lower 4 bits of the second byte are the lower 4 bits of the 12 bit.

Reading and calculation steps:
Read a bad-gap value with IAP by reading UID;
Merge the upper 8 bits and the lower 4 bits;
Use the following formula to convert to an actual voltage value.
Formula:


Calculation example:
Read the 2 bytes value after the UID address, wherein the first byte value is 0x64, and the second byte value is 0x0E, merged as 0x64E = 1614. The conversion result is as follows:


Example samples:
void READ_BANDGAP()
{
UINT8 BandgapHigh,BandgapLow;
set_IAPEN;
IAPAL = 0x0C;
IAPAH = 0x00;
IAPCN = READ_UID;
set_IAPGO;
BandgapHigh = IAPFD;
IAPAL = 0x0d;
IAPAH = 0x00;
IAPCN = READ_UID;
set_IAPGO;
BandgapLow = IAPFD;
BandgapLow = BandgapLow&0x0F;
clr_IAPEN;
Bandgap_Value = (BandgapHigh<<4)+BandgapLow;
Bandgap_Voltage = 3072/(0x1000/Bandgap_Value);
}