Hi John! On Mon, 7 Apr 2003, John Nall wrote: > Has anyone happened to have built a metronome using a PIC and be willing > to share the design? I've found a few projects using Google, but none > of them really seem to do what I want. Either the code is written in C, > or they are using an obsolete chip, or there is insufficient > information. If no one has anything available I can probably adapt one > of the designs, but since it is just a birthday gift for my daughter I > hate to make it a real time-consuming project. (Yeah, I know it would > be a piece of cake for you engineers, but my major was theoretical math, > which helps very little. :-) Part of the trick is to know how to look for things. Yes, if you looked for pic and metronome that's all you'll find is that one in C. But there are other variations on metronome such as timer, clock, tick that return a lot of Morse generators with relevant info. In any case the piclist.com resources *usually* turns up anything you need. I think all you need is a pot to control the speed and a piezo speaker. http://www.piclist.com/techref/piclist/cheapic/morsenbr.htm is a 'Morse number' generator. It'll show you how to attach and beep the speaker (the snd1 subroutine.) It uses a 32.768 xtal so it's easy to determine accuate 'human real time' timings. http://www.piclist.com/techref/microchip/a2d.htm has a few examples about how to read the pot. Then apply your higher theoreTICKal math skills to make the timing a factor of the pot. :) Calibrating a pot dial should be easy enough. Or instead of the pot you could use a couple of switches to select certain predefined speeds, plus two more up/down to vary it slightly. The coolest version would have a keypad plus LCD to type in the speed directly. Even just an LCD would be nice though so the exact speed is known. Again, the Source Code Library reveals all. But the guts of it is the base 32k clock and 'something' to divide it. Have a :) day! jb -- jim barchuk jb@jbarchuk.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads