AVR Anolog to Digital Conversion Errors

Discussions on the software and hardware for Atmel's STK standard.

Moderator: phalanx

Post Reply
aknickolai
Posts: 2
Joined: Thu Nov 06, 2014 5:02 pm

AVR Anolog to Digital Conversion Errors

Post by aknickolai » Thu Nov 06, 2014 5:11 pm

So I've always put small 100nF caps on AVCC and AREF when I need to do analog to digital conversions on my atmel chips. Everything worked, but I just got an LCD working and I'm getting a ~15% error between what my meter and the A2D are claiming the voltage is. If I remove the cap on either AVCC or AREF (ie hardware the connection) the error goes away.

So, should I only be putting a cap on AREF and not AVCC? I've messed a ton with the code and trouble shooting, I'm sure it is a wiring issue related to the caps as removing them eliminates the error. Of course, it also eliminates any filtering as well, I'd like to keep that.

User avatar
Ross Robotics
Support Volunteer
Posts: 2007
Joined: Thu Jun 07, 2012 9:33 pm
Contact:

Re: AVR Anolog to Digital Conversion Errors

Post by Ross Robotics » Fri Nov 07, 2014 11:29 am

Yes, it is standard to put a 100nF cap in series with AREF.
Attachments
aref.png
aref.png (10.75 KiB) Viewed 2233 times
------------------------------------------------------------------------------------------------------------------------------------------------------------
//codlink
Available for circuit and PCB design, just PM me!

aknickolai
Posts: 2
Joined: Thu Nov 06, 2014 5:02 pm

Re: AVR Anolog to Digital Conversion Errors

Post by aknickolai » Fri Nov 07, 2014 9:37 pm

AREF makes since for sure. I guess I don't need one on AVCC, since eliminating that cap gets rid of my A2d error and I would keep the filtering on AREF. Thanks!

User avatar
Ross Robotics
Support Volunteer
Posts: 2007
Joined: Thu Jun 07, 2012 9:33 pm
Contact:

Re: AVR Anolog to Digital Conversion Errors

Post by Ross Robotics » Fri Nov 07, 2014 9:44 pm

Correct, no need for a series cap on AVCC, just put it to your + supply. Just make sure you have some decoupling caps.
------------------------------------------------------------------------------------------------------------------------------------------------------------
//codlink
Available for circuit and PCB design, just PM me!

AVRexpert
Posts: 2
Joined: Sat Dec 17, 2016 8:48 pm

Re: AVR Anolog to Digital Conversion Errors

Post by AVRexpert » Mon Dec 26, 2016 11:00 am

HEllo thanks for your question !
In order to use internal ADC you must give the reference voltage to the microcontroller . Connect your AVCC to reference voltage(5 volt generally ) and AREF pin to Ground . So that internal ADC of microcontroller take suitable reference . I have made a nice tutorial for you related to how to use ADC of microcontroller in Atmega32 microcontroller please visit this reference link [url]https:www.electronify.org[/url]
Thank you :clap: :dance: :clap: :dance:

jremington
Support Volunteer
Posts: 2245
Joined: Fri Jun 15, 2007 9:41 pm
Location: Eugene, Or

Re: AVR Anolog to Digital Conversion Errors

Post by jremington » Mon Dec 26, 2016 12:46 pm

and AREF pin to Ground
Ignore this extremely bad advice, as the ADC will cease to function and the internal circuitry may be destroyed.

The ADC can be affected by noise in the power supply. If using Vcc as the reference, it is common to decouple Vcc and Vcc with a 10 uH inductor as well as capacitors.

See "noise cancelling techniques", section 24.6 and Figure 24.9 of the ATmega328 data sheet

Post Reply