For any MCU with PWM peripheral inside, this instruction create a PWM signal output from a specific PWM pin created by its peripheral. The numbers of pin of any MCU are different.
Set PWM Duty Cycle Instruction |
Its property set the frequency, duty cycle etc.
PWM Set Duty Cycle Property |
The Resolution could be:
- 0-100% (maximum resolution 6.7 bits)
- 0-256 (maximum resolution 8 bits)
- 0-512 (maximum resolution 9 bits)
- 0-1024 (maximum resolution 10 bits)
In this example, I use an input contact to turn on the PWM at 80% duty cycle.
PLC set PWM duty cycle ladder diagram instruction |
Hardware testing is just made with a simulator.
Hardware simulation in Proteus |
Click here to download the zip file of this example.
No comments:
Post a Comment