Electronic – ATmega168 GND and AVCC not needed when programming

atmegaavr

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.

Image of ATmega168 IC on breadboard

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

Best Answer

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.