Voltage Reference on the AVcc pin of ATMEGA128 - Page 1
Forum section: electronics / beginners

author: 2X
author_rank: Frequent Contributor
timestamp: August 23, 2023, 05:29:15 pm
content: 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.

author: bingo600
author_rank: Super Contributor
timestamp: August 23, 2023, 06:10:52 pm
content: Avcc is used for the ADC (Analog to Digital Converter)Dependingon your use of the ADC , you might want a very "Stiff/Clean" reference voltage there./Bingo

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 23, 2023, 08:09:19 pm
content: 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 ratingsare 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

author: golden_labels
author_rank: Super Contributor
timestamp: August 23, 2023, 11:56:52 pm
content: 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.

author: 2X
author_rank: Frequent Contributor
timestamp: August 24, 2023, 09:55:31 pm
content: 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.

author: Psi
author_rank: Super Contributor
timestamp: August 24, 2023, 10:09:26 pm
content: 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.

author: wraper
author_rank: Unknown
timestamp: August 24, 2023, 10:16:09 pm
content: Quote from: 2X on August 24, 2023, 09:55:31 pmIf 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.

author: golden_labels
author_rank: Super Contributor
timestamp: August 24, 2023, 11:15:05 pm
content: 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.