Datasheet

78K0/Ix2 CHAPTER 9 8-BIT TIMER H1
R01UH0010EJ0500 Rev.5.00 341
Feb 28, 2012
9.4 Operation of 8-Bit Timer H1
9.4.1 Operation as interval time
r/square-wave output
When the 8-bit timer counter H1 and compare register 01 (CMP01) match, an interrupt request signal (INTTMH1) is
generated and the 8-bit timer counter H1 is cleared to 00H.
Compare register 11 (CMP11) is not used in interval timer mode. Since a match of the 8-bit timer counter H1 and the
CMP11 register is not detected even if the CMP11 register is set, timer output is not affected.
By setting bit 0 (TOEN1) of timer H mode register n (TMHMD1) to 1, a square wave of any frequency (duty = 50%) is
output from TOH1.
Setting
<1> Set each register.
Figure 9-9. Register Setting During Interval Timer/Square-Wave Output Operation
(i) Setting timer H mode register 1 (TMHMD1)
0 0/1 0/1 0/1 0 0 0/1 0/1
TMMD10 TOLEV1 TOEN1CKS11CKS12TMHE1
TMHMD1
CKS10 TMMD11
Timer output setting
Default setting of timer output level
Interval timer mode setting
Count clock (f
CNT) selection
Count operation stopped
(ii) CMP01 register setting
The interval time is as follows if N is set as a comparison value.
Interval time = (N +1)/f
CNT
<2> Count operation starts when TMHE1 = 1.
<3> When the values of the 8-bit timer counter H1 and the CMP01 register match, the INTTMH1 signal is generated
and the 8-bit timer counter H1 is cleared to 00H.
<4> Subsequently, the INTTMH1 signal is generated at the same interval. To stop the count operation, clear TMHE1
to 0.
Remarks 1. For the setting of the output pin, refer to 9.3 (4) Port mode registers 0 and 3 (PM0, PM3).
2. For how to enable the INTTMH1 signal interrupt, refer to CHAPTER 18 INTERRUPT FUNCTIONS.