# ATmega168 GND and AVCC not needed when programming?

I'm reading "MAKE: AVR Programming" and for their "basic LED blinking setup" I noticed in their diagram they don't have the 2nd GND and AVCC (or AREF, which I'm still unsure what it's used for) connected.

I'm using an ATmega328 and everything I read said that BOTH GNDs and AVCC need to be hooked up, but in this picture (and it is indeed the "final" hookup picture) the GND on the right side of the chip and AVCC are not hooked up......is this correct?

If so, can I do the same on my ATmega328? If so, what exactly is the point of the 2nd GND and AVCC?

edit: I also note that a Crystal (with the 2 Ceramic Caps) is not needed here either? Any particular reason? When programming my ATmega328 it would not work at all unless I hooked up the Crystal and 2 caps to Xtal1/Xtal2 (But I pulled my ATmega out of an Arduino, not sure if that matters.)

• That's the book written by the economics Ph.D. Toss it. The guy doesn't know what he's talking about, and that is shown in many other places in the book. – Matt Young Dec 31 '16 at 3:56
• @MattYoung any suggestions on other books? – msmith1114 Dec 31 '16 at 4:29
• Afraid not, I don't read/use that style of book. – Matt Young Dec 31 '16 at 4:34
• @MattYoung Mazidi would be good book. – MaNyYaCk Dec 31 '16 at 6:17

Leaving AVCC or a GND pin disconnected is an error -- this diagram is wrong! The chip may work with these pins disconnected, but it may also cause damage. Don't chance it.

A crystal is not always needed, as the AVR has an internal oscillator, which runs at roughly 8 MHz. However, the AVR must be configured to use that internal oscillator, and cannot be reprogrammed (even to change the oscillator settings!) if it isn't receiving a clock signal.

• Im guessing my AVR was not configured, is this configured via fuses (as in what you would send to AVR-dude?) – msmith1114 Dec 31 '16 at 4:05
• Correct -- one of the functions of the AVR fuses is to configure the oscillator. I believe the "factory" fuse settings specify the internal oscillator, although I could be wrong. – duskwuff -inactive- Dec 31 '16 at 4:26
• I think im just using defaults : "-c usbtiny -p m328p -v -v -v -U flash:w:$(TargetDir)$(TargetName).hex:i" (Is how AVR dude is running this) with atmel studio – msmith1114 Dec 31 '16 at 4:28
• Those avrdude settings don't touch the fuses. – duskwuff -inactive- Dec 31 '16 at 4:30
• yup looks like I'll have to make some modifications, I guess it's just using default fuses then. – msmith1114 Dec 31 '16 at 5:30

disconnected AVCC or GND pins is dangerous it may destroy your IC.

If you get your Atmega328 from Arduino board it had to be configured to work on output crystal 16MHZ built in on Arduino board if you don't want to use it you can reconfigure the fuses . you can work without external oscillator at 1MHZ if your application don't concerning time or use delay functions many times .