Go Down

Topic: Supplying power to a standalone ATMega328P-PU (Read 2703 times) previous topic - next topic

Just a quick one - do both +5V and GND pins need to be connected to +5V and ground, e.g. from a voltage regulator? Or can I leave one of them empty?

Would make designing my stripboard a lot easier!




I think he means does he have to connect both Vcc/Gnd pairs, rather than can he connect a Vcc but not the Gnd.

Yes tack, I mean do I have to use both 5V and both GND pins, or can I use one of each?

I thought the fact that the circuit needed to be complete was obvious.


The 2nd VCC pin (pin 20 on the IC) is actually AVCC, its for supplying power to the ADC circuitry. The datasheet says that it should be connected to VCC even if you're not using any analog stuff, I personally don't have it connected when prototyping and not using the ADC, but for the final product I do connect it. The 2nd GND pin is optional.

Thanks Cookies, so I need pin20 connected to 5V if I'm using the analog pins?



The data sheet specs for total current sourcing ability is based on per set of pins, so you should connect BOTH grounds, otherwise you only have a ground with half the current carrying capacity of your Vcc pins.

Ok thanks Cookies, that was obviously what you meant after reading your post again!

Tack, are you saying that I would only need one GND if, in theory, I WASN'T to use the AVCC?




I'm saying you should connect both pairs of pins. Vcc/Avcc and both Gnds.

Ok, I understand.

Forgive me for all the questions, just using hypothetical situations to help my understanding.

If I were, as Cookies said he does when prototyping, to THEORETICALLY leave out AVCC, could I THEORETICALLY leave out a ground?


And "Theoretically" you would have 1/2 of what the chip designers intended for the IC POWER SUPPLY
Connect them both...

--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard


I think pin 22 GND is more of providing a good ground for the analog circuity (internal and external) rather than being part of the main power supply like pin 8 GND. You don't want high currents going through the analog ground.


Thanks Cookies, so I need pin20 connected to 5V if I'm using the analog pins?

At least some of the Atmega chips won't work at all if you don't connect AVcc to the positive supply, even if you are not using the ADC. Always connect AVcc as well as Vcc, and connect AGnd as well as Gnd.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Feb 13, 2013, 02:13 pm Last Edit: Feb 13, 2013, 02:53 pm by vbnewcomer Reason: 1
Off-Topic :

I have created stand-alone board for ATMega328P-PU with bootloaded arduino and LED Blink example. It worked fine and now wanted to know that, like i attached LED to pin 13 or 20 of chip as per mappings of pin, I just want to know that, is it usable like arduino board say i can connect LDR like i'm attaching it to pin 11 or arduino with mapped pin of chip or anything more care must be taken if i want to use stand alone on perf board version ?

I'm not sure so asking about usage of pins as per arduino board or i'm missing a lot ?

Say i want to attach HC-SR04 ultrasonic sensor which requires 5V as Vcc but i'm not sure and not written in it's manual that how much current it may needed, will it work with any pin of ATMega328P-PU chip ?

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131