Go Down

Topic: Problem with bootloader (Read 637 times) previous topic - next topic

wilykat

Feb 11, 2016, 01:26 am Last Edit: Feb 11, 2016, 01:29 am by wilykat
I have a bunch of new blank ATMega328 and I wanted to put the bootloader on them. Initially my Uno was somewhere else and Mega was next to my computer so I used that.

Loaded sketch ArduinoISP and it loaded fine. Changed the board from Mega2560 to Uno, set up the proto shield I made long ago to program blank, then selected burn bootloader.

Code: [Select]
Arduino: 1.6.7 (Windows 10), Board: "Arduino/Genuino Uno"

avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

Error while burning bootloader.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.


I went and got my Uno, put ArduinoISP on it and moved the shield to my Uno and tried again, it burned fine.

Is there something about Mega2560 that won't burn a smaller, simplier cousin chip? Or do I need to match the host chip with the blank chip? ie 328 with 328, Mega with Mega, etc.

QUICK EDIT: or maybe there's different wiring? Uno shield has digital pin 11, 12, and 13 connected as ISP to the socket.

My burner shield:

Red is power, usually on many shields. Orange blinks when programming, yellow is steady when there's problem, and green is ready and slowly blinking.  It has already burned some 50 chips so I saved a lot over buying chips with bootloader installed.

pert

QUICK EDIT: or maybe there's different wiring? Uno shield has digital pin 11, 12, and 13 connected as ISP to the socket.
Yes, the mega has the SPI on 51, 50, and 52 instead see the table at https://www.arduino.cc/en/Reference/SPI. If you make your shields use the ICSP header then they will work for Uno or Mega, etc because that header is has the same pinout and location for both.

wilykat

Bah. The shield has ICSP header but only 3 pins are connected on PCB. I guess the other 3 pins aren't factory connected on the proto PCB to ensure the board won't break certain Arduino due to difference in wiring.

A little rewiring and it should be universal.

pert

The shield has ICSP header but only 3 pins are connected on PCB.
Check the ICSP header pinout on the SPI page I linked above, maybe the 3 pins you need are the ones that are connected on the prototype shield.

pert

#4
Feb 11, 2016, 02:34 am Last Edit: Feb 11, 2016, 02:39 am by pert Reason: Specify the IDE version that this feature was introduced.
I just remembered that the ArduinoISP sketch(as of Arduino IDE 1.6.6) allows you to use the pins 11, 12, 13 even when they are not the hardware SPI pins. So you just need to edit the sketch and your shield should work with the Mega with your current wiring.

wilykat

Checked my code that came with 1.6.7 and it's pretty much the same. I could force it to use 11, 12, and 13 instead of hardware ICSP but I may forget when I update Arduino and it replaces example sketches. I'd be safer rewiring my board to use ICSP header.

Go Up