149
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User’s Manual U16035EJ1V0UM
7.4.5 Interval timer (16-bit) operation
When “1” is set in bit 4 (TMC514) of 8-bit timer mode control register 51 (TMC51), the 16-bit resolution timer/counter
mode is entered.
The 8-bit timer/event counter operates as an interval timer which generates interrupt requests repeatedly at
intervals of the count value preset to the 8-bit timer compare registers (CR50, CR51).
[Setting]
<1> Set each register.
TCL50:
Select count clock in TM50.
Cascade-connected TM51 need not be selected.
CR50, CR51:
Compare value (each value can be set at 00H to FFH)
TMC50, TMC51: Select the clear & start mode by match of TM50 and CR50 (TM51 and CR51).
TM50
→
TMC50 = 0000
×××
0B
×
: don’t care
TM51
→
TMC51 = 0001
×××
0B
×
: don’t care
<2> When TMC51 is set to TCE51 = 1 and then, TMC50 is set to TCE50 = 1, count operation starts.
<3> When the values of TM50 and CR50 of cascade-connected timer match, INTTM50 of TM50 is generated
(TM50 and TM51 are cleared to 00H).
<4> INTTM50 generates repeatedly at the same interval.
Cautions 1. Stop timer operation without fail before setting compare register (CR50, CR51).
2. INTTM51 of TM51 is generated when TM51 count value matches CR51, even if cascade
connection is used. Ensure to mask TM51 to disable interrupt.
3. Set TCE50 and TCE51 in a sequential order of TM51 and TM50.
4. Count restart/stop can only be controlled by setting TCE50 of TM50 to 1/0.
Figure 7-12 shows an example of 16-bit resolution cascade connection mode timing.