<mad.scientist.jr@gmail.com> wrote in message
news:9c27d683-95c3-4c38-b4b7-fd8b46ca2660@n36g2000hse.googlegroups.com...
>I would like to build a drum machine/metronome
> using a BASIC Stamp 2 (maybe later on PICAXE)
> which would allow the user to control
> the beats per minute (bpm) with a dial/potentiometer.
> They could select a value from 1-255
> (later I might add a module to display the current value).
>
> I would like the timing to be as accurate enough
> to a real clock to be comparable to a real metronome
> or drum machine.
>
> This is the main problem, since the BASIC Stamp 2
> (and PICAXE models I am considering)
> don't have a real time clock (see link/citation below).
> Would I need to connect the microcontroller to a
> Dallas real time clock to accurately control the timing
> or would it be possible to make my own with a
> 555 timer or other component for less money?
>
> For my purpose the 555 or similar would have to be
> accurate enough to measure actual seconds
> (or milliseconds? how granular should it be?)
> to get real beats per minute.
> I have found numerous "555 calculator" pages
> (some listed below) which let you enter different
> resistor/capacitor values and see what the
> time high / time low would be (you can reverse
> the math to figure out what R/C values to measure
> milliseconds, or 1/100 of a second, or whatever
> would be accurate enough).
>
> You can get gold resistors with +/- 5% tolerance,
> would this variance throw off the timing?
> Furthermore I read that capacitors of the type needed
> for the 555 are a lot less tolerant (+/- 20%)
> than gold resistors. If this is true, would this
> totally throw off the timing? I picture myself having to
> buy 100 capacitors and test each one with a meter until
> I find the exact value, and even then its capactiance might
> change as it ages, making the device not accurate.
>
> Any advice or links to a similar project or good solution would be
> most appreciated... The simpler the better : )
>
> Thanks again
>
If you don't use the PLL(jitter of +-2%) then you probably have about 1%
jitter(which is the real problem except for drift). The clock has about 5%
inaccuracy but you can calibrate that out or get a more accurate clock.
1% jitter using the internal 8Mhz clock is +-2bpm at around 200bpm. This
isn't acceptable but you can use it anyways for development(its not bad
though for starters). Its very easy to use a more precise external clock so
its no big deal.
Also, Timer1 can use an external clock so if you use this for your timing
you can easily hook up a better clock later on to get more precision.
The point being is that the clock, at this point in development, doesn't
matter. The PIC is good enough at this point to do everything that is needed
and its very simple to make it better.
Except of course if you do use timer1 and plan on using an external clock
you need to keep the secondary osc pin free... although theres no real point
when you can just use that for the primary clock.
So my suggestion is you go ahead and develop the software and hardware and
then after you get a prototype you can worry about getting a more precise
oscillator. (if you do any layout you can lay out for some clock and/or
clock conditioner and then its just a matter of configuring the pic). This
is really a non issue so go ahead and get with it!
