NEC mPD784225 Series User Manual page 217

16-/8-bit single-chip microcontrollers
Table of Contents

Advertisement

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 are not used in 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, the 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 TM6 count matches CR60 even when used in a cascade connection, INTTM6 of TM6 is
generated. Always mask TM6 in order to disable interrupts.
3. The TCE5, TCE6 setting begins at TM6. Set theTM5 last.
4. Restarting and stopping the count is possible by setting 1 or 0 only in TCE5 of TMC5. Note,
however, that the 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
00H
01H
TM6
00H
CR50
CR60
TCE5
TCE6
INTTM5
Operation enabled
Count starts
CHAPTER 10 8-BIT TIMERS 5, 6
N
N+1
FFH 00H
01H
N
M
Interval time
User's Manual U12697EJ3V0UM
FFH 00H
FFH 00H 01H
02H
M–1 M
Interrupt
request
generated
Level inverted
Counter cleared
N 00H 01H
A 00H
00H
B 00H
Operation
stopped
217

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mpd784225y seriesMpd784224Mpd784225Mpd78f4225Mpd784224yMpd784225y ... Show all

Table of Contents