Skip to content

Commit

Permalink
added a motor control cape overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
dunmatt committed Mar 6, 2014
1 parent 4d85e60 commit 9d10909
Show file tree
Hide file tree
Showing 2 changed files with 326 additions and 3 deletions.
5 changes: 2 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Firmware:
check if everything in fragments 0-7 are necessary LOW
check if the other analog channels can be disabled LOW
check if things can be renamed

Hardware:
hook up the string pot
Expand All @@ -9,6 +10,4 @@ Hardware:
Software:
Turn our current data into a response curve
Use the response curve to adapt the output of PID to useful values
Figure out IIO to bypass running out of file descriptors problem
Add robustness to readAin
Remove all hard coded pin stuffs
Figure out IIO to bypass running out of file descriptors problem (maybe unnecessary)
324 changes: 324 additions & 0 deletions overlays/robonono-00A0.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
/*
* Copyright (C) 2014 M@ Dunlap
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/plugin/;

/*
TODO: figure out the pinmux settings for P8_03-P8_08 (LEDs)
TODO: figure out the pinmux settings for P8_21-P8_30 (A and B channels)
*/

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

/* identification */
part-number = "thigh_bone";
version = "00A0";

/* state the resources this cape uses */
exclusive-use =
/* the pin header uses */
"P8.03", /* LED */
"P8.13", /* pwm: ehrpwm2B */
"P8.19", /* pwm: ehrpwm2A */
"P9.14", /* pwm: ehrpwm1A hooked up to the LED */
"P9.16", /* pwm: ehrpwm1B hooked up to the LED */
"P9.21", /* pwm: ehrpwm0B */
"P9.22", /* pwm: ehrpwm0A */
"P9.39", /* AIN0 */
"P9.40", /* AIN1 */
"P9.37", /* AIN2 */
"P9.38", /* AIN3 */
"P9.33", /* AIN4 */
"P9.36", /* AIN5 */
"P9.35", /* AIN6 */


/* the hardware IP uses */
"tscadc",
"ehrpwm0A",
"ehrpwm0B",
"ehrpwm1A",
"ehrpwm1B",
"ehrpwm2A",
"ehrpwm2B";

/* Experimental am33xx unknown overlay */
fragment@0 {
target = <&epwmss0>;
__overlay__ {
status = "okay";
};
};

fragment@1 {
target = <&ehrpwm0>;
__overlay__ {
status = "okay";
};
};

fragment@2 {
target = <&ecap0>;
__overlay__ {
status = "okay";
};
};

fragment@3 {
target = <&epwmss1>;
__overlay__ {
status = "okay";
};
};

fragment@4 {
target = <&ehrpwm1>;
__overlay__ {
status = "okay";
};
};

fragment@5 {
target = <&epwmss2>;
__overlay__ {
status = "okay";
};
};

fragment@6 {
target = <&ehrpwm2>;
__overlay__ {
status = "okay";
};
};

fragment@7 {
target = <&ecap2>;
__overlay__ {
status = "okay";
};
};


/* Working PWM fragments */
fragment@8 {
target = <&am33xx_pinmux>;
__overlay__ {
pwm_P8_19: pinmux_pwm_P8_19_pins {
pinctrl-single,pins = <0x020 0x4>; /* P8_19 (ZCZ ball U10) | MODE 4 */
};
};
};

fragment@9 {
target = <&ocp>;
__overlay__ {
pwm_test_P8_19 {
compatible = "pwm_test";
pwms = <&ehrpwm2 0 5000000 1>;
pwm-names = "PWM_P8_19";

pinctrl-names = "default";
pinctrl-0 = <&pwm_P8_19>;

enabled = <1>;
duty = <5000000>;
status = "okay";
};
};
};

fragment@10 {
target = <&am33xx_pinmux>;
__overlay__ {
pwm_P8_13: pinmux_pwm_P8_13_pins {
pinctrl-single,pins = <0x024 0x4>; /* P8_13 (ZCZ ball T10) | MODE 4 */
};
};
};

fragment@11 {
target = <&ocp>;
__overlay__ {
pwm_test_P8_13 {
compatible = "pwm_test";
pwms = <&ehrpwm2 1 5000000 1>;
pwm-names = "PWM_P8_13";

pinctrl-names = "default";
pinctrl-0 = <&pwm_P8_13>;

enabled = <1>;
duty = <5000000>;
status = "okay";
};
};
};



fragment@12 {
target = <&am33xx_pinmux>;
__overlay__ {
pwm_P9_21: pinmux_pwm_P9_21_pins {
pinctrl-single,pins = <0x154 0x3>; /* P9_21 (ZCZ ball V17) | MODE 3 */
};
};
};

fragment@13 {
target = <&ocp>;
__overlay__ {
pwm_test_P9_21 {
compatible = "pwm_test";
pwms = <&ehrpwm0 1 5000000 1>;
pwm-names = "PWM_P9_21";

pinctrl-names = "default";
pinctrl-0 = <&pwm_P9_21>;

enabled = <1>;
duty = <5000000>;
status = "okay";
};
};
};

fragment@14 {
target = <&am33xx_pinmux>;
__overlay__ {
pwm_P9_22: pinmux_pwm_P9_22_pins {
pinctrl-single,pins = <0x150 0x3>; /* P9_22 (ZCZ ball A17) | MODE 3 */
};
};
};

fragment@15 {
target = <&ocp>;
__overlay__ {
pwm_test_P9_22 {
compatible = "pwm_test";
pwms = <&ehrpwm0 0 5000000 1>;
pwm-names = "PWM_P9_22";

pinctrl-names = "default";
pinctrl-0 = <&pwm_P9_22>;

enabled = <1>;
duty = <5000000>;
status = "okay";
};
};
};

fragment@16 {
target = <&am33xx_pinmux>;
__overlay__ {
pwm_P9_14: pinmux_pwm_P9_14_pins {
pinctrl-single,pins = <0x048 0x6>; /* P9_14 (ZCZ ball U14) | MODE 6 */
};
};
};

fragment@17 {
target = <&ocp>;
__overlay__ {
pwm_test_P9_14 {
compatible = "pwm_test";
pwms = <&ehrpwm1 0 5000000 1>;
pwm-names = "PWM_P9_14";
pinctrl-names = "default";
pinctrl-0 = <&pwm_P9_14>;
enabled = <1>;
duty = <0>;
status = "okay";
};
};
};

fragment@18 {
target = <&am33xx_pinmux>;
__overlay__ {
pwm_P9_16: pinmux_pwm_P9_16_pins {
pinctrl-single,pins = <0x04c 0x6>; /* P9_16 (ZCZ ball T14) | MODE 6 */
};
};
};

fragment@19 {
target = <&ocp>;
__overlay__ {
pwm_test_P9_16 {
compatible = "pwm_test";
pwms = <&ehrpwm1 1 5000000 1>;
pwm-names = "PWM_P9_16";
pinctrl-names = "default";
pinctrl-0 = <&pwm_P9_16>;
enabled = <1>;
duty = <0>;
status = "okay";
};
};
};

fragment@20 {
target = <&ocp>;
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;

tscadc {
compatible = "ti,ti-tscadc";
reg = <0x44e0d000 0x1000>;

interrupt-parent = <&intc>;
interrupts = <16>;
ti,hwmods = "adc_tsc";
status = "okay";

adc {
ti,adc-channels = <0 1 2 3 4 5 6 7>;
};
};

test_helper: helper {
compatible = "bone-iio-helper";
vsense-name = "AIN0", "AIN1", "AIN2", "AIN3", "AIN4", "AIN5", "AIN6", "AIN7";
vsense-scale = <100 100 100 100 100 100 100 100>;
status = "okay";
};
};
};/**/

/* LEDs */
fragment@21 {
target = <&am33xx_pinmux>;
__overlay__ {
gpio_P8_03: pinmux_gpio_P8_03_pins {
pinctrl-single,pins = <
0x018 0x07 /* P8_03 */
0x01c 0x07 /* P8_04 */
>;
};
};
};

fragment@22 {
target = <&ocp>;
__overlay__ {
test_helper: helper {
compatible = "bone-pinmux-helper";
pinctrl-names = "default";
pinctrl-0 = <&gpio_P8_03>;
status = "okay";
};
};
};

};

0 comments on commit 9d10909

Please sign in to comment.