Go Down

Topic: Problem with standalone atmega2560 (Read 208 times) previous topic - next topic

sohaibpannu

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.
Code: [Select]

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:( 

sohaibpannu

I have attached my schematic diagram. My reset pin, all VCC/AVCC and GND pins are connected to uno board's reset, 5V and GND pin. Another problem I noticed is that my code hangs up after a few minutes.


BJHenry

Don't post a zip file- most people aren't going to be willing to open something from a stranger on an internet forum.

sohaibpannu

Here is the .jpg picture

sohaibpannu

The problem of code delay and code hangup has been solved. I had attached my reset pin of atmega2560 to reset pin of uno board. When I externally pulled up my reset pin of atmega2560 it worked fine. The serial garbage also got eliminated. Which is quite weird because I had removed my atmega328 from uno board still my reset pin was not being pulled up.
Now only problem I'm facing is that the serial garbage kicks in after a few minutes. Then disappears and everything continues to work fine until garbage appears again. I added bypass capacitors also but that didn't make any difference. Any tips about this please?

Go Up