New Arduino Mega 2560

Hey,
This MIGHT sound like a stupid Question. But i just need to be 100% clear.

I have worked quiet a while on the Arduino UNO R3. And now I have a code that runs with the LCD TFT screen. But i'm falling short of I/O pins for running multiple outputs.

So I got an Arduino Mega2560.

My Q is, other than the increased number of I/O and Analog pins, and increased flash memory and UARTs etc.

Is there a difference in programming the MEGA?

I mean other than simple changes like pin numbers etc for output and input, is there a lot more complex changes I need to do while programming the Mega2560?

Can I just burn my UNO code into the Mega2650 and change I/O pin numbers? Will it run?

Shantanu24:
Can I just burn my UNO code into the Mega2650 and change I/O pin numbers? Will it run?

Yes. And generally you can use the same pin numbers as well.
There's nothing special needed in coding for a Mega2560. Just more of everything.

You will need to recompile for the correct board, I guess.

Just be careful if you use the servo library

on a UNO its driven from Timer1 which affects PWM on pin 9 and 10

on a MEGA it is using timer5 and thus loosing PWM on pins 44,45 and 46 (if you have less than 12 servo)

So don't assume if you use a servo and had nothing connected on pin 9 and 10 on a UNO that you can safely do PWM on pins 44,45 and 46.

Also the SPI pins are on different pins (labeled as such usually)

sterretje:
You will need to recompile for the correct board, I guess.

It's pretty hard to upload without compiling. :smiley:

OldSteve:
Yes. And generally you can use the same pin numbers as well.
There's nothing special needed in coding for a Mega2560. Just more of everything.

Thank you man! Heaved a sigh of relief!! Thank you again!

OldSteve:
It's pretty hard to upload without compiling. :smiley:

How disappointing; I thought that you could dream all avrdude options and ran it from the command line :smiley:

OldSteve:
It's pretty hard to upload without compiling.

sterretje:
How disappointing; I thought that you could dream all avrdude options and ran it from the command line :smiley:

I just meant using the 'Upload' button. (I was really just messing around anyway. :slight_smile: )

Coat tailing this discussion, I just purchased a Mega2560 Pro Mini and, so far, things seem to work between the two boards without modification. The Pro Mini is considerably smaller, as can be seen in the photo:

econjack:
I just purchased a Mega2560 Pro Mini

I didn't know there was such an animal. Looks good. I might have to get myself a couple.
Thanks for pointing them out.