Go Down

Topic: problem uploading to atmega on breadboard (Read 1 time) previous topic - next topic


so i followed this tutorial EXACTLY: http://arduino.cc/en/Tutorial/ArduinoToBreadboard
at first I had the wrong crystals but then Lefty in the forums here helped me out and I got the right ones...I have 6 atmega328p-pu chips...I put the arduino bootloader on all of them no problem. Then I started putting some blink sketches on the atmegas while they were in the breadboard (no chip on arduino board)following the second part of the tutorial...that worked fine too for awhile. I got to the 4th chip, and I got the error message that you get when the board can't find/recognize the chip:
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
5th chip did that too, 6th chip the sketch uploaded.
So I thought I had some bad chips.
But then I was playing around a little more, uploading different sketches to different chips and slowly I was getting that error message more and more and now I get it on all the chips. Even on the ones that previously took the blink sketch just fine....(I did not change any wiring...everything was exactly the same as it had been before)
when I plug the atmegas directly into the arduino board I can upload sketches to them fine.
So this isn't a huge problem as I can do what I need to do...I'm just popping out and placing the chips more than I'd like to...it's just a weird problem. I see that some people are having similar issues here...
Is this a common problem?
I'm on windows 7 64x using arduino 0021 on a duemilanove
thanks for any input!


Hi, the chances are that the connections on the breadboard need re-made - pull all the wires, crystal caps what ever else you have on there, then re-build on a different location of the board I found this sorted every instance of this error on my breadboards.
http://www.uk-pcb.co.uk - UK Based PCB Fab & Assembly Company
Design & Assembly work undertaken - Arduino repairs & testing - PM for details. Arduino & C# PC programming.


Jun 25, 2011, 09:56 pm Last Edit: Jun 25, 2011, 10:03 pm by floresta Reason: 1
so i followed this tutorial EXACTLY:

That might be your problem.
(1) The crystal should be connected directly to the microprocessor pins, not via jumpers.
(2) The same goes for the capacitors associated with the crystal.
(3) Both power connections should be bypassed right at the chip as well.

As Grumpy_Mike said a few days ago: "That is the trouble with a lot of stuff on the internet, it comes from bodgers who have no idea what they are doing and that leads beginners into big mistakes."



thanks so much for your help.
I don't understand the electronics of why it would matter if the crystal is connected via jumpers or directly. When you say directly do you mean literally soldered onto a pin of the chip? why does it matter if it's connected via a jumper or just one pin away on the breadboard? There's still a connection....

what do you mean by bypassing power connections?

i guess I'm confused with what you mean by "right at the chip." why is none of this mentioned in the tutorial?

I'm certainly no electronics engineer....sorry if these are basic questions...any help is much appreciated..


The 16MHz clock frequency is high enough to cause RF interference.  Breadboard circuits with their long unshielded interconnects and dry joints are especially susceptible to interference, and this could be the cause of your problems.  To minimise this interference it's important to keep the wires as short as possible, especially for those carrying very high frequency signals such as those from the crystal.  You also need extra smoothing on the power supply, so put 100nF capacitors between V+ and Gnd at the points where they arrive at the CPU.


When you say directly do you mean literally soldered onto a pin of the chip?

That would be best but it's not often done.  Put the crystal at an angle so that it fit in the breadboard, in the rows for pins 9 and 10, without any jumper wires.  Put the capacitors between each of those rows and the GND bus.

what do you mean by bypassing power connections?

Use a bypass (or decoupling) capacitor, typically 0.1 uF, between each power pin and the nearby GND pin.  Do this right at the chip.   The power lines act like antennas and the capacitors get rid of any high frequency signals that they may have picked up.

If you have an inexpensive breadboard then the comments by 'spycatcher2k' are appropriate.


Go Up