BaremetalPi.jl icon indicating copy to clipboard operation
BaremetalPi.jl copied to clipboard

PWM

Open yakir12 opened this issue 4 years ago • 8 comments

Feature request for the far future: add controls for PWM.

This is really just a place holder for a todo. Not an actual issue...

yakir12 avatar Oct 09 '20 13:10 yakir12

Ok! I agree, I really need to add this... The hardware PWM should be easy to configure. I am also thinking how can I use the multi-threading capabilities of Julia to also provide software PWM.

ronisbr avatar Oct 10 '20 13:10 ronisbr

I was looking into the PWM capabilities of the Pi and found this reference from the pigpio doc about how the DMA peripheral is used to do "hardware timed PWM on any of GPIO 0-31": https://github.com/joan2937/pigpio/blob/cc17196c7586c3625ac8adf8f34838d320ffeda6/pigpio.h#L71-L73

This is a related part of the servoblaster docs: https://github.com/richardghirst/PiBits/blob/master/ServoBlaster/README.txt#L105-L112

notinaboat avatar Oct 27 '20 12:10 notinaboat

I was looking into the PWM capabilities of the Pi and found this reference from the pigpio doc about how the DMA peripheral is used to do "hardware timed PWM on any of GPIO 0-31": https://github.com/joan2937/pigpio/blob/cc17196c7586c3625ac8adf8f34838d320ffeda6/pigpio.h#L71-L73

This is a related part of the servoblaster docs: https://github.com/richardghirst/PiBits/blob/master/ServoBlaster/README.txt#L105-L112

Thanks for the info! I will try to implement it as soon as possible!

ronisbr avatar Oct 28 '20 12:10 ronisbr

Vote for it!

metelkin avatar Apr 06 '21 17:04 metelkin

Hi @metelkin

Yeah... I am in debt here. Sorry for the delay. The last months were insane here and I just had not time to come back to this project. However, it is not dead and I promise I will do this as soon as possible (if we can't find someone to do this).

ronisbr avatar Apr 07 '21 00:04 ronisbr

It's ok. I wish I could help but unfortunately, my skills are not enough for such "low-level" programming tasks.

metelkin avatar Apr 07 '21 11:04 metelkin

@metelkin, in the meantime you may be able to use this wrapper:

https://github.com/notinaboat/PiGPIOC.jl

The PWM API functions are here: https://github.com/notinaboat/PiGPIOC.jl/blob/9052eaaa7bcffd634cdfd39fbc3280728dd9d1b4/src/pigpio.jl#L5-L7 https://github.com/notinaboat/PiGPIOC.jl/blob/9af37c6fff20ca963bfe0c5a3592f37925c300bf/src/pigpio.jl#L33-L57

The documentation is here: http://abyz.me.uk/rpi/pigpio/cif.html#gpioPWM

notinaboat avatar Apr 07 '21 22:04 notinaboat

@metelkin, in the meantime you may be able to use this wrapper:

https://github.com/notinaboat/PiGPIOC.jl

Thank you @notinaboat, interesting.

metelkin avatar Apr 08 '21 08:04 metelkin