Is this for doing clock divisions? Seems like it would work very well for that. With an internal clock, it's simple to do arpeggiations for example, but trying to sync that to an external clock means you have to know what the BPM is a priori. A running average is the way to go. I don't know if your numbers will work until I actually try them, but they sound real good! I would probably shorten the time by only scanning one input, since I imagine most applications would only need one sync clock. Very useful stuff, Dave! Can't wait to get my hands on it... Mike --- In SynthModules@yahoogroups.com, "djbrow54" <davebr@e...> wrote: > I've got some interesting test code running. It samples and averages > the ADC inputs during the timer interrupt. > > I scan each input every 32 mS. Each input is scanned in an > interleaved fashion. Since the timer interrupts at 1 mS intervals, > every 8th interrupt I sample a different input. I save the previous > samples and calculate an average over the last 8 samples and store > this into a circular buffer. To retrieve the latest average, you > access the buffer at the current pointer value. > > I'm not sure if this is fast enough of an update. I have a simple > loop through code that simply takes the current average and outputs > it to the DACs. The outputs are rock solid. > > The scanning takes 325 uS every 8 mS. > > What are your opinions? > Is an 8 samples average too much? > Is an update every 32 mS too slow? > > Thanks. - Dave
Message
Re: Interrupt-based ADC scanning and filtering
2004-05-06 by Mike Marsh
Attachments
- No local attachments were found for this message.