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

  • \$\begingroup\$ 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. \$\endgroup\$ – Matt Young Dec 31 '16 at 3:56
  • \$\begingroup\$ @MattYoung any suggestions on other books? \$\endgroup\$ – msmith1114 Dec 31 '16 at 4:29
  • \$\begingroup\$ Afraid not, I don't read/use that style of book. \$\endgroup\$ – Matt Young Dec 31 '16 at 4:34
  • \$\begingroup\$ @MattYoung Mazidi would be good book. \$\endgroup\$ – 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.

  • \$\begingroup\$ Im guessing my AVR was not configured, is this configured via fuses (as in what you would send to AVR-dude?) \$\endgroup\$ – msmith1114 Dec 31 '16 at 4:05
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – duskwuff -inactive- Dec 31 '16 at 4:26
  • \$\begingroup\$ 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 \$\endgroup\$ – msmith1114 Dec 31 '16 at 4:28
  • \$\begingroup\$ Those avrdude settings don't touch the fuses. \$\endgroup\$ – duskwuff -inactive- Dec 31 '16 at 4:30
  • \$\begingroup\$ yup looks like I'll have to make some modifications, I guess it's just using default fuses then. \$\endgroup\$ – 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 .


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.