0

I'm currently working on a project which requires more than one PWM signals for my LED drivers.

I'm not looking for any additional hardware for this and so my focus is mainly on software PWM. Based on the example from: http://raspi.tv/2013/how-to-use-soft-pwm-in-rpi-gpio-pt-2-led-dimming-and-motor-speed-control

Has anyone succeeded in creating 3 or more software PWM signals? If so, are there any precautions to be taken by doing this? Your help is much appreciated. :)

wengzhe
  • 101
  • 3
  • 4
  • 10

3 Answers3

3

pigpio provides DMA timed PWM on all 21 user gpios, from C, Python, or any language supporting sockets.

video of PWM for 16 LEDs.

What do you mean by precautions?

joan
  • 71,852
  • 5
  • 76
  • 108
1

I use servoblaster for 4 PWM outputs on my Pi, but I believe you can use up to 8. It is very reliable, very very simple to use in any language, and outputs incredibly accurate PWMs up to, I believe, 2.5ms, at nice constant 50Hz. I highly recommend it.

https://github.com/richardghirst/PiBits/tree/master/ServoBlaster

nreich
  • 108
  • 1
  • 4
0

The default RPi.GPIO python library already supports DMA PWM on all pins. See http://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/ for documentation.

edit RPi.GPIO doesn't use DMA. I just checked the source code.

Gerben
  • 2,420
  • 16
  • 17