I am using a tqfp100 breakout board with atmega2560 chip. I uploaded the bootloader using an arduino uno. Then I removed the atmega328 from my arduino uno board. Then I attached all VCC/AVCC and GND pins together on uno board also the reset pin. I inserted RX and TX pins of atmega2560 to the RX and TX header of arduino uno. Then uploaded the following sketch successfully. I have also attached 16MHz crystal and two 22pF capacitors with it.
void setup()
{
pinMode(50, OUTPUT);
Serial.begin(9600);
}
void loop()
{
digitalWrite(50, HIGH);
delay(100);
digitalWrite(50, LOW);
delay(100);
Serial.println("led low");
//Serial.flush();
}
I only see corrupted data on serial monitor. But if I add the line Serial.flush() then I see "led low" on serial monitor but that adds more delay to the code. I also noticed that the code runs after a around 10 seconds when atmega2560 is powered up from my uno board. Somebody please help me:(