CHAPTER 8 8-BIT PWM TIMERS
162
User
’
s Manual U15017EJ2V0UD
(2) Cascade (16-bit timer) mode
Operation as interval timer (with 16-bit resolution)
The two PWM timers can be used as a timer counter with 16-bit resolution by setting bit 4 (TMC514) of
8-bit timer mode control register 51 (TMC51) to 1.
In this case, the 16-bit timer counter operates as an interval timer that repeatedly generates an interrupt
request at intervals specified by the count value preset to 8-bit compare register 51 (CR51).
[Setting]
(1) Set each register.
TCL50:
TM50 selects the count clock.
The setting of TM51 cascaded timer is not necessary.
Compare value (Each compare value can be set in a range of 00H to FFH.)
Selects the clear & start mode in which the timers are cleared and started on match
between TM5n and CR5n.
TM50
→
TMC50 = 0000
×××
0B
×
: don
’
t care
TM51
→
TMC51 = 0001
×××
0B
×
: don
’
t care
(2) The counting is started when TCE51 of TMC51 is set to 1 followed by setting of TCE50 of TMC50
to 1.
(3) When the values of TM5n and CR5n of the cascaded timers cascade match, INTTM50 is generated
by TM50 (all the TM5n
’
s are cleared to 00H).
(4) After that, INTTM50 is repeatedly generated at the same interval.
CR5n:
TMC5n:
Cautions 1. Before setting 8-bit compare register 5n (CR5n), be sure to stop the timer operation.
2. Even when the timers are cascaded, if the count value of TM51 matches the value
of CR51, INTT51 of TM51 is generated, unless masked. Be sure to mask and disable
the interrupt of TM51.
3. Set TCE51 of TMC51 first, and then TCE50 of TMC50.
4. The counting can be restarted or stopped by setting 1 or 0 to TCE50 of only TMC50.
When setting 8-bit compare register 5n (CR5n), be sure to clear bit 7 (TCE50) of
TMC50 and bit 7 (TCE51) of TMC51.
Remark
n = 0 or 1