CHAPTER 7 TIMER/COUNTER FUNCTION
188
Figure 7-39. Timing of External Event Counter Operation (when rising edge is set)
TIn
TMn count
value
0005
0004
0003
0002
0001
0000
N
−
1
N
CRn0
INTTMn
N
0003
0002
0001
0000
Remark
n = 2 to 5
7.4.3 Operating as square wave output (8-bit resolution)
A square wave having any frequency is output at the interval preset in the 8-bit compare register n (CRn0).
By setting bit (TOEn) 0 of the 8-bit timer mode control register n (TMCn) to 1, the output state of TOn is inverted
with the count preset in CRn0 as the interval. Therefore, a square wave output having any frequency (duty cycle =
50%) is possible.
Setting method
(1) Set the registers.
• Set the port latch and port mode register to “0.”
• TCLn
: Select the count clock.
• CRn0
: Compare value
• TMCn
: Clear and start mode when TMn and CRn0 match.
LVSn
LVRn
Setting State of Timer Output Flip-flop
1
0
High level output
0
1
Low level output
Inversion of timer output flip-flop enabled
Timer output enabled
→
TOEn = 1
(2) When TCEn = 1 is set, the counter starts operating.
(3) If the values of TMn and CRn0 match, the timer output flip-flop inverts. Also, INTTMn is generated and
TMn is cleared to 00H.
(4) Then, the timer output flip-flop is inverted for the same interval to output a square wave from TOn.
Summary of Contents for V850/SA1 mPD703015
Page 2: ...2 MEMO ...
Page 100: ...100 MEMO ...
Page 144: ...144 MEMO ...
Page 200: ...200 MEMO ...
Page 328: ...328 MEMO ...
Page 356: ...356 MEMO ...
Page 358: ...358 MEMO ...
Page 368: ...368 MEMO ...
Page 374: ...374 MEMO ...
Page 382: ...382 MEMO ...