At 09:31 AM 1/7/2004 -0500, you wrote: >At 03:09 PM 1/7/2004 +0100, you wrote: >>Hi all, >> >>I am now designing a electronic metronome for myself, PIC-based of course. >>As an extra, since I'm using crystal precision anyway, I thought of >>including a 440 Hz (an A note) reference tone to tune flutes etc. >>But I can't find any standard (cheap) crystal that divides nicely in 440 Hz. >>Do you know a simple solution, that does not introduce audible jitter >>(that would effectively ruin the use as a tuner)? >>Are self-adjusting timer loops good enough? >> >>Well, thanks in advance again, > >How about just using a capture-compare module and whatever crystal you like? P.S. with a 4MHz crystal, you'd use 1e6/880 = 1136 for the adder for the timer. That would be a nominal 440.14 Hz with zero jitter. Using a 20MHz crystal, you would use 5682 for the adder, which would yield a nominal 439.986Hz, which is within 0.0031%. Using a 16MHz crystal and timing of 4545/4546 (still no jitter) will be as close to perfect as you could want (10ppm), while using very little processor time. You'd use an interrupt to update the compare register- the only requirement is that it be serviced within 1.1msec after the compare hit. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads