Dewd! I have been wanting to build a metronome for a while! Keep me posted on how you are doing and I will be glad to pitch in a hand. I would love to build one myself. Let's see: 440 Hz. I tried a few standard crystal freqs, 18.432 MHZ, 10 MHZ, 4 MHZ and you are right they do not divide evenly. Don't give up however, there is more than one way to skin a cat. Let's think of several. 1. Timing loops. We should be able to make a dedicated timing loop that counts to 1/440/2 = 1.136 mSec and flips a bit to the speaker driver. Disadvantage: the PIC does nothing else. 2. Interrupts. This might be cleaner, set up a timer interrupt that times out every 1.136 mSec and flips a bit. Then your PIC could do something else int he interrum like scan for keypresses, talk to an LCD display, or listen to your instrument and tell you how close your pitch is. These should be regular enough to avoid jitter. Different notes could be programmed into the interrupt timer if you want something other than A440. I have a routine that produces tones in a PIC that I can send offline. It is a dedicated timing loop style routine, meant to produce melodic beeps on a keypress. I am thinking the interrupt method would be a better design, though. As far as the tick sound goes, here is what I would do. I would use an interrupt based routine to generate the tick sound. The interrupt can be fast, maybe 128 beats per second (7.8125 mSec) then all the interrupt does is increment a counter. Your user interface picks a tempo (in beats per minute) the PIC does the math and determines how many 7.8125 mSecs divide into so many beats per minute. A use interface could also translate beats per minute into regular musical terms like Largo and so on. Do you know these terms and how they translate into beats per minute? A straightforward user interface is a Scott Edwards serial LCD and a couple of buttons. And a speaker of course. A large diameter piezo driven by a transistor is all that is needed. Geez the thing is almost designed already. I play instruments, but my main need for a metronome is in dance. My wife and I practice dance a lot, and we want to practice to a regular clock tick when we are not using music. When we practice a step, we tend to speed up and speed up until we can't perform the trick anymore. A metronome is great for this. Then later when we have mastered the move, we want to practice to a fast beat. -- Lawrence Lile Koen van Leeuwen Sent by: pic microcontroller discussion list 01/07/2004 08:09 AM Please respond to pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: Subject: [PIC:] Frequency dividing to 440 Hz 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, Koen van Leeuwen -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads