Chapter 8 High-speed counter, PWM / Pulse train output and Analogue I/O

8.4.2 Setting the PWM Output

The settings of the PWM output operation are stored in the special internal outputs (WRF072 to WRF079).

(1)Setting the PWM output frequency

Set the frequency of output pulse for each PWM output to be used in special internal outputs. The setting values must be 10 to 2000 (HA to H7D0). If the frequency value is set to less than 10 Hz, it is changed to 10 Hz by the system.

It should be noted that the maximum frequency of the PWM output is 2 kHz. Even if a value larger than the maximum frequency is set, an error flag, etc. will not be output, so be careful not to set a frequency that exceeds 2 kHz. (Example) If the output frequency is 1 kHz, set “1000” (H3E8) in the special internal outputs.

WRF072:

Output frequency for PWM output 1

 

 

 

 

WRF073:

Output frequency for PWM output 2

 

 

 

 

WRF074:

Output frequency for PWM output 3

 

 

WRF075: Output frequency for PWM output 4

Figure 8.28 Special internal outputs for setting the PWM output frequency

In case of mode 1, WRF072 and WRF073 are used to set the on-preset value of a counter.

In case of mode 4, WRF072 and WRF075 are used to set the on-preset value of a counter.

(2)Setting the PWM output on-duty value

Set the on-duty value in the corresponding special internal output for each PWM output to be used. The setting values are 0 to 100 (H0 to H64) when the auto correction of on-duty values is not performed. If an on-duty value exceeding this range is specified, PWM outputs will not be generated. When performing auto correction, the range of on-duty values that can be set differs depending on the frequency and CPU mode to be set. For more details on the auto correction, see Section 8.1.5. When a function other than PWM is assigned, this setting is not necessary.

(Example) If the on-duty value is 70 %, set “70” (H46) in the special internal outputs.

WRF076:

On-duty value for PWM output 1

 

 

 

 

WRF077:

On-duty value for PWM output 2

 

 

 

 

WRF078:

On-duty value for PWM output 3

 

 

WRF079: On-duty value for PWM output 4

Figure 8.29 Special internal outputs for setting PWM output on-duty

In case of mode 1, WRF076 and WRF077 are used to set the off-preset value of a counter.

In case of mode 4, WRF076 and WRF079 are used to set the off-preset value of a counter.

8-16

Page 225
Image 225
Hitachi NJI-350B manual Setting the PWM Output, Setting the PWM output frequency, Setting the PWM output on-duty value