libpruio: How to Turn Off PWM?

38 views
Skip to first unread message

Don Pancoe

unread,
Mar 13, 2019, 10:39:43 AM3/13/19
to BeagleBoard
I have been making good progress with learning and using libpruio, but I've hit a question I've been unable to work out for myself.

I've successfully started PWM signals using pruio_pwm_setValue(), but I'm having an issue turning those same PWM signals off when I'm done with them. I've tried using setValue() again with zero values for frequency and/or duty cycle, and my DMM (which can measure such things) is reporting zero frequency and duty cycle, but it is also measuring a constant 3v3 output on that header pin. Effectively a 100% duty cycle, which my DMM would actually report as zero frequency and duty cycle.

Is there anything I'm missing here, or are there better ways to turn off the PWM signal in libpruio?

FYI, I have a Beaglebone Black, Linux 4.14, Debian 6.3, but I've noticed more libpruio discussion on his board. I can also post any additional information needed.

Thanks,
Don

Don Pancoe

unread,
Mar 13, 2019, 4:49:06 PM3/13/19
to BeagleBoard
Using pruio_gpio_setValue() to set a value of zero seems to do the trick, but I'd still be curious to know if there is an "official" way to do this.

Don

TJF

unread,
Mar 14, 2019, 12:42:46 PM3/14/19
to BeagleBoard
Hi Don!


Am Mittwoch, 13. März 2019 21:49:06 UTC+1 schrieb Don Pancoe:
Using pruio_gpio_setValue() to set a value of zero seems to do the trick, but I'd still be curious to know if there is an "official" way to do this.

Setting the duty cycle to zero is the official way to switch off PWM output. (Note: switching off by setting the frequency to zero would be dangerous, since it will set the frequency for both outputs A and B in case of output generated by a PWMSS subsystem. That's why such a feature isn't implement.)

Regards

Don Pancoe

unread,
Mar 14, 2019, 4:32:48 PM3/14/19
to beagl...@googlegroups.com
Thank you for the reply! So far, pruio_pwm_setValue() with a non-zero frequency and zero duty cycle definitely seems like the most stable way to stop a PWM signal.

Don

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/b33823ba-e93b-494e-8a5d-f814def919d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages