Unable to reverse PWM polarity debian-8.4-console

388 views
Skip to first unread message

vik

unread,
Jun 4, 2016, 3:14:10 PM6/4/16
to BeagleBoard

Hi ,

I am unable to reverse polarity to PWM port P8_19.

My Linux version Linux arm 4.4.6-ti-r15 #1 SMP Tue Apr 5 08:05:26 UTC 2016 armv7l GNU/Linux

I get Invalid argument error.

root@arm:/sys/devices/platform/ocp/48304000.epwmss/48304200.ehrpwm/pwm/pwmchip0/pwm1# echo 1000000 > period
root@arm:/sys/devices/platform/ocp/48304000.epwmss/48304200.ehrpwm/pwm/pwmchip0/pwm1# echo 500000 > duty_cycle
root@arm:/sys/devices/platform/ocp/48304000.epwmss/48304200.ehrpwm/pwm/pwmchip0/pwm1# echo 1 > enable
root@arm:/sys/devices/platform/ocp/48304000.epwmss/48304200.ehrpwm/pwm/pwmchip0/pwm1# echo 0 > enable
root@arm:/sys/devices/platform/ocp/48304000.epwmss/48304200.ehrpwm/pwm/pwmchip0/pwm1# cat polarity
normal
root@arm:/sys/devices/platform/ocp/48304000.epwmss/48304200.ehrpwm/pwm/pwmchip0/pwm1# echo 1 > polarity
bash: echo: write error: Invalid argument
root@arm:/sys/devices/platform/ocp/48304000.epwmss/48304200.ehrpwm/pwm/pwmchip0/pwm1#


I am using the ehrpwm2A PWM on P8_19. The following device tree overlay (BB-PWM2-00A0.dts):

/dts-v1/;

/plugin/;


/{

compatible = "ti,beaglebone", "ti,beaglebone-black";

part-number = "BB-PWM2";

version = "00A0";


fragment@0 {

target = <&am33xx_pinmux>;

__overlay__ {

pinctrl_spec: Panel_Pins {

pinctrl-single,pins = <

0x020 0x04 /* P8_19 MODE4 ehrpwm2A PWM */

>;

};

};

};


fragment@1 {

target = <&ocp>;

__overlay__ {

test_helper: helper {

compatible = "bone-pinmux-helper";

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_spec>;

status = "okay";

};

};

};


fragment@2 {

target = <&epwmss2>;

__overlay__ {

status = "okay";

};

};


fragment@3 {

target = <&ehrpwm2>;

__overlay__ {

status = "okay";

};

};


};




William Hermans

unread,
Jun 4, 2016, 4:06:29 PM6/4/16
to beagl...@googlegroups.com
root@arm:/sys/devices/platform/ocp/48304000.epwmss/48304200.ehrpwm/pwm/pwmchip0/pwm1# cat polarity
normal
root@arm:/sys/devices/platform/ocp/48304000.epwmss/48304200.ehrpwm/pwm/pwmchip0/pwm1# echo 1 > polarity
bash: echo: write error: Invalid argument
 
The error here is self explanatory, and obvious. Look at the difference between your cat of polarity, and then what you attempt to echo into polarity.

I'll give you a hint. polarity is not expecting a numerical value.

--
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/a0c929be-560b-4f2e-8e3d-ed45d083adc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brett Hamilton

unread,
Oct 3, 2016, 2:41:24 PM10/3/16
to BeagleBoard
I know you've solved it or moved on but "inversed" is the secret word you're looking for. Took a bunch of digging through source & guessing to find it, maybe I can save somebody else the headache if they happen to find this thread.

bui...@gmail.com

unread,
Jun 14, 2018, 8:03:41 PM6/14/18
to BeagleBoard
Thank you Brett Hamilton!
Reply all
Reply to author
Forward
0 new messages