Datasheet
78K0/Ix2 CHAPTER 8 8-BIT TIMER/EVENT COUNTER 51
R01UH0010EJ0500 Rev.5.00 329
Feb 28, 2012
8.4 Operation of 8-Bit Timer/Event Counter 51
8.4.1 Operation as interval timer
8-bit timer/eve
nt counter 51 operates as an interval timer that generates interrupt requests repeatedly at intervals of the
count value preset to 8-bit timer compare register 51 (CR51).
When the count value of 8-bit timer counter 51 (TM51) matches the value set to CR51, counting continues with the
TM51 value cleared to 0 and an interrupt request signal (INTTM51) is generated.
The count clock of TM51 can be selected with bits 0 to 2 (TCL510 to TCL512) of timer clock selection register 51
(TCL51).
Setting
<1> Set the registers.
TCL51: Select the count clock.
CR51: Compare value
TMC51: Stop the count operation.
(TMC51 = 00000000B)
<2> After TCE51 = 1 is set, the count operation starts.
<3> If the values of TM51 and CR51 match, INTTM51 is generated (TM51 is cleared to 00H).
<4> INTTM51 is generated repeatedly at the same interval.
Set TCE51 to 0 to stop the count operation.
Caution Do not write other values to CR51 during operation.
Remark For how to enable the INTTM51 signal interrupt, refer to CHAPTER 18 INTERRUPT FUNCTIONS.
Figure 8-9. Interval Timer Operation Timing (1/2)
(a) Basic operation
t
Count clock
TM51 count value
CR51
TCE51
INTTM51
Count start Clear Clear
00H 01H N 00H 01H N 00H 01H N
NNNN
Interrupt acknowledged Interrupt acknowledged
Interval timeInterval time
Remark Interval time = (N + 1) t, N = 01H to FFH