beautypg.com

1 serial interrupt, Serial interrupt – Maxim Integrated 71M6521BE Energy Meter IC Family Software User Manual

Page 55

background image

71M652X Software User’s Guide

Revision 1.7

TERIDIAN Proprietary

55 of 138

© Copyright 2005-2007 TERIDIAN Semiconductor Corporation

RTC interrupt happens, and then the XFER interrupt happens after the IE_XFER flag is already tested, but before the
RTC interrupt is cleared. In this case, the signal to EXT6 will remain set, and never have an edge to cause another
interrupt 6. Therefore, the XFER_BUSY interrupt will hang forever, thus preventing delivery of the data to the meter.

To prevent this error condition, at the end of the XFER_BUSY_RTC service routine, both interrupt flags are again
checked, and when at least one of them is active, the processing starts again.

Both interrupts have a backup check - the main watchdog timer is never reset unless both interrupts run.

5.4.2.1 SERIAL Interrupt

es0_isr is the ISR servicing UART 0. In this ISR, the UART data is sent and received along using flow control, if
enabled. Parity and other serial controls are managed in this ISR. The alternative serial port, UART 1 uses an ISR with
identical code structure (es1_isr).

es0_isr()

RX interrupt

RI == TRUE?

Call high-level protocol to

receive byte

no

yes

END

TI == TRUE?

TX interrupt

yes

Call high-level protocol to

transmit byte

no

es1_isr()

RX interrupt

RI == TRUE?

Call high-level protocol to

receive byte

no

yes

END

TI == TRUE?

TX interrupt

yes

Call high-level protocol to

transmit byte

no

Figure 5-10: Serial 0 and 1 isr