Is Cap on AREF really needed?

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using a ATMEGA328 on a portable device and am reading the Battery level agains the internal 1.1V reference.

 

I have AREF connected directly to VCC (a 3V battery) and are getting good readings.  I know that the data sheet says you should connect AREF to a cap.

 

Is Cap on AREF really needed in my case? 

This topic has a solution.

-alx

Last Edited: Sun. May 12, 2019 - 04:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

alxgarza wrote:

I know that the data sheet says you should connect AREF to a cap. Is Cap on AREF really needed in my case? 

 

Not quite true. It says that you can use a cap to improve the pins immunity to noise, not that you have to.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

Last Edited: Sat. May 11, 2019 - 01:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The datasheet says, "The internal voltage reference

must be decoupled by an external capacitor at the

AREF pin to improve noise immunity."  Emphasis

added.

 

--Mike

 

EDIT: I have seen different language saying it's an

optional thing, but the above quote is from the 2018

datasheet with file name DS40001984A

 

Last Edited: Sat. May 11, 2019 - 02:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you are using the ADC to measure an analog signal, and small, (e.g. mV range), signal variation is important, then YES, use the Cap, or better yet put an LC filter on AVcc and use the cap on ARef.

 

As +/- a few counts (mV) likely doesn't matter when reading the battery voltage, you can likely get away without using it.

 

Now the real question: Why would you not use it?

If you are selling 100K units of kids toys, then skip it.

 

If you are doing anything else then include the cap if you are using the analog circuitry.

A cap is dirt cheap, and it improves the analog module's performance.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note, BTW, that the cap on ARef is different from the By-Pass caps on the Vcc/Ground and AVcc/Ground pins.

Those ARE required for proper performance of the micro.

 

The ARef cap is in a separate category, as noted above, and is pseudo-required when using the analog circuitry, not required otherwise.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Currently I'm reading the battery level (3v battery) and displaying it in 5 steps.  So I don't need accurate readings.

 

And I have AREF connected to VCC.  

 

So what would be a good design?  Leave it as it is (AREF connected to VCC) or have de decoupling cap in AREF?

 

Thanks for your comments.

 

-alx

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

alxgarza wrote:

I have AREF connected to VCC. 

 

No, AREF should just have a capacitor to

ground.  Its voltage may be different than

Vcc so connecting them could damage the

chip.  You can connect AVcc directly to Vcc.

 

--Mike

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1


avr-mike wrote:

The datasheet says, "The internal voltage reference

must be decoupled by an external capacitor at the

AREF pin to improve noise immunity."  Emphasis

added.

 

He is not using the internal voltage reference.

 

This would be my cheap solution:

 

You anyway have a cap on VCC / AVCC, so it would be OK. If you want better results, then have a separate cap for AVCC (with a series resistor / inductor).

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avr-mike wrote:

No, AREF should just have a capacitor to

ground.  Its voltage may be different than

Vcc so connecting them could damage the

chip.  You can connect AVcc directly to Vcc.

 

--Mike

 

It is OK as long as he never sets REFS1:FES0 to b11. If it would be a problem, then no external voltage reference higher than 1.1V would be allowed, which is not the case.

 

EDIT: added "higher than 1.1V"

Last Edited: Sat. May 11, 2019 - 11:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The battery is the big cap.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simonetta wrote:

The battery is the big cap.

+1

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But with that mux and FET between Vcc and ARef, there is resistance present. That means that the resistance at that point is NOT the battery resistance (which, especially as it gets discharged, might not be THAT low). 

 

The simple answer is: there is no one answer that fits all. If you want good ADC performance, add the cap. If your thing is just a "piece of cheap sh*t", then don't bother.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

But with that mux and FET between Vcc and ARef, there is resistance present. That means that the resistance at that point is NOT the battery resistance (which, especially as it gets discharged, might not be THAT low). 

 

The simple answer is: there is no one answer that fits all. If you want good ADC performance, add the cap. If your thing is just a "piece of cheap sh*t", then don't bother.

 

Jim

Have you missed the point that the discussion is about tying AREF to AVCC and VCC ? It saves one capacitor, which is naturally replaced by the battery.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And I already have a .1µf cap at VCC.

-alx

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This cap is less than 1/2 cent at Digikey , in thousands. (200 for a dollar) ..just put it in & spend your time looking for Bigfoot.

CAP CER 10000PF 50V X7R 0402

 

1276-1028-1-ND

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well... If you're not doing any analog work, or if the analog performance is good enough for you, you can skip the cap. As for me, an SMD cap is so small and so cheap, put it on anything where I want to use the analog features, and most things where I don't.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

angelu wrote:

It is OK as long as he never sets REFS1:FES0 to b11.

 

I worry about things like this.  If REFS gets set

wrong, somehow, in software, the hardware can

get damaged.  Adding one capacitor protects it.

 

--Mike