I'm at a point where I have the averaged ADC code running. I've combined this in with my MIDI input & output drivers and created a template that I can use for my other programs. The template contains: header files and information MIDI input (polled or interrupt mode) MIDI output (polled) 1 mS timestamp (interrupt) Four sample averaged ADC inputs (interrupt or polled) SpeakJet driver Led hex display driver (since IDE debug does not work with interrupts) In polled mode, the ADC average scans the four inputs and averages the data over the past 4 samples. Execution time is 600 uS. In interrupt mode, I have a table to define what inputs are scanned on each 1 mS interrupt. The default table scans IN-1 every 2 mS, IN-2 every 4 mS, and IN-3 and IN-4 every 8 mS. Execution time is 200 uS every 1 mS timer interrupt. This code replaces my MIDI INPUT & OUTPUT code although I have left it in the MIDI folder. This code is called DJB TEMPLATE and I uploaded it to the code fragments folder (since it's just the drivers). For a sample program, I have included a MIDI In to Out and IN-x to OUT-x pass through mode. It took quite a bit of work to get the MIDI-In interrupts working with the timer interrupts and not loosing any data. I found all sorts of peculiarities with the interrupt processing that I won't go into details about. I think I'm really pushing the limits of interrupt processing in basic at this point. Enjoy. Dave
Message
Interrupt sampled and averaged ADC code uploaded
2004-05-12 by djbrow54
Attachments
- No local attachments were found for this message.