Hi folks. I’ve been working to add PWM support to Alex Hiam’s PyBBIO project (https://github.com/alexanderhiam/PyBBIO), which uses the python mmap module to manipulate the BeagleBone uC’s memory directly. For GPIO access, Alex’s project works great. I’m trying to add some simple, Arduino-style PWM-based analog output capabilities.
The reference manual is starting to make sense, and I think the only thing holding me back from implementing analogWrite()-like functionality is my inability to change the system’s state, rather than incomprehension of what that state should be.
But although I’ve got the module clock enabled, I can’t seem to get writes to the PWMSS memory block to take. Once the module has been enabled via CM_PER, I can read the PWMSS registers just fine. But writing to configure them does nothing. You can see some example debug output demonstrating the problem here: http://pastie.org/3485398
I suspect I’m missing something obvious, but I’m not familiar enough with the norms of the AM335x processor family to guess what it might be. FWIW I’m able to write to the GPIO registers (which Alex’s code manipulates) just fine. I imagine there’s some initialization procedure for the PWMSS that I’m overlooking, but so far I haven’t stumbled across the relevant part of the reference manual.
I’d be grateful for any thoughts you might have – I really would like to get this work into decent shape so that it can be made available to others in the community. You can find the present state of my code here: https://github.com/sbma44/PyBBIO if any of the above is unclear.