Yahoo Groups archive

AVR-Chat

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

Thread

ADC tips?

ADC tips?

2005-03-11 by Stuart Whelan

Hi folks,

I am playing with some ADC stuff, but (Damn it Jim,) I am a programmer,
not an electronics whiz.

I am using Mega8's in PDIP packages, using the internal oscillator
(running at 8Mhz).

The chip is setup to use the internal reference 2.56V and a prescaler of
64 (giving 125.000 kHz ADC clock freq).

I have .1uf smoothing caps on the right next to the chips between VCC
and GND.

I have .1uf caps between AVCC and GND, and also between AREF and GND.
Once again right next to the IC.

The analogue source is 100K linear POTs.

The pots are 3pin pots with pin 1 connected to GND, pin 3 to AREF and
pin 2 to the ADCn.

The priority is on smooth and non-fluctuating/steady signal as opposed
to an 'accurate' signal. It is for joystick inputs, and the pots are
connected to things like throttles and flight yokes, rudder pedals.

The Mega8 iterates through the 6 ADC channels.

I have implemented software smoothing within the chip, but the raw
hardware signal is bouncing around by up to 4 bits.

My question are these: What else can I do or should I do to get a
'smooth signal'?

- Should I be using an external clock source?

- Should I be using VCC as my AREF?
- Should I be using something other than the Int.Ref 2.56v for AREF?
- What would be regarded as a 'smooth' VCC or AREF? My VCC at the moment
is fluctuating by about 20mV according to the scope.

Any comments, tips suggestions or advice would be most welcome.

Kind Regards,
Stuart Whelan

Recursion: See Recursion.

Re: [AVR-Chat] ADC tips?

2005-03-11 by Russell Shaw

Stuart Whelan wrote:
> Hi folks,
...
> The Mega8 iterates through the 6 ADC channels.
> 
> I have implemented software smoothing within the chip, but the raw
> hardware signal is bouncing around by up to 4 bits.
> 
> My question are these: What else can I do or should I do to get a
> 'smooth signal'?
> 
> - Should I be using an external clock source?

no

> - Should I be using VCC as my AREF?

Only if it is low noise. Atleast feed it thru an RC filter.

> - Should I be using something other than the Int.Ref 2.56v for AREF?

Not needed. Filter AREF with a cap tho.

> - What would be regarded as a 'smooth' VCC or AREF? My VCC at the moment
> is fluctuating by about 20mV according to the scope.

4 bits is 40mVpk for AREF=5V. Make sure the REF is 1/10th as noisy atleast.

> Any comments, tips suggestions or advice would be most welcome.

Make sure ground pins are connected to a good grounding system.
For extra low noise, don't switch any loads on the same port as
the ADC pins during sampling.

Re: ADC tips?

2005-03-11 by paul_hvidston

Additional suggestions (I've been playing with a 'mega8 but have not
employed the ADC yet):

You are always better off with a larger Vref, since 1/1024th of Vref
is your LSB. Your analog system noise should be an order of magnetude
lower than this.

There should be a low pass filter (inductor and capacitor) on the AVcc
pin to reduce Vcc noise coupling from the digital circuitry.

The ADC is designed for analog sources of 10K or lower (is better)
output impedance. Your 100K pots might be allowing a little more
source-noise into the system. You might try an experiment by placing a
small capacitor from the analog input pin to ground (should be fine
since you are using a pot). Short traces with good ground planes and
isolation from other noisy signals are a MUST at 10 bits and greater.

Aref should not be connected to anything except an external cap in
normal use. If you are referencing your pots to this you must buffer
this with a high impedance buffer amp.

You didn't say if you were using the "ADC Noise Canceller" (sleeping
the rest of the chip) during conversions. From reading the doc, it
sounds like its really necessary. The down-side is that you can only
run in single-conversion mode.

Cheers,
Paul H.

Re: [AVR-Chat] ADC tips?

2005-03-11 by Leon Heller

----- Original Message ----- 
Show quoted textHide quoted text
From: Stuart Whelan
To: AVR-Chat@yahoogroups.com
Sent: Friday, March 11, 2005 2:19 AM
Subject: [AVR-Chat] ADC tips?


Hi folks,

I am playing with some ADC stuff, but (Damn it Jim,) I am a programmer,
not an electronics whiz.

I am using Mega8's in PDIP packages, using the internal oscillator
(running at 8Mhz).

The chip is setup to use the internal reference 2.56V and a prescaler of
64 (giving 125.000 kHz ADC clock freq).

I have .1uf smoothing caps on the right next to the chips between VCC
and GND.

I have .1uf caps between AVCC and GND, and also between AREF and GND.
Once again right next to the IC.

The analogue source is 100K linear POTs.

The pots are 3pin pots with pin 1 connected to GND, pin 3 to AREF and
pin 2 to the ADCn.

The priority is on smooth and non-fluctuating/steady signal as opposed
to an 'accurate' signal. It is for joystick inputs, and the pots are
connected to things like throttles and flight yokes, rudder pedals.

The Mega8 iterates through the 6 ADC channels.

I have implemented software smoothing within the chip, but the raw
hardware signal is bouncing around by up to 4 bits.

My question are these: What else can I do or should I do to get a
'smooth signal'?

- Should I be using an external clock source?

- Should I be using VCC as my AREF?
- Should I be using something other than the Int.Ref 2.56v for AREF?
- What would be regarded as a 'smooth' VCC or AREF? My VCC at the moment
is fluctuating by about 20mV according to the scope.

Any comments, tips suggestions or advice would be most welcome.

Have you followed the suggestions on the data sheet (page 200) regarding the 
power connections? I've played around with the Mega8535 ADC with input from 
a pot and got very stable values. I was using a home-made PCB but I didn't 
bother with the recommended analogue ground plane.

Leon
--
Leon Heller, G1HSM
http://www.geocities.com/leon_heller

Re: [AVR-Chat] Re: ADC tips?

2005-03-11 by Zack Widup

On Fri, 11 Mar 2005, paul_hvidston wrote:

> 
> Additional suggestions (I've been playing with a 'mega8 but have not
> employed the ADC yet):
> 
> You are always better off with a larger Vref, since 1/1024th of Vref
> is your LSB. Your analog system noise should be an order of magnetude
> lower than this.
> 

I like to use an external 4.096 volt band-gap reference because the 
numbers work out so conveniently (LSB = 4 mV).

Zack

Re: ADC tips?

2005-03-12 by dan_avr

Stuart,
Check that there“s no ripple en VCC (VCC should be realy stable).

good luck!

--- In AVR-Chat@yahoogroups.com, Stuart Whelan <stuart.whelan@p...> 
wrote:
> Hi folks,
> 
> I am playing with some ADC stuff, but (Damn it Jim,) I am a 
programmer,
> not an electronics whiz.
> 
> I am using Mega8's in PDIP packages, using the internal oscillator
> (running at 8Mhz).
> 
> The chip is setup to use the internal reference 2.56V and a 
prescaler of
> 64 (giving 125.000 kHz ADC clock freq).
> 
> I have .1uf smoothing caps on the right next to the chips between 
VCC
> and GND.
> 
> I have .1uf caps between AVCC and GND, and also between AREF and 
GND.
> Once again right next to the IC.
> 
> The analogue source is 100K linear POTs.
> 
> The pots are 3pin pots with pin 1 connected to GND, pin 3 to AREF 
and
> pin 2 to the ADCn.
> 
> The priority is on smooth and non-fluctuating/steady signal as 
opposed
> to an 'accurate' signal. It is for joystick inputs, and the pots are
> connected to things like throttles and flight yokes, rudder pedals.
> 
> The Mega8 iterates through the 6 ADC channels.
> 
> I have implemented software smoothing within the chip, but the raw
> hardware signal is bouncing around by up to 4 bits.
> 
> My question are these: What else can I do or should I do to get a
> 'smooth signal'?
> 
> - Should I be using an external clock source?
> 
> - Should I be using VCC as my AREF?
> - Should I be using something other than the Int.Ref 2.56v for AREF?
> - What would be regarded as a 'smooth' VCC or AREF? My VCC at the 
moment
Show quoted textHide quoted text
> is fluctuating by about 20mV according to the scope.
> 
> Any comments, tips suggestions or advice would be most welcome.
> 
> Kind Regards,
> Stuart Whelan
> 
> Recursion: See Recursion.

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.