3.13.4 Operation in Each Mode
(1) 16 bit timer mode
Generating interrupts at fixed intervals
In this example, the interrupt INTTB01 is set to be generated at fixed intervals. The
interval time is set in the timer register TB0RG1H/L.
←
TB0RUN
← X
INTETB0
←
TB0FFCR
←
TB0MOD
←
TB0RG1
←
TB0RUN
X: Don't care, −: No change
(2) 16 bit event counter mode
In 16 bit timer mode as described in above, the timer can be used as an event
counter by selecting the external clock (TB0IN0 pin input) as the input clock. Up
counter (UC10) counts up at the rising edge of TB0IN0 input. To read the value of
the counter, first perform "software capture" once and read the captured value.
←
TB0RUN
← X
PPCR
←
PPFC
← X
INTETB0
←
TB0FFCR
←
TB0MOD
←
TB0RG1
←
TB0RUN
X: Don't care, −: No change
When used as an event counter, set the prescaler in RUN mode.
(TB0RUN <TB0PRUN> = "1")
7
6
5
4
3
2
1
–
0
X
X
–
–
X
1
0
0
X
0
0
1
1
0
0
0
0
1
0
0
1
0
0
1
*
(** = 01, 10, 11)
*
*
*
*
*
*
*
*
*
*
*
*
*
*
–
0
X
X
–
1
X
7
6
5
4
3
2
1
–
0
X
X
–
–
X
X
–
1
–
–
–
–
–
–
1
–
–
–
1
0
0
X
0
0
1
1
0
0
0
0
1
0
0
1
0
0
1
0
*
*
*
*
*
*
*
*
*
*
*
*
*
*
–
0
X
X
–
1
X
92CZ26A-308
0
0
Stop TMRB0
0
Enable INTTB01and set interrupt level 4.
Disable INTTB00
1
Disable the trigger
*
Select internal clock for input and
disable the capture function.
*
Set the interval time
*
(16 bits).
1
Start TMRB0.
0
0
Stop TMRB0
X
Set PP4 to input mode for TB0IN0
X
0
Enable INTTB01 and sets interrupt level 4
Disable INTTB00
1
Disable trigger
0
Select TB0IN0 as the input clock
*
Set the number of counts
*
(16 bit)
1
Start TMRB0
TMP92CZ26A