DPRG List  

[DPRG] PWM freq

Subject: [DPRG] PWM freq
From: Dean Hall dwhall256 at gmail.com
Date: Wed Nov 19 12:43:16 CST 2008

I'm running PWM at just under 2 KHz.  I did not try to hit some exact  
magic number frequency, I just tried a few frequencies at different  
orders of magnitude and went with the one that seemed to perform.  I  
remember I avoided a higher frequency because the motor whine was  
annoying.  It still has whine, but it's not as annoying.  The Timer2  
peripheral in my ATmega103 running at 8 MHz determines the available  

     /* Timer2 in non-inverted PWM mode, prescale by div 8 (1953 Hz) */
     TCCR2 = (_BV(PWM2) | _BV(COM21) | _BV(CS01));

The math works out like this: 8 MHz / 8 prescale / 2^9 for nine bit  
resolution == 1953.125 Hz


On Nov 19, 2008, at 12:10 , Duane Brantley wrote:

> If you use PWM to control the speed of your drive wheels, what PWM  
> frequency are you using?    Why did you choose that frequency?
> Thanks,
> Duane
> _______________________________________________
> DPRGlist mailing list
> DPRGlist at dprg.org
> http://list.dprg.org/mailman/listinfo/dprglist

More information about the DPRG mailing list