So I am trying to build a standalone circuit using the Atmega 328p. After uploading the code using Atmel Studio and AVRDude I get no response from the circuit; however, when I take the Atmega and put it on an Arduino board I can verify that the code uploaded works. Can anyone shed light on what I may be doing wrong?

Here is what I have so far:

1. I am using a 16Mhz crystal with 2 22pF capacitors
2. An LED which verifies that Atmega is powered on
3. I am using a USBAsp clone programmer

I took an image of the circuit I have below.

• Sigh. Bypass Capacitors. (Note: I'm principally exasperated at any tutorial you're following that doesn't mention the requirement for bypass caps, not you.) – Connor Wolf Nov 25 '14 at 9:40
• Also, I do not see any resistor inline with the green LED, so you may have blown the LED. You need a current limiting resistor for every LED! The ATmega can generally drive 40 mA, and most T 1 3/4 LEDs are rated to 20 mA max. – Connor Wolf Nov 25 '14 at 9:43
• Are you sure you've got the reset tact-switch right? Remember that the four pins are permanently linked in two pairs. The two pairs are shorted together when you press the switch. – John Honniball Nov 25 '14 at 13:49
• Well I know that the LED is working since I have tested it directly with the with the power pins. I followed a tutorial when wiring the pins for the reset switch and as of now I am using the programmer to power the atmega. Anyways, if the tutorial was wrong can anyone point me to a tutorial that would show me how to correctly wire this circuit? – user40699 Nov 25 '14 at 15:45
• I recently was doing something similar. I checked and re-checked everything until I found out I had the brown out fuse set too low. Make sure you are using 5v or have the appropriate brown out settings. – tehwalris Dec 15 '14 at 1:00

Remove the LED and use either an oscilloscope or a voltmeter to examine D13. Do you see it pulsing up and down? If so, then the LED isn't working. As @Connor Wolf said above, you need a current limiting resistor in series with the LED to protect both the LED and the controller pin from excessive current.

If the pin doesn't pulse, then try pulsing a different pin to see if you've blown the D13 pin.

If you do have a scope, check for oscillation on the two crystal pins (use a high impedance scope probe to do this). If you don't see that, then it's possible the crystal is the wrong kind. You need to match its load capacitance up with the loading caps. See this article.

Lastly, I would not connect AREF to Vcc. If you want a Vcc analog reference, you use analogReference(DEFAULT). AREF should - for production circuits - have a decoupling cap to ground and/or be fed a reference voltage (selected via analogReference(EXTERNAL)). If you're not using it, then you can let it float.

I've done what you're trying to do, and it does work. There's nothing obvious that you've missed.

• If the crystal wasn't working then the programmer wouldn't be able to talk to the chip at all (assuming the fuses were set to use it). – Ignacio Vazquez-Abrams Dec 14 '14 at 21:42
• Didn't he say he took the chip out of the breadboard and stuck it in an Uno to program it? – nsayer Dec 15 '14 at 2:07
• To test it. He used a USBasp clone to program it. – Ignacio Vazquez-Abrams Dec 15 '14 at 3:07
• Then you're right, and I stand corrected. Either the crystal works or the controller isn't fused to use it, otherwise the USBasp wouldn't work. – nsayer Dec 15 '14 at 6:41