I can not upload Arduino Hex file to stand alone ATmega128 and ATmega2560


I am working on 2 projects based on Atmega2560 and ATmega128.

I have a hex file of Arduino Programs. I am trying to upload the code via ISP programmer. Please note that I am not using ARDUINO AS ISP PROGRAMMER. I am using ordinary ISP programmer with the AVRDUDE GUI.

I have tried to load other hex file created in Atmel Studio. That could be downloaded successfully but hex file of Arduino file can not be loaded in both the controllers.

Can anyone help me to solve this problem.

I thought to upload code using ARDUINO UNO. I have an idea that I will load the bootloader program of both the controller using ISP programmer that I am using. Then I will take UNO board and will remove the controller from UNO board. Then I will make ISP connections with the stand alone controller via Arduino IDE.

Will it work?

IF yes, then I need Bootloader programs. Can any one provide the bootloader programs of ATmega2560 and ATmega128 in .ino and .hex file?

I have tried a lot on internet to find but I could not. So please I request you to provide the hex file and .ino file for both the controllers.

Please help me to solve both the problems.


Programs written using Arduino IDE have to be compiled for Atmega2560 and ATmega128, otherwise they will not work. You can not simply use a hex file that works on Atmega328p and expect it to also run on any Atmega.