Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6814

Interfacing (DSI, CSI, I2C, etc.) • Using PIO-PWM on RPi5 [SOLVED]

$
0
0
Hi,

Using some earlier guidance in the forum to set an overlay (dtoverlay=pwm-pio,gpio=18) in /boot/firmware/config.txt to use the PWM driver embedded in area sys/class/pwm/, I've tried the following to see if I can obtain a waveform on GPIO 18 but I've had no joy.

I used these command prompts but I'm seeing no response on the scope.
# Export PWM channel 0
echo 0 | sudo tee /sys/class/pwm/pwmchip0/export

# Set PWM period (e.g., 2 ms = 2,000,000 ns)
echo 2000000 | sudo tee /sys/class/pwm/pwmchip0/pwm0/period

# Set PWM duty cycle (e.g., 50% of period)
echo 1000000 | sudo tee /sys/class/pwm/pwmchip0/pwm0/duty_cycle

# Enable PWM output
echo 1 | sudo tee /sys/class/pwm/pwmchip0/pwm0/enable

Any ideas on what else needs configuring or why the expected waveform isn't appearing?

Statistics: Posted by dannyboi — Thu Aug 07, 2025 12:46 pm — Replies 6 — Views 84



Viewing all articles
Browse latest Browse all 6814

Trending Articles