beaglebone black pwm pin can't find duty, period, ...

35 views
Skip to first unread message

Ray Madigan

unread,
Jul 2, 2016, 12:34:54 PM7/2/16
to BeagleBoard
I am trying to use the pin P8_13 for pwm.  When I load the overlay I the power file is created but no duty, period, ... files are created.  I am clearly doing something wrong.  I can't use the universal overlay because I can't figure out how to load a one wire device in the universal overlay.  With the universal overlay the pwm works perfectly.  

I am using kernel 3.8.13-bone70

My overlay is as follows:

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

        /* identification */
        part-number = "BREW_PWM_P8_13";

        /* state the resources this cape uses */
        exclusive-use =
                /* the pin header uses */
                "P8.13",
                /* the hardware IP uses */
                "ehrpwm2B";

        fragment@0 {
                target = <&am33xx_pinmux>;
                __overlay__ {
                        brew_pwm_P8_13: pinmux_brew_pwm_P8_13 {
                                pinctrl-single,pins = <0x024 0x24>;
                        };
                };
        };

        fragment@1 {
                target = <&ocp>;
                __overlay__ {
                        brewery_pwm_P8_13 {
                                compatible      = "pwm_brew";
                                pwms            = <&ehrpwm2 1 500000 0>;
                                pwm-names       = "PWM_P8_13";
                                pinctrl-names   = "pwm";
                                pinctrl-0       = <&brew_pwm_P8_13>;
                                enabled         = <1>;
                                duty            = <0>;
                                status          = "okay";
                        };
                };
        };
};

when I load the overlay dmesg shows the overlay was accepted

the directory for the pwm pin is created and it has 
modalias: a file
power: a directory
subsystem: a link
uevent: a file

I can't find the duty, period, ... files that are needed to control the pwm.

Any guidance would be appreciated.

TJF

unread,
Jul 3, 2016, 12:49:02 PM7/3/16
to BeagleBoard
Hi Ray!


Am Samstag, 2. Juli 2016 18:34:54 UTC+2 schrieb Ray Madigan:
Any guidance would be appreciated.

You could use libpruio. Your code will execute faster than any sysfs solution and it's more easy to use (single source, no user device tree). And it offers lots of additional features not implemented by the kernel drivers (ie. synchronize PWM timing between different outputs).

BR
Reply all
Reply to author
Forward
0 new messages