![](http://datasheet.mmic.net.cn/30000/MB89P475P-SH-101_datasheet_2367370/MB89P475P-SH-101_240.png)
224
CHAPTER 10 8/16-BIT TIMER/COUNTER
10.1
Overview of 8/16-bit Timer/Counter
The 8/16-bit timer/counter is made up of two 8-bit timers (Timer 11/21 and Timer 12/22)
that can be used separately (8-bit mode) or connected in cascade to form one counter
(16-bit mode).
Timer 11/21 can be selected to function as either an interval timer or a counter. The
interval timer function counts up in sync with one of three interval count clocks. The
counter function counts up by a clock input to the external pin.
Timer 12/22 functions as an interval timer clocked by one of three internal count clocks.
In the 16 bit mode, it is connected in series with Timer 11/21. The output can be used to
generate variable frequency square wave output.
I Interval timer function
The interval timer function generates repeated interrupts at variable intervals. Also, as the 8/16-bit timer/
counter can invert the output level of the pin (TO1/TO2 pin) each time an interval time is generated, the 8/
16-bit timer/counter can output variable frequency square waves (Timer 11/21 in 8 bit mode, or 16 bit
mode).
In 8-bit mode, Timer 11/21 and Timer 12/22 operate as two independent interval timers, each of which
can count time intervals ranging from the clock period (the time of one clock cycle) to 28 times the
clock period.
In 16-bit mode, the two counters form a single 16-bit timer, with Timer 11/21 containing the LSBs and
Timer 12/22 the MSBs. The interval timer can operate with a cycle among 1 and 216 times the internal
count clock cycle.
The count clock can be selected from three different internal clocks. (An external clock can be selected
for Timer 11/21, but it will then function as a counter).
"Interval times and square wave frequencies in 16-bit mode" list the interval time and square wave output
ranges for the various modes.
Table 10.1-1 Timer 11/21 interval times and square wave frequencies in 8-bit mode
Count clock cycle
Interval time
Square wave output range (Hz)
Internal count clock
2 tinst
2 tinst to 2
9 t
inst
1/(22 tinst) to 1/(2
10 t
inst)
32 tinst
25 tinst to 2
13 t
inst
1/(26 tinst) to 1/(2
14 t
inst)
512 tinst
29 tinst to 2
17 t
inst
1/(210 tinst) to 1/(2
18 t
inst)
External clock
1 text
1 text to 2
8 t
ext
1/(2 text) to 1/(2
9 t
ext)