CHAPTER 7 TIMER/COUNTER FUNCTION
User’s Manual U13850EJ6V0UD
213
7.2.2 PPG output operation
TMn can be used for PPG (Programmable Pulse Generator) output by setting 16-bit timer mode control register n
(TMCn) and capture/compare control register n (CRCn) as shown in Figure 7-5.
The PPG output function outputs a square wave from the TOn pin with a cycle specified by the count value set in
advance to 16-bit capture/compare register n0 (CRn0) and a pulse width specified by the count value set in advance
to 16-bit capture/compare register n1 (CRn1).
Figure 7-5. Control Register Settings in PPG Output Operation
(a) 16-bit timer mode control registers 0, 1 (TMC0, TMC1)
TMCn3
TMCn2
TMCn1
OVFn
TMCn
0
0
0
0
1
1
0
0
Clears and starts on
match between TMn
and CRn0.
(b) Capture/compare control registers 0, 1 (CRC0, CRC1)
CRCn2
CRCn1
CRCn0
CRCn
0
0
0
0
0
0
×
0
CRn0 used as compare
register
CRn1 used as compare
register
(c) 16-bit timer output control registers 0, 1 (TOC0, TOC1)
OSPTn
OSPEn
TOCn4
LVSn
LVRn
TOCn1
TOEn
TOCn
0
0
0
1
0/1
0/1
1
1
Enables TOn output.
Reverses output on
match between TMn
and CRn0.
Specifies initial value of
TOn output F/F.
Reverses output on
match between TMn
and CRn1.
Disables one-shot pulse
output.
Cautions 1.
Make sure that CRn0 and CRn1 are set to 0000H < CRn1 < CRn0
≤≤≤≤
FFFFH.
2.
PPG output sets the pulse cycle to (CRn0 set value + 1).
The duty factor is (CRn1 set value + 1)/(CRn0 set value + 1).
×
: don’t care
Содержание V850/SB1
Страница 2: ...User s Manual U13850EJ6V0UD 2 MEMO ...