Special Functions
6-4. PWM Pulse Width Modulation
PWM K100 D10 Y0
X0
S1·
S2·
D·
T0
t
Function
and Action
Assign occupy/empty ratio value “n”. The bound is:1~255
Assign output frequency f. The bound is:0~72KHz
Assign Y number of output pulse
Can only output at Y000 or Y001 (please treat as transistor output type).
z The output occupy/empty ratio of PMW =n /256×100%
z PWM output use the unit of 0.1Hz, so when set (S1) frequency, the set value is 10
times of the actual frequency (i.e. 10f). E.g.:to set the frequency as 72KHz, then
set value in (S1) as 720000.
z When X000 is ON, output PWM wave;when X000 is OFF, stop outputting. PMW
output doesn’t have pulse accumulation.
S2·
D·
S1·
S2·
S2·
In the upward graph:T0=1/f
T/T0=n/256
16 bits instruction:PWM 32 bits instruction:-
Suitable Model:
XC3、XC5
Suitable device
Word
X
Y
M
S
T
C
Dn.m
D·
D FDDMDX DY DS TD CDK/H
S2·
S1·
S2·
S1·
Device
Bit
13