Blinka uses lgpio, so we get hardware pwm

This commit is contained in:
2026-07-05 19:53:58 +00:00
parent 33914344ff
commit 582e2d4a16
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -4,15 +4,20 @@ The Raspberry Pi zero (1 and 2) have 2 PWM peripherals, allowing you to pulse pi
# References
- [CircuitPython Libraries on Linux and Raspberry Pi](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi)
- [Raspberry Pi Official Overlays information (github)](https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README)
- Line 4235 starts the description of the "pwm" overlay configuration
- [Adding Basic Audio Ouput to Raspberry Pi Zero](https://learn.adafruit.com/adding-basic-audio-ouput-to-raspberry-pi-zero/pi-zero-pwm-audio)
- [CircuitPython pwmio documentation](https://docs.circuitpython.org/en/latest/shared-bindings/pwmio/index.html)
# Important Points
1. The `gpio` program is no longer available. It has been replaced with `pinctrl` which works a little differently.
1. The Blinka/CircuitPython interface uses `lgpio` to do hardware PWM on the pins. This requires the `pwm-2chan` overlay to be setup correctly, which it's documented procedure does. Details on relevant pins on line 4267 of the [overleays README](https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README)
# Discussion
My raspberry pi zero W 2 wasn't working reliably with the PWM.
The `gpio` command has been depricated and is now replaced by the `pinctrl` commend. Running it did not list any PWM0 on any of the pins, which was concerning.