Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Re: Noisy ADC lines

Re: Noisy ADC lines

2004-05-11 by Craig Limber

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? 

I will try moving the MUX switch code to allow for settling time as 
well.  Thanks.

Craig

Re: [AVR-Chat] Re: Noisy ADC lines

2004-05-11 by David VanHorn

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.

Re: [AVR-Chat] Re: Noisy ADC lines

2004-05-11 by erikc

----- Original Message -----
Show quoted textHide quoted text
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.

Re: Noisy ADC lines

2004-05-11 by Phil

There has been lots of good advice given here on ADC.  One other 
place to look is the sensors.  I used a slightly different version 
this sensor and found that it can generate eratic DC values in 
certain circumstances.  In particular, I had mine mounted about 4 
inches above the floor and it was picking up ground reflections.  It 
looked like 3+ LSB of noise to me but when I moved it away from the 
floor or pointed it about 5 degress above the horizon, the "noise" 
was significantly reduced (down to about 1.5 LSB).

also, do you have supply filter caps on sensor V+?  I'm using 33 uFs 
and have seen designs with even bigger.  If I were to design them in 
again, I'd put in a seperate regulator for their supply V.

Phil

Re: [AVR-Chat] Re: Noisy ADC lines

2004-05-11 by David VanHorn

>
>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.

I think it was something like:

Int:
Read data.
Change channel.
Store data.
Short delay (couple instructions?)
Start conversion.
Exit int.

Re: [AVR-Chat] Re: Noisy ADC lines

2004-05-12 by Mike Murphree

On May 11, 2004, at 6:57 PM, David VanHorn wrote:

> I think it was something like:
>
> Int:
> Read data.
> Change channel.
> Store data.
> Short delay (couple instructions?)
> Start conversion.
> Exit int.

Basically the procedure that I have used on MIL-STD-1553 cards.
No need to enable a complete interrupt, just read the data off
when it's time to send another message.  Also just manipulate
pointers to the data and not move the data itself around during
an interrupt handler if possible.

Mike

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.