Surely if TMR0 overflows at 19.5 KHz, by switching a PWM every time I could get 9.7 KHz, every 256 interrupts I could get about 76 Hz; in the original post I mentioned 4.9 KHz being the highest note I'd consider.. -Kieren ----- Original Message ----- From: "Olin Lathrop" To: Sent: Friday, August 09, 2002 1:40 AM Subject: Re: [PIC]: Best frequency synthesis method > > I just wrote a 2-page e-mail about what I didn't understand and why, then > I > > got it :) > > Anyway, I'd be using 8-bit "resolution" and from my calcs. the frequency > > range should be fine, if not by nocking off a higher octave I can half the > > required frequency. > > You wanted to interrupt once every timer 0 overflow (every 256 > instructions). 8 bit resolution requires 255 time slices per PWM period. > 5MHz / 256 / 255 = 76.6Hz. And that is the sample frequency. The highest > frequency you can reproduce is then 38.3Hz. I rather doubt that is good > enough for your audio application. Even if your PWM slice time were 32 > instructions, that would only give you 8 times higher frequency, or about > 306Hz. If I remember, you wanted a few KHz. Your simply not going to get > that with software PWM. > > > ***************************************************************** > Embed Inc, embedded system specialists in Littleton Massachusetts > (978) 742-9014, http://www.embedinc.com > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu