Is it possible to use two PWM channels independently?

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:


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!

James Fitzsimons

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

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).

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