Energy Meter IC Family Software Instruction Manual

71M652X Software User’s Guide
Revision 1.7 TERIDIAN Proprietary 53 of 138
© Copyright 2005-2007 TERIDIAN Semiconductor Corporation
CE_BUSY Interrupt
CE_BUSY interrupt is used for handling the outputs of the CE that are refreshed every 396µs, i.e. SAG detection.
ce_busy_isr()
Disable CE interrupts
(sag_data & 0x0E) !=
0
Read CE status
User code handling SAG
goes here
sag_data = 0
EX_CE_BUSY = 0
END
disable interrupt
Stretch clock 5 times
Normal clock
Execute Timer Expired
function.
no
yes
Figure 5-8: CE_BUSY ISR
XFER_BUSY and RTC Interrupt
The XFER Busy interrupt is requested by the CE at the conclusion of every accumulation cycle. The interrupt service
routine copies the CE output data to the MPU internal data RAM for further processing by the MPU, which is performed
by the background task. The handling of data for the generation of pulses is also managed in this ISR.
Processing of CE data waits until the second interrupt after one second has elapsed, since it takes roughly one second
for the PLL in the CE to settle and (therefore) for the filtering to be reliable (variable ce_first_pass). Thus, the first
samples from the CE are discarded.
The copy operations stated in the flow chart are implemented with the MEMCPY_MCE macro, which moves data
between internal RAM and CE DRAM or vice versa. Due to the wait states that apply to accesses of CE DRAM, this
operation cannot be done directly.