ADE7116/ADE7156/ADE7166/ADE7169/ADE7566/ADE7569
Rev. B | Page 80 of 152
This low battery flag can be enabled to generate the PSM
interrupt by setting the EBAT bit (Bit 2) in the power
management interrupt enable SFR (IPSME, Address 0xEC).
This method allows battery measurements to take place
completely in the background, requiring MCU activity only if the
battery drops below a user-specified threshold. To set up
background battery measurements, follow these steps:
1. Configure the battery detection threshold SFR (BATVTH,
Address 0xFA) to establish a low battery threshold. If the
BATADC measurement is below this threshold, the FBAT
bit (Bit 2) in the power management interrupt flag SFR
(IPSMF, Address 0xF8) is set.
2. Set up the interval for background battery measurements
by configuring the BATT_PERIOD bits in the peripheral
ADC strobe period SFR (STRBPER, Address 0xF9).
Battery ADC in PSM0, PSM1, and PSM2 Modes
Depending on the operating mode, a battery conversion is
initiated only by certain actions.
• In PSM0 operating mode, the 8052 is active. Battery
measurements are available in the background measure-
ment mode and by initiating a single measurement.
• In PSM1 operating mode, the 8052 is active and the part is
battery powered. Single battery measurements can be
initiated by setting the BATT_ADC_GO bit (Bit 0) in the
start ADC measurement SFR (ADCGO, Address 0xD8).
Background battery measurements are not available.
• In PSM2 operating mode, the 8052 is not active. Unlike
temperature and VDCIN measurements, the battery
conversions are not available in this mode.
Battery ADC Interrupt
The battery ADC can generate an ADC interrupt when at least
one of the following conditions occurs:
• The new battery ADC value is smaller than the value set in
the battery detection threshold SFR (BATVTH, Address
0xFA), indicating a battery voltage loss.
• A single battery measurement initiated by setting the
BATT_ADC_GO bit finishes.
When the battery flag (FBAT, Bit 2) is set in the power manage-
ment interrupt flag SFR (IPSMF, Address 0xF8), a new ADC
value is available in the battery ADC value SFR (BATADC,
Address 0xDF). This battery flag can be enabled as a source of
the PSM interrupt to generate a PSM interrupt every time the
battery drops below a set voltage threshold or after a single
conversion initiated by setting the BATT_ADC_GO bit is ready.
The battery ADC value SFR (BATADC, Address 0xDF) is
updated with a new value only when the battery flag (FBAT) is
set in the power management interrupt flag SFR (IPSMF,
Address 0xF8).
EXTERNAL VOLTAGE MEASUREMENT
The ADE7156/ADE7166/ADE7169/ADE7566/ADE7569
include a dedicated ADC to provide a digital measurement of
an external voltage on the VDCIN pin. An 8-bit SFR, the VDCIN
ADC value SFR (VDCINADC, Address 0xEF), holds the results
of the conversion. The resolution of the external voltage measure-
ment is 15.3 mV/LSB. There are two ways to initiate an external
voltage conversion: a single external voltage measurement or
background external voltage measurements.
Single External Voltage Measurement
To obtain an external voltage measurement, set the
VDCIN_ADC_GO bit (Bit 2) in the start ADC measurement
SFR (ADCGO, Address 0xD8). An interrupt is generated when
the conversion is done and when the external voltage measure-
ment is available in the VDCIN ADC value SFR (VDCINADC,
Address 0xEF).
Background External Voltage Measurements
Background external voltage measurements are disabled by
default. To configure the background external voltage
measurement mode, set an external voltage measurement
interval in the peripheral ADC strobe period SFR (STRBPER,
Address 0xF9). External voltage measurements are performed
periodically in the background (see Table 4 9).
When an external voltage conversion is complete, the new
external voltage ADC value is compared to the last external
voltage ADC value that created an interrupt. If the absolute diff-
erence between the two values is greater than the setting in the
VDCIN_DIFF[2:0] bits in the temperature and supply delta SFR
(DIFFPROG, Address 0xF3), a VDCIN ADC flag is set. This VDCIN
ADC flag is FVADC (Bit 3) in the power management interrupt
flag SFR (IPSMF, Address 0xF8), which is used for power supply
management. This VDCIN ADC flag can be enabled to generate a
PSM interrupt by setting the EVADC bit (Bit 3) in the power
management interrupt enable SFR (IPSME, Address 0xEC).
This method allows external voltage measurements to take place
completely in the background, requiring MCU activity only if
the external voltage has changed more than a configurable delta.
To set up background external voltage measurements, follow
these steps:
1. Initiate a single external voltage measurement by setting
the VDCIN_ADC_GO bit (Bit 2) in the start ADC
measurement SFR (ADCGO, Address 0xD8).
2. Upon completion of this measurement, configure the
VDCIN_DIFF[2:0] bits to establish the change in voltage
that sets the FVDCIN bit (Bit 0) in the power management
interrupt flag SFR (IPSMF, Address 0xF8).
3. Set up the interval for background external voltage measure-
ments by configuring the VDCIN_PERIOD bits in the
peripheral ADC strobe period SFR (STRBPER, Address 0xF9).