LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Change PWM Frequency on Arduino Uno

Hello everyone,

I am a new user to the Arduino Uno. I have a project where I need to control some devices using a PWM signal at 125Hz. Does anyone know how I can change the Arduino Uno base frequency from 490Hz to 125Hz?

Thanks,

David

0 Kudos
Message 1 of 2
(6,224 Views)

Hi David,

I had a similiar problem with my arduino mega2560.

I used the following pages to solve my problem (Read everything carefully):

http://forum.arduino.cc/index.php?topic=72092.0

http://sobisource.com/?p=195

http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM

Finally I changed my Timer 0 (!!! changes internally some functions like delay() or millis() !!!) in my >>> void setup() <<< with the following code:

TCCR0B = (TCCR0B & 0xF8) | 0x02;

You have to make it in the LIFA_Base.ino and upload again to your board. But make a copy of your original LIFA_Base.ino.

In my opinion you should try to change Timer 1 to 122.5 Hz.

I hope this helped. Good luck

0 Kudos
Message 2 of 2
(3,915 Views)