Page 95
5.8 PWM Output Function
This function is used to output a variable duty cycle pulse train. The controllable duty cycle is 0 to 100 % (1 % units).
The PWM output is enabled when the pulse enable flag is ON. While the pulse enable flag is ON, the duty cycle (ON
duty) can be changed by changing the duty setting value (0 to 100). The frequency setting is available in the range of
50 to 5000 Hz (1 Hz units) before turning ON the pulse enable flag. The frequency changing is not allowed while the
pulse enable is ON. Note that the minimum ON/OFF pulse duration is 100 microsec. Therefore, the controllable ON
duty range is limited depending on the frequency setting as follows. If the ON duty setting value is not available
(within 0 to 100), the pulse width error flag comes ON. (PWM output operation is continued but the duty cycle is not
guaranteed)
The function selection is done through configuration register2
Function Register/device Remarks
PWM pulse Y0
Pulse enable flag M336 Output is enabled when ON
Frequency setting register MW22MW23 Data range: 50 to 5000
ON duty setting register
MW24MW25
Data range: 0 to 100
Pulse width error flag
M189
ON at error (reset OFF automatically)
ON duty setting error flag M190 ON at error (reset OFF automatically)
Frequency setting error flag
M191
ON at error (reset OFF automatically)
The Buffer is updated at each scan, so that the PWM frequency and duty cycle will be changed after each scan.