Go Down

Topic: What is the normal arduino PWM frequency in Hz? (Read 759 times) previous topic - next topic

Voidugu

What is the normal  arduino PWM frequency in Hz?

Thanks in advance :) Have a great day

Magician



retrolefty

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

Nick Gammon

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.
http://www.gammon.com.au/electronics

Go Up