CHAPTER 9 TIMER/COUNTER FUNCTION
401
User’s Manual U15195EJ5V0UD
9.5.5 Operation
(1) Compare operation
TM4 can be used for a compare operation in which the value that was set in the compare register (CM4) is
compared with the TM4 count value.
If a match is detected by the compare operation, an interrupt (INTCM4) is generated. The generation of the
interrupt causes TM4 to be cleared (0) at the next count timing. This function enables timer 4 to be used as
an interval timer.
CM4 can also be set to 0. In this case, when an overflow occurs and TM4 becomes 0, a match is detected
and INTCM4 is generated. Although the TM4 value is cleared (0) at the next count timing, INTCM4 is not
generated by this match.
Figure 9-104. TM4 Compare Operation Example (1/2)
(a) When CM4 is set to n (non-zero)
1
TM4
Count clock
0
n
CM4
n
TM4 clear
Match detection
(INTCM4)
Count up
Clear
Remark
Interval time = (n + 1)
×
Count clock cycle
n = 1 to 65536 (FFFFH)
Содержание PD703114
Страница 2: ...2 User s Manual U15195EJ5V0UD MEMO ...