109
Chapter 7 Timer/Counter Units
7
7.1 16-BIT TIMER/COUNTER7.1.1 Functions
The 16-bit timer/counter can function as an interval timer and can also be used for programmable square wave
output and pulse width measurement. In addition to these basic functions, the 16-bit timer/counter can be used
for the following:
PWM output
Period measurement
(1) Interval timer
When operating as an interval timer, the 16-bit timer/counter generates an internal interrupt at specified
intervals.
Table 7-2 Intervals of 16-Bit Timer/Counter
Minimum interval
8/fCLK
(1.3
µ
s)
Maximum interval
216 × 8/fCLK
(87.4 ms)
Resolution
8/fCLK
(1.3
µ
s)
The values in parentheses are based on fCLK = 6 MHz.
(2) Programmable square wave output
The 16-bit timer/counter outputs a square wave separately on the TO0 pin and TO1 pin.
Table 7-3 Programmable Square Wave Output Setting Range of 16-Bit Timer/Counter
Minimum pulse width
8/fCLK
(1.3
µ
s)
Maximum pulse width
216 × 8/fCLK
(87.4 ms)
The values in parentheses are based on fCLK = 6 MHz.
(3) Pulse width measurement
The 16-bit timer/counter measures the pulse width of a signal applied to the external interrupt pin INTP3.
Table 7-4 Pulse Width Measurement Range of 16-Bit Timer/Counter
Measurable pulse width
216 × 8/fCLK
(87.4 ms)
Resolution
8/fCLK
(1.3
µ
s)
The values in parentheses are based on fCLK = 6 MHz.
7.1.2 Configuration
The 16-bit timer/counter consists of one 16-bit timer 0 (TM0), two 16-bit compare registers (CR00, CR01), and one
16-bit capture register (CR02).
Fig. 7-2 shows the block diagram of the 16-bit timer/counter.