Author Topic: Voltage Reference on the AVcc pin of ATMEGA128  (Read 1491 times)

0 Members and 1 Guest are viewing this topic.

Offline 2XTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gr
Voltage Reference on the AVcc pin of ATMEGA128
« on: August 23, 2023, 05:29:15 pm »
Hi,
I have a quiry. Why somenone to put a voltage reference on the AVcc pin of ATMEGA128 and not to connected with all the other Vcc pins together. On michrochip's (PIC) processors I connect them all together.
« Last Edit: August 23, 2023, 07:31:04 pm by 2X »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2032
  • Country: dk
Re: Voltage Reference on the AVcc pin of ATMEGA128
« Reply #1 on: August 23, 2023, 06:10:52 pm »
Avcc is used for the ADC (Analog to Digital Converter)
Depending on your use of the ADC , you might want a very "Stiff/Clean" reference voltage there.

/Bingo
 
The following users thanked this post: 2X

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22381
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Voltage Reference on the AVcc pin of ATMEGA128
« Reply #2 on: August 23, 2023, 08:09:19 pm »
Yeech, that's a bad circuit:
- 2uF shunting TL431 style regulator -- generally this is in the unstable region and device oscillates (mega noisy ref!)
- Insufficient bias current: I'd have to run the numbers, but with that relatively low divider there, it might not regulate at all; certainly not within tolerance.
- Chip ratings are not respected.  From datasheet: "The ADC has a separate analog supply voltage pin, AVCC. AVCC must not differ more than ±0.3V from VCC."
- When external reference is desired, it's connected to AREF (obviously?)

KIA431 doesn't specify stable range, but most others do.  Typically either very small or very large (10nF- or 10uF+) values are acceptable; inbetween values must be connected with adequate ESR, or other compensation scheme.

431 isn't a particularly quiet ref anyway, but neither is the ADC very precise, so it's a fine match otherwise.  431s are available down to 0.5% grade, or a few LSBs' accuracy.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: 2X

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1340
  • Country: pl
Re: Voltage Reference on the AVcc pin of ATMEGA128
« Reply #3 on: August 23, 2023, 11:56:52 pm »
2X: your intuition is right. I suspect somebody has confused AREF with AVCC. This suspicion is supported by AREF remaining floating: this would be a weird choice after putting so much effort into conditioning AVCC.

AVCC is a power supply pin for ADC, not the reference voltage.(1) The voltage on this pin must be the same as on VCC pins (with ±300 mV tolerance). In practice it’s either connected to VCC directly or through a simple filter to reduce noise: a capacitor or an LC filter (see Fig. 114 in the datasheet). If the circuit connected to AVCC is indeed giving 4.5 V, it’s already out of spec.

The voltage reference selection circuitry is in Fig. 108 (see attachment, irrelevant parts hidden). Tab. 97 gives possible configurations. With REFS0 bit you switch between using AREF or the internal references. If AREF is used, it’s passed directly to the conversion circuitry. If AREF is not used, the pin may be used to connect a smoothing capacitor for filtering noise present on internal references. REFS1 determines, which internal source is used: either the 2.56 V reference or the supply voltage.


(1) This voltage is one of the options for the reference voltage, but the pin can’t accept arbitrary voltage to be used as a reference.
People imagine AI as T1000. What we got so far is glorified T9.
 
The following users thanked this post: 2X

Offline 2XTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gr
Re: Voltage Reference on the AVcc pin of ATMEGA128
« Reply #4 on: August 24, 2023, 09:55:31 pm »
Th ref pin I didn't look if it is connected or it is float. I check it again and it is connected to a voltage divider that ends somewhere in the power supply PCB (the microcontroller is on a mini seperate PCB where connected on the power supply). Again it is strange that they put a voltage reference on a AVCC pin and didn't connected to the Vcc directly or through a ferrite beed.

« Last Edit: April 19, 2024, 10:48:33 pm by 2X »
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 10220
  • Country: nz
Re: Voltage Reference on the AVcc pin of ATMEGA128
« Reply #5 on: August 24, 2023, 10:09:26 pm »
As mentioned above, the diagram is wrong.    "AVCC must not differ more than ±0.3V from VCC."

AVCC is a separate pin to VCC so you can add filtering to reduce ADC noise, or you can have a totally separate low-noise/more-accurate supply rail just for AVCC. but it still has to be the same voltage as VCC within that +/- 0.3 range. 

Note that just because it's wrong doesn't mean it wont work. But in this case i can't see any reason why anyone would need to use the chip like that.
So it's almost definitely just a mistake someone made when designing it, and perhaps it worked so no one ever noticed.
« Last Edit: August 24, 2023, 10:17:49 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 
The following users thanked this post: wraper, 2X

Offline wraper

  • Supporter
  • ****
  • Posts: 17581
  • Country: lv
Re: Voltage Reference on the AVcc pin of ATMEGA128
« Reply #6 on: August 24, 2023, 10:16:09 pm »
Th ref pin I didn't look if it is connected or it is float. I check it again and it is connected to a voltage divider that ends somewhere in the power supply PCB (the microcontroller is on a mini seperate PCB where connected on the power supply). Again it is strange that they put a voltage reference on a AVCC pin and didn't connected to the Vcc directly or through a ferrite beed.
If it's really how it's made, then whoever designed that had very little clue about what they were doing. Though I wouldn't be that surprised about it as I've seen plenty of nonsense designed into commercially produced devices that work by lucky coincidence.
 
The following users thanked this post: 2X

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1340
  • Country: pl
Re: Voltage Reference on the AVcc pin of ATMEGA128
« Reply #7 on: August 24, 2023, 11:15:05 pm »
AREF being connected to a voltage divider makes it even more puzzling, as it drives us away from the idea of the designer confusing AVCC with AREF. Not to mention the AREF divider is also a mystery of its own.

Other than plain human error or ignorance, I can try to explain this by… this simply working in practice. It wouldn’t be the first time in electronics, that a circuit doesn’t follow official recommendations or theory, and still works reliably. Maybe in reality this KIA431 based fragment gives higher voltage than what theory would suggest. Or VCC is actually below 5V. Or the probability of this whole thing failing from being out of spec is lower than it failing from power supply noise.

Of course I am ostentiously turning my blind eye towards the cluelessness/mistake explanation, making sure my other eye is shut as tightly as possible. And it would still stand for a prime example of overengineering.
People imagine AI as T1000. What we got so far is glorified T9.
 
The following users thanked this post: 2X


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf