I have successfully programmed standalone ATmega328p using arduino uno by adding following lines in the boards.txt file:
atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)
The bootloader worked and I was able to run blink example successfully on a standalone atmega328p.
Now, I am trying to upload a blink example to the standalone atmega2560. I selected the board as ATmega 2560 from the tools menu (in built board ATmega 2560) and run the bootloader. (I didn't make any chages for atmega2560 in boards.txt file) The bootloader worked and the code was uploaded to the ATmega2560 successfully.
But the problem is that the blink example is not working fine. The LED on pin 26 on a standalone board turns ON for a very short period then turns OFF for a very short period and then again turns ON for a short period and finally turns OFF for 1 sec (this cycle is repeated). But everyone knows, the blink code turns ON led then provides a delay of 1sec and then turns off for a sec and this cycle is repeated. The blink code is not working as it should work on my atmega2560(standalone).
I tested the same thing using a TIMER1. I wrote a code to blink LED after every 0.03sec. And this works fine in standlone ATmega328p but not works in Standalone ATmega2560.
What would be the problem?
Do I need to add some lines for standalone ATmega2560 in the boards.txt file?
I connected all VCC pins GND pins and crystal including the filter capacitor and resistor as shown in the fig. http://atmega32-avr.com/wp-content/uploads/2012/06/arduino_mega_2560_schematic.gif
Then connected the reset pin to 5v through a 10k resistor.
Arduino Uno pin 10 to reset pin of standalone ATmega2560
Arduino Uno pin MISO to pin MISO of standalone ATmega2560
Arduino Uno pin MOSI to pin MOSI of standalone ATmega2560
Arduino Uno pin SCK to pin SCK of standalone ATmega2560