ZuLuuuuuu
Posts: 26
Joined: Thu May 23, 2013 6:30 am

What is the hardware PWM frequency?

Fri Sep 25, 2015 11:52 am

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?

User avatar
JRV
Posts: 270
Joined: Mon Apr 02, 2012 1:39 pm
Location: Minneapolis, MN

Re: What is the hardware PWM frequency?

Fri Sep 25, 2015 11:58 am


User avatar
joan
Posts: 14476
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: What is the hardware PWM frequency?

Fri Sep 25, 2015 12:15 pm

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.

ZuLuuuuuu
Posts: 26
Joined: Thu May 23, 2013 6:30 am

Re: What is the hardware PWM frequency?

Fri Sep 25, 2015 12:28 pm

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.

Return to “Advanced users”