Supplying power to a standalone ATMega328P-PU

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!

Thanks,

Sam

Connect both.

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?

Thanks

Yup, that would be correct.

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?

Thanks,

Sam

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...

Bob

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.

samwhiteUK:
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.

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 ?

100213-1630.jpg