Take the 2-minute tour ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I am interested in using an Arduino Uno to produce an analog signal by running PWM through an RC low-pass filter.

I'll be controlling a highly dynamic object and need a clean voltage signal to avoid instabilities. Per this calculator on RC designs, it's suggested that one strategy to reducing voltage ripple is to increase the PWM frequency.

With PWM configured to a default of 980Hz for pins 5 and 6, and PWM of 490Hz for the remaining pins, I've decided that this will create too much voltage ripple for my filter. I've found resources that describe how to configure the registers to increase the PWM frequency rather drastically.

My question is very simple: Are there any disadvantages to using a higher frequency PWM? Why is the default set to be so slow?

Thank you!

share|improve this question

1 Answer 1

A PWM frequency of 490Hz means a period of approximately 2.041ms. This allows a high period of 2ms, which is the maximum pulse length required by a large number of inexpensive servos. Obviously if your design uses no servos then this is not a consideration.

Timer 0 itself is used for the various Arduino timing functions (delay(), millis(), etc.), so if you change the frequency used for timer 0 then those functions will no longer have accurate results.

share|improve this answer
    
timer 0 is used for pins 5 and 6. So you better go with pins 9 and 10 (timer 1), or 3 and 11 (timer2), as to not break functions like delay, millis etc. –  Gerben Jan 21 at 20:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.