Is it possible to use two PWM channels independently?

126 views
Skip to first unread message

James Fitzsimons

unread,
Feb 27, 2018, 4:19:42 AM2/27/18
to BeagleBoard
Hi all,

I've got pwm working both through echoing values directly to the device files from bash, and also via my C++ program. However I can't get two channels of a epwmss device to operate independently. e.g. If I export both 
/sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip1/pwm-1:0 and pwm-1:1 then set a value for period and duty on either one of the channels (pwm-1:0 or pwm-1:1), as soon as I enable that channel both channels start. Stopping the channel stops both channels. I've even tested starting one channel then stopping the other and both stop.

I had read elsewhere that both channels had to use the same frequency (period), which would work for my application, however I need to be able to set the duty cycle and enable/disable independently. Is that possible?

I'm using the 4.14.20-ti-r36 kernel and have the following overlays enabled:

uboot_overlay_addr6=/lib/firmware/am33xx_pwm-00A0.dtbo
uboot_overlay_addr7=/lib/firmware/BB-PWM0-00A0.dtbo

I'll go read the Technical Reference Manual now, but if someone can shed some light on this for me it would be much appreciated!

Cheers,
James Fitzsimons

evilwulfie

unread,
Feb 27, 2018, 6:00:08 AM2/27/18
to beagl...@googlegroups.com
Thee are 6 pwm channels

3 pairs use the same frequency but all can have independent duty cycles

Pick one each from different group for your application
--
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/c769153a-74e9-4ff5-9fa4-de9ef116ccc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

TJF

unread,
Feb 27, 2018, 2:40:41 PM2/27/18
to BeagleBoard
You can generate PWM outputs by
  • 2x3 channels on the PWM modules in the PWMSS
  • 3 channels on the CAP modules in the PWMSS (P9_28, P9_42, JT_05=5V)
  • 4 channels on TIMER 4 to 7 (P8_07, P8_08, P8_09, P8_10
  • 1 channel on CAP module in the PRU (P8_15)

In case of the PWM modules the A and B channel operates at the same frequency (and start at the same time). In order to switch a channel off, you can set the duty cycle to 0 (zero).


All other outputs can operate independendly (duty cycle, frequency and start time).

James Fitzsimons

unread,
Feb 28, 2018, 4:29:48 AM2/28/18
to Beagle Board
Thanks very much guys, I now understand the limitations of the epwmss better. 

After giving it some more thought, I think I should be able to get by without having the need to switch either the A or B output off independently. Varying the duty cycle should be sufficient.

Thanks again,
James Fitzsimons

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/BnQ64iCb6kw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/b13da308-9310-46dd-ad68-6a21e4a42a86%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages