Since yesterday I'm trying to bootload some atmega328-pu's, but I have some troubles with bootloading them.
I've googled a real lot but I couldn't find any solutions.
I even checked and changed the wiring for over 20 times.
I'm currently stuck at the last picture on this page: http://arduino.cc/en/Tutorial/ArduinoISP.
I'm using an arduino mega 2560 and I have wired the pins correctly: MISO (50), MOSI (51), SCK (52) and SS (53).
But still I always get the following message when I try to burn them:
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
Make sure "tools > programmer> arduino as isp" is selected
Go to "tools > burn bootloader"
And that's how I end getting the error described above.
PS: I have the right board selected: "arduino mega 2560 or mega adk"
Hope someone can help me with this common problem so hopefully even other people can profit from the solution.
6.Select the item in the Tools > Board menu that corresponds to the board on which you want to burn the bootloader (not the board that you're using as the programmer). See the board descriptions on the environment page for details.
As you are programming a 328 you should selct the right boar, for example Arduino Uno, and not Arduino Mega
I tried what you said, but now i get a different message:
avrdude: stk500_getsync(): not in sync: resp=0x00
The ArduinoISP example that I should upload is compatible with the arduino mega 2560.
It has the following text in it:
// This sketch turns the Arduino into a AVRISP
// using the following arduino pins:
//
// pin name: not-mega: mega(1280 and 2560)
// slave reset: 10: 53
// MOSI: 11: 51
// MISO: 12: 50
// SCK: 13: 52
And I've double checked the wiring, but still don't know what the problem might be.
It uses the same basic SPI setup, but you add a jumper to D9 for an external 8 MHz signal for XTAL1 on your target. The cool part is you use the serial monitor and you get great info on the target chip and it is FAST.
You are probably right. I did have some spanking new "Pico" chips that did not bootload to Aduino as ISP hooked up as SPI but did bootload with a ZIF Programmer shield. So far, every test on the Gammon Programmer works perfectly
(well, there was one that that got bootloaded on 5 different programmers varying from Lilypad to Uno, it locked up).
Anyhow, if this fails, we can use Gammons fuse reader to nail it, unless jozzy can positively ID the markings.
There are a couple of "flavors" for the Atmega328. The one that comes with the Uno R3 is the Atmega328P-PU which means this chip passed the low current operational testing at Atmel (Pico Power). If it does not pass this test it does not receive it's "P" badge and is just a Atmega328-PU. The problem is, it also receives a different chip ID and that causes the programmers to not program the chip. If you put an entry into the boards.txt file for the Atmega328-PU then it should bootload.
spcomputing:
There are a couple of "flavors" for the Atmega328. The one that comes with the Uno R3 is the Atmega328P-PU which means this chip passed the low current operational testing at Atmel (Pico Power). If it does not pass this test it does not receive it's "P" badge and is just a Atmega328-PU. The problem is, it also receives a different chip ID and that causes the programmers to not program the chip. If you put an entry into the boards.txt file for the Atmega328-PU then it should bootload.
But still I can't manage to bootload my empty atmega328-PU without any error.
My setup:
I have an empty atmega328-PU on a breadboard with some wires coming from my arduino mega 2560.
I have a 100 nano capacitor between +5v and the reset on my mega(which I only use after uploading).
I have also tried to use a 16mhz crystal with 2x 20pico(both wired on ground).
And I have tried to put a 10k resistor between the reset and +5v
I think I've missed something crucial but I just can't find the problem.