Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to use software PWM ? #325

Open
6p9hb3ukynd3n8er opened this issue Sep 29, 2018 · 3 comments
Open

Any way to use software PWM ? #325

6p9hb3ukynd3n8er opened this issue Sep 29, 2018 · 3 comments

Comments

@6p9hb3ukynd3n8er
Copy link

6p9hb3ukynd3n8er commented Sep 29, 2018

Hello,

Is there any way to use software PWM with this library, in order to increase the number of available pins ?

I am using a raspberry pi 3 and I need to control multiple LED strips independently with Python. I have found python libraries that offer software PWM (http://abyz.me.uk/rpi/pigpio/index.html or http://ozzmaker.com/software-pwm-on-a-raspberry-pi). How could I combine them ?

Alternatively, is there a way to combine PWM, PCM and SPI to control almost 10 strips simultaneously (and they need to be synchronized) ?

Thanks !

Note : I'd rather not use a hat for the rasp.

@Gadgetoid
Copy link
Collaborator

No, and no.

With the possible exception of a from-scratch, bare-metal approach the Pi is simply incapable of generating the precise timings required to produce a valid ws281x signal.

I'd wholly recommend using APA102s strips (Adafruit call those DotStar) since you could switch a whole bank of GPIO pins (one for each strip) and toggle a separate, shared, clock pin to drive a theoretical maximum of 27 independent strips.

If you want to run 10 ws281x strips simultaneously you'll need to do something slightly crazy like- http://spritesmods.com/?art=imx233-ws2811

@jgarff
Copy link
Owner

jgarff commented Oct 2, 2018

Just be warned, that I think even with a APA102 strip (where you can control the clock line manually), the software bitbang frequency on the GPIOs is still going to be pretty terrible. Probably on the order of a few hundred kilohertz. Depending on the number of LEDs you're driving in each string, you might not be able to achieve a adequate refresh rate using that mechanism.

As for using PWM/PCM/SPI at the same time, the library doesn't support it, but I see no real reason why it couldn't from a hardware standpoint, assuming of course that the dedicated pin functions don't overlap too badly. Even if we could use all at once, it'll still max at 4 strings (2 PWM, 1 PCM, 1 SPI).

@JMurph2015
Copy link

Theoretically, one could create a multiplexer board that converted a PWM signal intended for 1 strip of say 1,000 LEDs to a signal suitable for 10 strips of 100 LEDs. But this would take custom logic that is probably moderately not worth the trouble.

PS
For my use case, I created a little network server that allows me to remotely stream colors to various networked Raspberry Pi's at the cost of moderately more complexity and no hard guarantees of synchronization (it's a UDP protocol that displays each frame whenever it gets there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants