CHAPTER 7 TIMER/COUNTER FUNCTION
User’s Manual U13850EJ6V0UD
242
7.4 8-Bit Timer Operation
7.4.1 Operation as interval timer (8-bit operation)
The timer operates as an interval timer that repeatedly generates interrupts at the interval of the count preset by 8-
bit compare register n (CRn0).
If the count in 8-bit counter n (TMn) matches the value set in CRn0, the value of TMn is cleared to 0 and TMn
continues counting. At the same time, an interrupt request signal (INTTMn) is generated.
The TMn count clock can be selected by the TCLn0 to TCLn2 bits of timer clock selection register n0 (TCLn0) and
by the TCLn3 bit of timer clock selection register n1 (TCLn1) (n = 2 to 7).
Setting method
(1) Set each register.
• TCLn0, TCLn1:
Select the count clock.
• CRn0:
Compare value
• TMCn:
Selects the clear and start mode when TMn and CRn0 match.
(TMCn = 0000xx11B, x is don’t care)
(2) When TCEn = 1 is set, counting starts.
(3) When the values of TMn and CRn0 match, INTTMn is generated (TMn is cleared to 00H).
(4) Then, INTTMn is repeatedly generated at the same interval. When counting stops, set TCEn = 0.
Figure 7-32. Timing of Interval Timer Operation (1/3)
Basic operation
TMn count value
CRn0
00H
01H
N
00H
01H
00H
01H
N
N
Count start
Clear
Clear
N
N
N
N
Interrupt acknowledgment
Interrupt
acknowledgment
TCEn
INTTMn
TOm
Interval time
Interval time
Interval time
Count clock
t
Remarks 1.
Interval time = (N + 1)
×
t; N = 00H to FFH
2.
n = 2 to 7,
m = 2 to 5
Содержание V850/SB1
Страница 2: ...User s Manual U13850EJ6V0UD 2 MEMO ...