
CHAPTER 7 16-BIT TIMER/EVENT COUNTERS 0 AND 1
User’s Manual U15905EJ2V1UD
229
7.6
Application Examples
(1) Interval timer
By setting the TMCn0 and TMCn1 registers as shown in Figure 7-9, the 16-bit timer/event counter operates as
an interval timer that repeatedly generates interrupt requests with the value that was preset in the CCn0
register as the interval.
When the counter value of the TMn register matches the setting value of the CCn0 register, the TMn register is
cleared (0000H) and an interrupt request signal (INTCCn0) is generated at the same time that the count
operation resumes.
Remark
n = 0, 1
Figure 7-9. Contents of Register Settings When 16-Bit Timer/Event Counter Is Used as Interval Timer
Supply input clocks to internal units
Enable count operation
0
0/1
1
0
0/1
1
OSTn ENTOn ALVn
ETIn CCLRn
CMSn1 CMSn0
0/1
0
1
OVFn
TMCn0
TMCn1
CSn2 CSn1 CSn0
TMCEn TMCAEn
Use CCn0 register as compare register
Clear TMn register due to match with
CCn0 register
Continue counting after TMn register
overflows
ECLRn
Remarks 1. 0/1: Set to 0 or 1 as necessary
2. n = 0, 1