Pages: [1]   Go Down
Author Topic: Supplying power to a standalone ATMega328P-PU  (Read 2107 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Connect both.
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thanks
Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yup, that would be correct.
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 46
Posts: 2883
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Bob
Logged

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

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6613
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 (12.14 KB, 320x240 - viewed 52 times.)
« Last Edit: February 13, 2013, 08:53:45 am by vbnewcomer » Logged

Pages: [1]   Go Up
Jump to: