95 / 259 page

TCC76x
Specification Rev. 0.07
February 23, 2005
32-bit RISC Microprocessor for Digital Media Player
TIMER / COUNTER
Preliminary
6-7
As illustrated in the figure below, TC32 consists of a pre-scale counter, main counter and two
comparators. The pre-scale counter is a simple 24-bit up-counter which always counts from zero to
PRESCALE value programmed in TC32EN register. The 32-bit main counter is incremented only
when the prescale counter reaches PRESCALE value.
The clock input of TC32 module can be either XTIN (default) or XIN. Refer to Clock Generator
description (XTTC32 bit of PWDCTL register).
Main
Counter
Pre-scale
Counter
TC32EN
TC32LDV
TC32CMP0
Compare
(=)
IRQ to
Interrupt
Controller
TC32CMP1
Compare
(=)
ZCLK from Clock Controller
(XTIN or XIN)
IRQ
Sync.
TC32IRQ
Figure 6.3 32-bit Counter Block Diagram
Possible counter modes are described in the table below.
Table 6.2 TC32 Count Mode
TC32EN Register Bits
Main Counter Operation
Mode
LOADZERO
LDM1
LDM0 Start Count Value
End Count Value
0
0
0
0
LOADVAL
0xFFFFFFFF
1
0
0
1
LOADVAL
CMP0 (if LOADVAL
< CMP0)
2
0
1
0
LOADVAL
CMP1 (if LOADVAL
< CMP1)
3
0
1
1
LOADVAL
CMP0 (if LOADVAL
< CMP0 ≤ CMP1) or
CMP1 (if LOADVAL
< CMP1 ≤ CMP0)
4
1
0
0
0
LOADVAL – 1
5
1
0
1
0
CMP0 (if LOADVAL
> CMP0)
6
1
1
0
0
CMP1 (if LOADVAL
> CMP1)
7
1
1
1
0
CMP0 (if LOADVAL
> CMP1 ≥ CMP0) or
CMP1 (if LOADVAL
> CMP0 ≥ CMP1)
Refer to register descriptions below for CMP0, CMP1 and LOADVAL.
Mode0 can be used as 1Hz counter mode, if PRESCALE = 0x007FFF, STOPMODE = 0, ZCLK = XTIN(32.768kHz)