On Tue, Jun 3, 2014 at 1:05 PM, maxmike <maxmikes...@gmail.com> wrote:
>
> Jason, could you please let me know how you got cape-universal to let you do
> pwm?
>
> If I use the am33xx_pwm and bone_pwm_P9_21 dtbo's I can see
> /sys/devices/ocp.3/pwm_test_
> P9_21.11 period polarity and run files.
>
> If I use the cape-universal instead and config-pin P9_21 as pwm
> all I get is a confirmation that it occurred, but I have difficulty finding
> the period, polarity, run files.

Well, be sure *NOT* to load the bone_pwm_* dtbo (dt overlays).
Instead, you should use the standard Linux sysfs entries for PWM.

root@beaglebone:~# config-pin p9.14 pwm
root@beaglebone:~# config-pin -q p9.14
P9_14 Mode: pwm
root@beaglebone:~# echo 3 > /sys/class/pwm/export
root@beaglebone:~# cat /sys/class/pwm/pwm3/run
0
root@beaglebone:~# cat /sys/class/pwm/pwm3/duty_ns
0
root@beaglebone:~# cat /sys/class/pwm/pwm3/period_ns
0
root@beaglebone:~# echo 500000 > /sys/class/pwm/pwm3/period_ns
root@beaglebone:~# echo 100000 > /sys/class/pwm/pwm3/duty_ns
root@beaglebone:~# echo 1 > /sys/class/pwm/pwm3/run
root@beaglebone:~# cat /sys/class/pwm/pwm3/run
1
root@beaglebone:~# cat /sys/class/pwm/pwm3/duty_ns
100000

To figure out the index for performing the export, you need to look at
the order the PWMs are placed in the devicetree. I input these into my
bone.js file that keeps the board specific info
(https://github.com/jadonk/bonescript/blob/427de9494d4f494bd7806ddde10913f1578cdbea/src/bone.js#L271).

root@beaglebone:~# node -e "var
p=require('bonescript').bone.pins;for(var x in
p){if(p[x].pwm)console.log(x+':'+p[x].pwm.sysfs);}"
P8_13:6
P8_19:5
P8_34:4
P8_36:3
P8_45:5
P8_46:6
P9_14:3
P9_16:4
P9_21:1
P9_22:0
P9_28:7
P9_29:1
P9_31:0
P9_42:2


>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to