You are not logged in.
Pages: 1
Topic closed
I'm playing with the PWM pins on the Raspberry Pi now. How can I lock in a frequency. I need a frequency of 1Hz, with 0-100% duty cycle. Is this possible?
Thanks!
Offline
Hi,
for such a low frequency you can do without hardware PWM. Use a task with 10ms sampling time (this gives you 100 levels within duty cycle of 1s) and put the PWM function block inside. Set pertm=1 (i.e. 1 second, 1 Hz) and you are done. Is there any specific reason to use the hardware PWM?
Hope this helps,
Jaroslav
Last edited by jaroslav_sobota (2016-10-12 13:28:15)
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Thats for the reply Jaroslav,
I will play with the pwm block and let you know how it goes.
Are you saying because of the low frequency I could use any of the GPIO pins? In this case I could save the hardware pwm pin for something that really needs it.
Cheers
Mike
Offline
Hi Mike,
exactly. For such a low frequency you can use any GPIO pin.
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Pages: 1
Topic closed