Hi all,
I’m trying to use the PWM outputs on my beaglebone and have a question about working out which pwmchip device a pin maps to.
After figuring out the steps to get the PWM overlays working with u-boot (as most tutorials are still referring to cape manager), I was struggling with getting a PWM output working using standard shell commands (echoing values to duty_cycle, period, enabled etc.) I came across this nugget of information on a blog post:
“EHRPWM1 is under PWMSS1 which has address 0x48302000 and can be seen under pwmchip0.”
When I list the contents of my /sys/class/pwm directory I get the following:
root@beaglebone:/sys/class/pwm# ls -la
total 0
drwxrwxr-x 2 root pwm 0 Jan 1 2000 .
drwxr-xr-x 59 root root 0 Jan 1 2000 …
lrwxrwxrwx 1 root pwm 0 Nov 3 2016 pwmchip0 → …/…/devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip0
lrwxrwxrwx 1 root pwm 0 Nov 3 2016 pwmchip1 → …/…/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip1
lrwxrwxrwx 1 root pwm 0 Nov 3 2016 pwmchip3 → …/…/devices/platform/ocp/48302000.epwmss/48302200.pwm/pwm/pwmchip3
lrwxrwxrwx 1 root pwm 0 Nov 3 2016 pwmchip5 → …/…/devices/platform/ocp/48304000.epwmss/48304100.ecap/pwm/pwmchip5
lrwxrwxrwx 1 root pwm 0 Nov 3 2016 pwmchip6 → …/…/devices/platform/ocp/48304000.epwmss/48304200.pwm/pwm/pwmchip6
Note that in my system the device that maps to 0x48302000 is actually pwmchip3, not pwmchip0 as in the blog post. Once I established that I got things working.
My question is - where do I find the information that tells me that EHRPWM1 is under PWMSS1 which has address 0x48302000? I’ve had a hunt through the am3358 datasheet and can’t see it there. Can anyone point me in the right direction please?
Many thanks,
James Fitzsimons