Example Of Pwm Signal Output By 16-Bit Timer/Counter; Setting Of Control Registers For Pwm Output Operation - NEC PD78212 User Manual

8-bit single-chip microcomputer sub-series
Table of Contents

Advertisement

(4) PWM output operation
In PWM output operation, a pulse signal with a duty factor determined by the value set in a compare register
is output. (See Fig. 7-35.)
The duty factor of a PWM output signal can be changed in steps of 1/65536 from 1/65536 to 65535/65536.
In addition, 16-bit timer 0 (TM0) has two compare registers, so that two types of PWM signals can be output.
Fig. 7-36 shows the setting of control registers. Fig. 7-37 shows the setting procedure. Fig. 7-38 shows the
procedure for changing the duty factor of PWM output.
Fig. 7-35 Example of PWM Signal Output by 16-Bit Timer/Counter
TM0
count value
0H
TO0
(active low)
Fig. 7-36 Setting of Control Registers for PWM Output Operation
TMC0
CRC0
TOC
PMC3
FFFFH
CR00
Timer starts
(a) Timer control register 0 (TMC0)
7
6
5
4
3
×
0
0
0
1
(b) Capture/compare control register 0 (CRC0)
7
6
5
4
3
1
1
0
0
0
(c) Timer output control register (TOC)
7
6
5
4
3
×
×
×
×
×
(d) Port 3 mode control register (PMC3)
7
6
5
4
3
×
×
×
×
1
Chapter 7 Timer/Counter Units
FFFFH
CR00
CR00
2
1
0
0
0
0
Overflow flag
Enables counting TM0
2
1
0
0
0
0
Disables clearing TM0
Both TO0 and TO1 are used for
PWM output
2
1
0
×
1
1
TO0 for low-active PWM signal output
Enables PWM output for TO0
2
1
0
×
×
×
Specifies P34 pin as TO0
output
FFFFH
135
7
#

Advertisement

Table of Contents
loading

Table of Contents