Page 1 of 1

What is the hardware PWM frequency?

Posted: Fri Sep 25, 2015 11:52 am
by ZuLuuuuuu
Hello, I am trying to use Raspberry Pi 2's PWM pin to control an LED driver. I am using the wiringpi2 library. The driver needs a PWM frequency of 100Hz to 1KHz. Since I don't have an oscilloscope I cannot see which frequency PWM pin Raspberry Pi 2 is running.

So can anybody tell me what the hardware PWM frequency is on Raspberry Pi 2 by default? And if I can adjust it?

Re: What is the hardware PWM frequency?

Posted: Fri Sep 25, 2015 11:58 am
by JRV

Re: What is the hardware PWM frequency?

Posted: Fri Sep 25, 2015 12:15 pm
by joan
My piscope will let you see the frequency.

You don't say if you want a fixed or variable frequency. I.e. do you want to vary the frequency between 100 and 1000 Hz or do you want any fixed frequency within that range.

wiringPi defaults to balanced mode rather than mark space which means the frequency will change with dutycycle. Make sure you use mark space with wiringPi.

Re: What is the hardware PWM frequency?

Posted: Fri Sep 25, 2015 12:28 pm
by ZuLuuuuuu
joan wrote:My piscope will let you see the frequency.

You don't say if you want a fixed or variable frequency. I.e. do you want to vary the frequency between 100 and 1000 Hz or do you want any fixed frequency within that range.

wiringPi defaults to balanced mode rather than mark space which means the frequency will change with dutycycle. Make sure you use mark space with wiringPi.
Thanks for the piscope recommendation. I don't have

As long as the frequency is fixed between 100Hz and 1KHz when I set the duty cycle, it is fine for me. I don't need a particular frequency.