Two pulse width modulation functions can be configured on the controller.
Adding a Pulse Width Modulation Function
To add a pulse width modulation function to your controller, select PWM in the Hardware Catalog, drag it to the Devices tree, and drop it on one of the highlighted nodes.
For more information on adding a device to your project, refer to:
• Using the Drag-and-drop Method
• Using the Contextual Menu or Plus Button
To access the PWM function parameters, proceed as follows:
Step |
Action |
---|---|
1 |
In the Devices tree, double-click MyController > Expert > DM72Fx > PWM. |
2 |
Select the PWM Configuration tab. |
The pulse width modulation function has the following parameters:
Parameter |
Value |
Default Value |
Description |
|
---|---|---|---|---|
SYNC input |
Location |
Disabled I1.2 |
Disabled |
Select the controller input used for presetting the pulse generator function. |
Bounce filter |
0.002 0.004 0.012 0.04 0.12 0.4 1.2 4 |
0.002 |
Set the filtering value to reduce the bounce effect on the SYNC input. |
|
SYNC Edge |
Rising Falling Both |
Rising |
Select the condition to preset the pulse generator function with the SYNC input. |
|
EN input |
Location |
Disabled I1.4 |
Disabled |
Select the controller input used for enabling the pulse generator function. |
Bounce filter |
0.002 0.004 0.012 0.04 0.12 0.4 1.2 4 |
0.002 |
Set the filtering value to reduce the bounce effect on the EN input. |
Synchronizing with an External Event
On a rising edge on the IN_SYNC physical input (with EN_Sync = 1), the current cycle is interrupted and the PWM restarts a new cycle.
This illustration provides a pulse diagram for the Pulse Width Modulation function block with use of IN_SYNC input: