Dear Sir,
I have enabled ehrpwm2a and ehrpwm2b. Using command line I can program the period and duty_cycle in that order. However I have an odd behaviour where enabling ehrpwm2b the other channel 2a turns on too. Has anyone come across this problem. Is this issue related to programming the channel dts or programming order ?
My dts
ehrpwm2a_pins: pinmux_ehrpwm2a_pins {
pinctrl-single,pins = <
AM33XX_IOPAD(0x820, PIN_OUTPUT_PULLDOWN | MUX_MODE4)
>;
};
ehrpwm2b_pins: pinmux_ehrpwm2b_pins {
pinctrl-single,pins = <
AM33XX_IOPAD(0x824, PIN_OUTPUT_PULLDOWN | MUX_MODE4)
>;
};
&epwmss2 {
status = "okay";
ehrpwm2: pwm@48304200 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&ehrpwm2a_pins &ehrpwm2b_pins>;
};
};
make linux-dtbs, copied am335x-boneblack.dtb to /boot and reboot
Command line
1) program pwm0 first and check pin output
root@am335x-evm:~# cd /sys/class/pwm/pwmchip4
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 0 > export
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 500000 > pwm0/period
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 500000 > pwm0/duty_cycle
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 1 > pwm0/enable
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 0 > pwm0/enable
so far so good, pwm0 pin seen turning on and off
2) now program pwm1
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 1 > export
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 500000 > pwm1/period
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 500000 > pwm1/duty_cycle
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 1 > pwm1/enable
pwm1 came on, OOPS pwm0 has turned on too!
root@am335x-evm:/sys/class/pwm/pwmchip4# echo 0 > pwm1/enable
pwm1 turns off, OOPS pwm0 remains on.
3) Lets check pwm0 enable value
root@am335x-evm:/sys/class/pwm/pwmchip4# cat pwm0/enable
0
So the pin pwm0 output is on yet the enable variable is off.
I must be doing something wrong as I couldn't find this problem on the forum.
Other info
Beaglebone black
ti SDK 04.02.00.09
Much appreciate any help.
best regards