Has anyone tried doing a software PWM on the GPIO pins via a custom written module in kernel space?
Wouldn't want to reinvent the wheel, so if there where tries, please forward me to them. Will update the answer when i get new insights.
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
As Guzunty mentioned, I've used both pi-blaster and servoblaster for using PWM to control LEDs. The latter includes a kernel module, but the recommended method is now the user-space daemon. Both methods create a /dev/servoblaster file which you can write to change the PWM status. (The advantage of the user-space method is that you don't have to match the kernel module to kernel version, which could require compiling.)
How they work is they use the DMA timer of the single PWM pin of the Pi to time the signals on any of the other GPIO pins. I've found them to work pretty reliably under varying CPU load conditions, so I'd say it works well. Much better than pure software PWM.