137
Chapter 7 Timer/Counter Units
7
(5) PPG output operation
In PPG output operation, a pulse signal with a period and duty factor determined by the values set in the
compare registers is output. (See Fig. 7-39.)
Fig. 7-40 shows the setting of control registers. Fig. 7-41 shows the setting procedure. Fig. 7-42 shows the
procedure for changing the duty factor of PPG output.
Fig. 7-39 Example of PPG Signal Output by 16-Bit Timer/Counter
CR00 CR00 CR00
Timer starts
0H
TM2
count value
(active low)
TO0
CR01 CR01 CR01
Fig. 7-40 Setting of Control Registers for PPG Output Operation
(a) Timer control register 0 (TMC0)
(b) Capture/compare control register 0 (CRC0)
(c) Timer output control register (TOC)
(d) Port 3 mode control register (PMC3)
76543210
10 0
00
1
CRC0 11
Clears when TM0 coincides
with CR01
TO0 is used for PPG output
76543210
TOC 11
××××××
TO0 for low-active PPG signal output
Enables PPG output for TO0
76543210
××× ××××
1
PMC3
Specifies P34 pin as TO0
output
76543210
00 0
000
1
TMC0
Overflow flag
Enables counting TM0
×