Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

PWM Mode Question
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PWM Mode Question

by soggybag on Thu Aug 26, 2010 5:27 pm

I'm using PWM in an application that uses audio. I can hear some high pitched noise, which I suspect is coming from the PWM. Right now I'm using the following to set up my PWM.

I'm using the ATTINY13. I'm wondering if it is possible to set the speed of the PWM to a frequency high enough to be out of audio range.

Code: Select all | TOGGLE FULL SIZE
TCCR0A |= (1<<COM0A1) | (1<<WGM00); // PWM Phase correct mode 1
TCCR0B |= (1<<CS00);// --no prescale

soggybag
 
Posts: 35
Joined: Sat Mar 01, 2008 3:28 am

Re: PWM Mode Question

by zener on Sat Sep 04, 2010 2:55 pm

You might also try a low pass filter. Stick an inductor in the line, or try a LC filter.

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: PWM Mode Question

by adshea on Thu Sep 30, 2010 5:11 pm

What's your limit comparator set to? How fast is your clock? The AVR datasheets have an equation to give you the PWM frequency. If you want it to be inaudible you need it to be well above 25kHz.

adshea
 
Posts: 48
Joined: Fri Nov 06, 2009 10:01 pm

Please be positive and constructive with your questions and comments.