Can't get ATMEGA328P-PU to work

Hello everyone,

I recently bought an Atmega328P-PU chip to make a diy arduino, but can’t get it to work.
I have looked around the forum but couldn’t find a solution that worked.
Basically i have got everything hooked up like the image below:

The only difference is that i have an LED on pin 13, but can’t get it to do anything.
The bootloader is properly loaded, because when i put it directly onto my Arduino Uno i can use it as normal.

Does anyone have any idea what i’m doing wrong?

Your caps look like they're not on the same pins as the crystal.....but it might be my dodgy eyes/a dodgy picture.

You may want to add a 0.1uF on the reset line wiring to your programmer to.

Don't forget some bypass capacitors between +5v and Gnd.

The most critical component is the crystal. Make sure it's going to the right pins and both ends of the crystal have 22 pF caps to Ground. If you accidentally use 22 uF capacitors it won't work.

Do not connect AREF to 5V.
It is on a tutorial page, but it is wrong.

Try it on a breadboard first.

I have a setup to mass program the chips, and it didn't work either. Followed Nick Gammon's instructions. Turned out that was a short between two tracks on the board AND I had an issue with the caps and crystal being one set of pins up from where they should be.

If you have the wiring correct (you don't, no power rail bypass caps for a start) then it will work.

Sorry for the late reply, i've been quite busy :sweat_smile:

The crystal is connected correctly (according to the pin mapping of the Atmega), the picture is just a little dodgy.

I disconnected the 5v to AREF, but it still doesn't do a thing :frowning:

The 5v is coming from a working arduino uno and so is ground.

Add a led with resistor to Arduino pin 13. I think the bootloader blinks it.

It either is wired like Nick Gammon's version which works, or it isn't. Post a picture to confirm.

Echelon:
Hello everyone,

I recently bought an Atmega328P-PU chip to make a diy arduino, but can't get it to work.
I have looked around the forum but couldn't find a solution that worked.
Basically i have got everything hooked up like the image below:

The only difference is that i have an LED on pin 13, but can't get it to do anything.
The bootloader is properly loaded, because when i put it directly onto my Arduino Uno i can use it as normal.

Does anyone have any idea what i'm doing wrong?

A question: what sketch is currently uploaded, the blink one?

Check all connections with a tester.

The blink sketch is uploaded.

This is a picture of my breadboard, i disconnected the LED temporarily for visibility.

The LED works when connected to the Arduino Uno pin 13, so it couldn't be a faulty LED.

You have no power rail caps. Put them in for a start.

How do you upload a sketch ? with a usb-serial converter ?
Can you tell more. The led works ? Only for the bootloader or also with the Blink sketch ? If the Blink sketch works, what is the problem ?

ChilliTronix:
You have no power rail caps. Put them in for a start.

Just added them, still nothing :frowning:

Peter_n:
How do you upload a sketch ? with a usb-serial converter ?
Can you tell more. The led works ? Only for the bootloader or also with the Blink sketch ? If the Blink sketch works, what is the problem ?

I uploaded the sketch by putting the chip on an Arduino Uno board, that's also how i verified the LED worked and that i didn't just have a fried chip or something. So everything works when the chip is on the Arduino Uno, but not when it's on the breadboard.

Allright, i feel stupid now :sweat_smile:
I ordered new parts and it turned out to be a busted crystal.

Thanks for all the replies!

Wow! I'm glad you found the problem. That never crossed my mind.
Don't hesitate to keep asking :stuck_out_tongue: These things happen to all of us. The problem might be just as well in the area that is least expected.

Echelon:
Allright, i feel stupid now :sweat_smile:
I ordered new parts and it turned out to be a busted crystal.

Thanks for all the replies!

Sometimes the breadboard adds load capacitance to the crystal, exceeding the recommended one and preventing it to work well. To avoid this I try 18 or 20 pf caps.