Skip to content

Commit 47487f7

Browse files
Enable PWM for illumination LEDs on LL2+ and LL3 (#124)
This enables PWM on pins 13 and 18 to control the built-in dimmable illumination LEDs on Limelight 2+ and 3. The symlink at `/boot/config.txt` exists since that is the only path diozero checks for pwm configuration right now, and should be removed once diozero is updated to check `/boot/firmware/config.txt` or another source of PWM information ([diozero#230](mattjlewis/diozero#230)). Both LL2+ and LL3 have non-flickery LED dimming with these changes. Needed to fix flickering LEDs in [photonvision#2335](PhotonVision/photonvision#2335).
1 parent 3b73ea2 commit 47487f7

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

install_limelight.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ chmod +x ./install.sh
2323
install -m 644 limelight/config.txt /boot/firmware/
2424
install -m 644 userconf.txt /boot/firmware/
2525

26+
# link old config.txt location for diozero compatibility
27+
# TODO(thatcomputerguy0101): Remove this when diozero checks the new location
28+
ln -sf /boot/firmware/config.txt /boot/config.txt
29+
2630
# install LL DTS
2731
dtc -O dtb limelight/gloworm-dt.dts -o /boot/firmware/dt-blob.bin
2832

install_limelight3.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ mkdir --parent /boot/firmware
1212
mount "${loopdev}p1" /boot/firmware
1313
ls -la /boot/firmware
1414

15+
# Install our new config.txt with pwm overlay
16+
install -m 644 limelight3/config.txt /boot/firmware/
17+
18+
# link old config.txt location for diozero compatibility
19+
# TODO(thatcomputerguy0101): Remove this when diozero checks the new location
20+
ln -sf /boot/firmware/config.txt /boot/config.txt
21+
1522
# Add the one extra file for the LL3
1623
wget https://datasheets.raspberrypi.org/cmio/dt-blob-cam1.bin -O /boot/firmware/dt-blob.bin
1724

limelight/config.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ dtparam=audio=off
2828

2929
max_framebuffers=2
3030

31+
# Enable hardware PWM for LED control
32+
dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
33+
3134
# Run in 64-bit mode
3235
arm_64bit=1
3336

limelight3/config.txt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Automatically load overlays for detected DSI displays
2+
display_auto_detect=1
3+
4+
# Automatically load initramfs files, if found
5+
auto_initramfs=1
6+
7+
# Enable DRM VC4 V3D driver
8+
dtoverlay=vc4-kms-v3d
9+
max_framebuffers=2
10+
11+
# Run in 64-bit mode
12+
arm_64bit=1
13+
14+
# Disable compensation for displays with overscan
15+
disable_overscan=1
16+
17+
# Enable hardware PWM for LED control
18+
dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
19+
20+
[cm4]
21+
# Enable host mode on the 2711 built-in XHCI USB controller.
22+
# This line should be removed if the legacy DWC2 controller is required
23+
# (e.g. for USB device mode) or if USB support is not required.
24+
otg_mode=1
25+
26+
[pi4]
27+
# Run as fast as firmware / board allows
28+
arm_boost=1
29+
30+
[all]
31+
##############################################################
32+
### PHOTONVISION CAM CONFIG
33+
### Comment/Uncomment to change which camera is supported
34+
### Picam V1, V2 or HQ: uncomment (remove leading # ) from camera_auto_detect=1,
35+
### and comment out all following lines
36+
### IMX290/327/OV9281/Any other cameras that require additional overlays:
37+
### Comment out (add a # ) to camera_auto_detect=1, and uncomment the line for
38+
### the sensor you're trying to user
39+
40+
camera_auto_detect=1
41+
42+
# dtoverlay=imx290,clock-frequency=74250000
43+
# dtoverlay=imx290,clock-frequency=37125000
44+
# dtoverlay=imx378
45+
# dtoverlay=ov9281
46+
47+
##############################################################

0 commit comments

Comments
 (0)