Hi Robert, Thanks so much for your speedy response!
Just to confirm then - I understand from the comment at the top of that file "#PWM's change on every bootup:" that my C++ driver code is going to have to list the contents of each of the epwmss device directories (e.g. /sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/) to get the pwmchipXX mapping to use on each boot? Cheers, James Fitzsimons On 22 February 2018 at 15:00, Robert Nelson <[email protected]> wrote: > On Wed, Feb 21, 2018 at 7:44 PM, James Fitzsimons > <[email protected]> wrote: > > 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? > > Here you go: > > https://github.com/beagleboard/bb.org-overlays/blob/master/examples/cape- > unversal-pwm.txt#L13-L18 > > Regards, > > -- > Robert Nelson > https://rcn-ee.com/ > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAPi7d%3DDunAC%2BRZQMeh0m4YGje3Sixvb-Yq8uJht3BQydHgQ2tQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
