From: "David VanHorn" <dvanhorn@cedar.net>
To: <AVR-Chat@yahoogroups.com>; <avr-chat@yahoogroups.com>
Sent: Tuesday, May 11, 2004 19:00
Subject: Re: [AVR-Chat] Re: Noisy ADC lines
> At 11:33 AM 5/11/2004 -0600, Craig Limber wrote:
>
>
> >Mike wrote:
> >
> >> I didn't see anything in your code that allowed some
settling time
> >> after you switched the mux...
> >
> >Hmmmmmm...
> >
> >The manual says the sample and hold cap is 14pf. My
low-pass filter on
> >each channel has a 1k resistor. I didn't see anything in
the datasheet
> >for the Sharp range sensor's output impedance. Do you
have any
> >suggestions how long I should wait for the input voltage
to settle?
>
> This is for the amp on the other side of the mux to
settle, not the input voltage.
>
> >I will try moving the MUX switch code to allow for
settling time as
> >well. Thanks.
>
> IIRC, I was able to do this pretty simply, and in the end,
every time the conversion completed, I was able to switch
inputs, and start the next conversion, without wasting any
significant time in the ISR.
>
> But, it's been a while, and I don't remember exactly how I
solved that one.
> I can dig it up, if you don't resolve this pretty quickly.
Seems like the order of events would be (for a periodic
interrupt):
Interrupt_Entry:
Start a conversion. (Whatever the mux is passing along
to the adc should be stable.)
Do some other stuff while the conversion completes.
Store the results. Use the same variable that controls
the mux as an index into the array you store the results in.
Roll the mux to the next input.
Exit interrupt.
So you have all the time between interrupts for the mux to
settle.
Erikc - firewevr@airmail.net
///
"An Fhirinne in aghaidh an tSaoil."
"The Truth against the World."
-- Bardic Motto
/// In theory, there is no difference between theory and
practice, in practice there is.