This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using PWM to control RGB led with Linux Kernel 3.12

Hi,

I followed another thread (device-tree entry for pwmleds in linux3.12) to get the following device tree in order to activate the ecap pwm on Linux Kernel 3.12 (im using a Beaglebone Black Rev C), I used it to patch am335x-bone-common.dtsi:

am33xx_pinmux: pinmux@44e10800 {
            pinctrl-names = "default"; 

                backlight_pin_0: pinmux_backlight_pin_0 {
                        pinctrl-single,pins = <
                                0x164 0x00  
                        >;
                };
                backlight_pin_1: pinmux_backlight_pin_1 {
                        pinctrl-single,pins = <
                                0x18C 0x03  
                        >;
                };
                backlight_pin_2: pinmux_backlight_pin_2 {
                        pinctrl-single,pins = <
                                0x188 0x03  
                        >;
                };

};

       pwm_led {
                compatible = "pwm-leds";
                led0 {
                        pwms = <&ecap0 0 50000 1>;
                        max-brightness = <255>;
                        linux,default-trigger = "default-on";
                        brightness = <127>;
                };
                led1 {
                        pwms = <&ecap1 0 50000 1>;
                        max-brightness = <255>;
                        linux,default-trigger = "default-on";
                        brightness = <127>;
                };
                led2 {
                        pwms = <&ecap2 0 50000 1>;
                        max-brightness = <255>;
                        linux,default-trigger = "default-on";
                        brightness = <127>;
                };

        };


ocp {
                epwmss0: epwmss@48300000 {
                        status = "okay";
                        ecap0: ecap@48300100 {
                                status = "okay";
                                pinctrl-names = "default";
                                pinctrl-0 = <&backlight_pin_0>;
                        };
                };
                epwmss1: epwmss@48302000 {
                        status = "okay";
                         ecap1: ecap@48302100 {
                                status = "okay";
                                pinctrl-names = "default";
                                pinctrl-0 = <&backlight_pin_1>;
                        };
                };

                epwmss2: epwmss@48304000 {
                        status = "okay";
                         ecap2: ecap@48304100 {
                                status = "okay";
                                pinctrl-names = "default";
                                pinctrl-0 = <&backlight_pin_2>;
                        };
		};

};

However i can only see two pins that output ecap PWM ou Beaglebone Black System Reference Manual:

  • Pin 42, GPIO0_7 (MODE 0): eCAP0_in_PWM0_out,
  • Pin 28, SPI1_CS0 (MODE 4): eCAP2_in_PWM2_out;

both on Expansion Header P9.

On that question they refer to this pins:

  1. E18 --> Pinmux mode 0 --> eCAP0_in_PWM0_out
  2. B19 --> Pinmux mode 3 --> eCAP1_in_PWM1_out
  3. C18 --> Pinmux mode 3 --> eCAP2_in_PWM2_out

So basically i can only get the first one working fine (Pin 42), the others i can't find or i don't no which pin corresponds to it? can you help me on this? What am i missing?

Another question is, is it not possible to use the eHRPWM instead? As i can understand there can be 3 outputs of these with two channels each, this would be perfect for my application.

Thank you in advance.