Setting the GPIO hardware PWM Frequency on the Raspberry Pi

Опубликовано: 23 Май 2026
на канале: The Circuit Archive
55,350
562

In this video I will show how you can set the Frequency of the Raspberry Pi hardware PWM output.
There is a lot of information online about controlling the IO’s as digital in or output from the command line, after some searching I found out that setting the frequency is actually quite easy too if you know the commands.

1-GPIO PWMC = Clock divider: (2- 4095)
2-GPIO PWMR = PWM Duty Cycle Range: (2 -..infinity?)
3-GPIO PWM-MS / GPIO PWM-BAL : balanced / mark space mode
You must set the mode to mark space mode to set the frequency.

Resulting PWM Frequency = 19.2MHZ/(PWMC*PWMR)

More infor about GPIO control:
http://wiringpi.com/the-gpio-utility/