Datasheet

REV. 0
ADuC816
–43–
Time Interval Counter (TIC)
A time interval counter is provided on-chip for counting longer
intervals than the standard 8051-compatible timers are capable
of. The TIC is capable of timeout intervals ranging from 1/128th
second to 255 hours. Furthermore, this counter is clocked by
the crystal oscillator rather than the PLL and thus has the
ability to remain active in power-down mode and time long
power-down intervals. This has obvious applications for remote
battery-powered sensors where regular widely spaced readings
are required.
Six SFRs are associated with the time interval counter, TIMECON
being its control register. Depending on the configuration of the
IT0 and IT1 bits in TIMECON, the selected time counter register
overflow will clock the interval counter. When this counter is equal
to the time interval value loaded in the INTVAL SFR, the TII
bit (TIMECON.2) is set and generates an interrupt if enabled
(See IEIP2 SFR description under Interrupt System later in this
data sheet.) If the ADuC816 is in power-down mode, again
with TIC interrupt enabled, the TII bit will wake up the device
and resume code execution by vectoring directly to the TIC
interrupt service vector address at 0053 hex. The TIC-related
SFRs are described in Table XVI. Note also that the timebase
SFRs can be written initially with the current time, the TIC can
then be controlled and accessed by user software. In effect, this
facilitates the implementation of a real-time clock. A block
diagram of the TIC is shown in Figure 31.
8-BIT
PRESCALER
HUNDREDTHS COUNTER
HTHSEC
SECOND COUNTER
SEC
MINUTE COUNTER
MIN
HOUR COUNTER
HOUR
TIEN
INTERVAL TIMEOUT
TIME INTERVAL COUNTER
INTERRUPT
8-BIT
INTERVAL COUNTER
TIME INTERVAL
INTVAL
INTERVAL
TIMEBASE
SELECTION
MUX
TCEN
32.768kHz EXTERNAL CRYSTAL
ITS0, 1
COMPARE
COUNT = INTVAL?
Figure 31. TIC, Simplified Block Diagram
REV. A