Operation Of 8-Bit Timers H0 And H1; Operation As Interval Timer/Square-Wave Output - NEC MuPD78F0132H User Manual

8-bit single-chip microcontrollers, 78k0/ke1plus
Table of Contents

Advertisement

8.4 Operation of 8-Bit Timers H0 and H1

8.4.1 Operation as interval timer/square-wave output

When 8-bit timer counter Hn and compare register 0n (CMP0n) match, an interrupt request signal (INTTMHn) is
generated and 8-bit timer counter Hn is cleared to 00H.
Compare register 1n (CMP1n) is not used in interval timer mode. Since a match of 8-bit timer counter Hn and the
CMP1n register is not detected even if the CMP1n register is set, timer output is not affected.
By setting bit 0 (TOENn) of timer H mode register n (TMHMDn) to 1, a square wave of any frequency (duty = 50%)
is output from TOHn.
(1) Usage
Generates the INTTMHn signal repeatedly at the same interval.
<1> Set each register.
Figure 8-9. Register Setting During Interval Timer/Square-Wave Output Operation
(i)
Setting timer H mode register n (TMHMDn)
TMHEn
CKSn2
TMHMDn
0
0/1
(ii) CMP0n register setting
• Compare value (N)
<2> Count operation starts when TMHEn = 1.
<3> When the values of 8-bit timer counter Hn and the CMP0n register match, the INTTMHn signal is generated
and 8-bit timer counter Hn is cleared to 00H.
<4> Subsequently, the INTTMHn signal is generated at the same interval. To stop the count operation, clear
TMHEn to 0.
Remark n = 0, 1
208
CHAPTER 8 8-BIT TIMERS H0 AND H1
CKSn1
CKSn0
TMMDn1
TMMDn0 TOLEVn
0/1
0/1
0
Interval time = (N +1)/f
CNT
User's Manual U16899EJ2V0UD
TOENn
0
0/1
0/1
Timer output setting
Timer output level inversion setting
Interval timer mode setting
Count clock (f
Count operation stopped
) selection
CNT

Advertisement

Table of Contents
loading

Table of Contents