Frequency Range w/ 8051 pwm outputs

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I'm new to the 8051 family and am using the pwm0 output to get sound
from my development board.  As I understand it I can load the
prescaler with a value between 0 and 255 to get different frequencies
out of it.  With an 11.059 MHz crystal, my range (as I calculate it)
is around 90Hz - 30kHz in 255 steps.  Can anyone explain how I can get
a finer range out of it, say 1000-2000 Hz, or 5000-10000 Hz?

Thanks!


Re: Frequency Range w/ 8051 pwm outputs

Quoted text here. Click to load it

With that hardware you don't. You gets what you pays for.

8051 internal timers are not for fine-resolution frequency generation. For
more suitable things, see e.g. Analog Devices AD9830 and AD9850 series
chips.

Tauno Voipio
tauno voipio @ iki fi



Re: Frequency Range w/ 8051 pwm outputs
Quoted text here. Click to load it

No, you're stuck with that. You could try a very fast counter/interrupt
occuring each 100uS or faster and put a 16 bit faseaccumulator in that
interrupt. Or use a programmable clockoscillator and play with that,
but that is a silly idea.

--
Thanks,
Frank Bemelman
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline