![NEC V850/SC1 User Manual Download Page 304](http://html.mh-extra.com/html/nec/v850-sc1/v850-sc1_user-manual_248178304.webp)
CHAPTER 8 TIMER/COUNTER FUNCTION
302
User’s Manual U15109EJ3V0UD
8.4 16-Bit Timer (TM5, TM6) Operation
8.4.1 Operation as an interval timer
TMn operates as an interval timer that repeatedly generates interrupts at the time interval specified by the count
value preset to 16-bit compare register n (CRn).
When the count value of 16-bit counter n (TMn) matches the set value of CRn, the value of TMn is cleared to 0,
and the timer continues counting. At the same time, an interrupt request signal (INTTMn) is generated.
The TMn count clock can be selected by bits 0 to 2 (TCLn0 to TCLn2) of timer clock select register n0 (TCLn0)
and by bit 0 (TCLn3) of timer clock select register n1 (TCLn1) (n = 5, 6).
Setting method
(1) Set each register.
•
TCLn0, TCLn1:
Selects the count clock.
•
CRn:
Compare value
•
TMCn0:
Selects the clear and start mode entered when TMn and CRn match.
(TMCn0 = 0000xxx0B,
×
= don’t care)
(2) When TCEn0 = 1 is set, counting starts.
(3) When the values of TMn and CRn match, INTTMn is generated (TMn is cleared to 0000H).
(4) INTTMn is then repeatedly generated at the same interval. When counting stops, set TCEn0 = 0.
Figure 8-32. Timing of Interval Timer Operation (1/2)
Basic operation
&
'
0001H
0000H 0001H
0000H 0001H
()
()
3
!
&
&
&
Remarks 1.
Interval time = (N + 1)
×
t; N = 0000H to FFFFH
2.
n = 5, 6