ATMEGA 2560 Bootloaders

1.> I developed the board using ATMEGA2560, Currently iam doing burning the boot loader thru ARDUINO UNO ICSP header. Iam not sure the boot loader is correct. can you give me correct boot loaders for atmega2560, so that i can upload the arduino sketches to my board and test the board

2.>please suggest using ICSP i can upload arduino test sketches?

3.>Please find below code, i written the test code for measuring the voltage across GPIO pins. whether GPIO's are enabled or not. please suggest if anything need to add in the code.

int Pin1 = 73; int Pin2 = 74; int Pin3 = 75; int Pin4 = 76; int Pin5 = 77; int Pin6 = 78; int Pin7 = 63; int Pin8 = 64; int Pin9 = 65; int Pin10 = 66; int Pin11 = 67; int Pin12 = 68; void setup() { pinMode(Pin1, OUTPUT); pinMode(Pin2, OUTPUT); pinMode(Pin3, OUTPUT); pinMode(Pin4, OUTPUT); pinMode(Pin5, OUTPUT); pinMode(Pin6, OUTPUT); pinMode(Pin7, OUTPUT); pinMode(Pin8, OUTPUT); pinMode(Pin9, OUTPUT); pinMode(Pin10, OUTPUT); pinMode(Pin11, OUTPUT); pinMode(Pin12, OUTPUT);

}

void loop() { digitalWrite(Pin1, HIGH); // GPIO sets the on digitalWrite(Pin2, HIGH); digitalWrite(Pin3, HIGH); digitalWrite(Pin4, HIGH); digitalWrite(Pin5, HIGH); digitalWrite(Pin6, HIGH); digitalWrite(Pin7, HIGH); digitalWrite(Pin8, HIGH); digitalWrite(Pin9, HIGH); digitalWrite(Pin10, HIGH); digitalWrite(Pin11, HIGH); digitalWrite(Pin12, HIGH); }

Hi, welcome to the forum.

1 ) When you have a programmer, and use Arduino IDE 1.6.1 (the newest version) and select the board and programmer, and use "burn bootloader" from the menu, the bootloader is written and the right fuses are set. The correct bootloader is included with the Arduino IDE.

2 ) I use a USBasp Version 2 with a flat cable and a 10-pin to 6-pin adapter. But many others use Arduino Uno as programmer (ArduinoISP).

3 ) This is the page for the Arduino Mega 2560 board : http://arduino.cc/en/Main/ArduinoBoardMega2560 As you can see, the highest pin number is 53. The pins in your code from 63 to 78 do not exist (perhaps the value up to 69 is translated into an analog pin).

Those USBasp and ArduinoISP only can support 128K bytes (or 64K word) Flash. They do not correctly program a mega2560.

You will need to use an ISP programmer that supports stk500v2 protocol, like the AVRispMKII programmer.

They don’t ? What about only the bootloader ? I did burn the newest bootloader into my Mega 2560 with USBasp.

Okay, the USBasp does seem to correctly write the bootloader. But I recall there was some issues before with memory addressing with larger than 128K flash.

Update: It (USBasp) does seem to program the bootloader to the m2560, however it is kind of a kludge. It won't work correctly for programming sketches directly. I think the USBasp support in avrdude has a 128K buffer, so it appears to be mapping the lower 128K on to the upper 128K when writing. This is why it gives a verification error. And when reading flash, it returns the upper 128K mirrored to the lower 128K.

To add the USBtiny progrmmers also does not correctly support the m2560.