Pages: [1]   Go Down
Author Topic: What is the normal arduino PWM frequency in Hz?  (Read 714 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the normal  arduino PWM frequency in Hz?

Thanks in advance smiley Have a great day
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 30
Posts: 2602
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The frequency of the PWM signal is approximately 490 Hz.
http://arduino.cc/en/Reference/AnalogWrite
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks alot smiley
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I though because of the diffences between the timers used in analogWrite() depending on the specific PWM pins that the default PWM switching speed on a 328p based board was:

Quote
Arduino Pins 5 and 6: 1kHz
Arduino Pins 9, 10, 11, and 3: 500Hz

That's from an older source, but think it still applies that there are two different switching frequencies used depending on the specific pwm output pins being used.

Lefty
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 497
Posts: 19051
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

However you can change it fairly easily by changing the prescaler, particularly for Timers 1 and 2. You could do it for Timer 0, but that would change the rate at which the millis() figure updates.

Also if you want other frequencies and are prepared to dedicate a whole timer to it you can effectively select one from a wide range. I have a table on this page which shows the various frequencies you can achieve. However you have to get a bit closer to the hardware to do that, although there are some libraries that will help with that.
Logged


Pages: [1]   Go Up
Jump to: