
213
CHAPTER 10
8-BIT TIMERS 5, 6
User’s Manual U12697EJ4V1UD
10.4.2 Operation as interval timer (16-bit operation)
Cascade connection (16-bit timer) mode
By setting bit 4 (TMC64) of 8-bit timer mode control register 6 (TMC6) to 1, the timer enters the timer mode with
16-bit resolution.
With the count preset in 8-bit compare registers 50 and 60 (CR50, CR60) as the interval, the timer operates
as an interval timer by repeatedly generating interrupt requests.
<Setting method>
<1> Set each register.
PRM5: TM5 selects the count clock. TM6 connected in cascade is not used for setting.
CRn0:
Compare values (each compare value can be set from 00H to FFH).
TMCn:
Select the clear and start mode when TMn and CRn0 match.
TM5
→ TMC5 = 0000×××0B, ×: Don’t care
TM6
→ TMC6 = 0001×××0B, ×: Don’t care
<2> Setting TCE6 = 1 for TMC6 and setting TCE5 = 1 for 8-bit timer mode control register 5 (TMC5) starts the count
operation.
<3> If the values of TMn of all timers connected in cascade and CRn0 match, INTTM5 of TM5 is generated. (TM5
and TM6 are cleared to 00H.)
<4> INTTM5 are repeatedly generated at the same interval.
Cautions 1. Always set the compare register (CR50, CR60) after stopping timer operation.
2. If the TM6 count value matches CR60 even when used in a cascade connection, INTTM6 of
TM6 is generated. Always mask TM6 in order to disable interrupts.
3. Set TCE5 and TCE6 in TM6 first. Set TM5 last.
4. Restarting and stopping the count is possible by setting 1 or 0 only in TCE5 of TMC5. Note,
however, that TCE5 of TMC5 and bit 7 (TCE6) of TMC6 must be cleared when setting CR50
and CR60.
Figure 10-8 shows a timing example of the cascade connection mode with 16-bit resolution.
Figure 10-8. Cascade Connection Mode with 16-Bit Resolution
Count
clock
TM5
TM6
CR50
CR60
TCE5
TCE6
INTTM5
00H
01H
N+1
N
FFH 00H
FFH 00H 01H
N 00H 01H
A 00H
N
M
01H
02H
M–1 M
00H
B 00H
Operation enabled
Count starts
Interval time
Interrupt
request
generated
Level inverted
Counter cleared
Operation
stopped