9.7 C
London
Wednesday, November 6, 2024

Linux’s Kernel-Degree Software program PWM Assist Arrives on the Raspberry Pi’s GPIO Pins



Raspberry Pi customers working with pulse-width modulation (PWM) indicators on the favored boards’ general-purpose enter/output (GPIO) pins can now profit from a brand new driver based mostly on a high-resolution timer — unlocking the performance on any pin.

“Add a software program PWM which toggles a GPIO from a high-resolution timer,” developer Vincent Whitchurch writes of the function, which is included within the Linux 6.11 kernel. “This can naturally not be as correct or as environment friendly as a {hardware} PWM, however it’s helpful in some circumstances. I’ve for instance used it for evaluating LED brightness dealing with (by way of leds-pwm) on a board the place the LED was simply hooked as much as a GPIO, and for a easy verification of the timer frequency on one other platform.”

The flexibility to have high-quality software program PWM on any GPIO pin will probably be welcomed by Raspberry Pi customers, with one caveat: Raspberry Pi doesn’t but supplied a kernel based mostly on Linux 6.11. Fortunately, a pull request to merge the function into the rpi-6.6.y kernel department has been accepted — and the function must be accessible via rpi-update by the point you learn this text.

“It labored OK on a [Raspberry] Pi 5 with an MG946 servo and appeared strong underneath regular hundreds,” writes Raspberry Pi’s principal software program engineer Tim Gover of his testing. “Maxing out the PCIe [PCI Express] hyperlink could cause a really small however observable wobble on the servo.”

“After many months of mild nudging and poking it looks like Linux GPIO PWM is lastly making it to [Raspberry] Pi,” developer Philip Howard provides in a remark on Mastodon. “That is PWM on arbitrary GPIO pins utilizing a kernel stage software program driver — blows most userspace libraries out of the water.”

Extra data is on the market within the pull request on the Raspberry Pi Linux GitHub repository.

Latest news
Related news

LEAVE A REPLY

Please enter your comment!
Please enter your name here