Pages: [1]   Go Down
Author Topic: Converting code from 328p to 2560  (Read 315 times)
0 Members and 1 Guest are viewing this topic.
Centurion RSA
Offline Offline
Full Member
***
Karma: 0
Posts: 166
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am converting some complex code written for the ATmega328p to a ATmega2560. Other than the register names for the first serial port,are there other changes that should be considered for the same pins and IO. So if a shield worked on the Duemilanove, will it work the same on the Mega. Keep in mind that the code does not make use of the Arduino framework, just the boards.

Do the port definitions coincide etc? Any suggestions welcome :-)
Logged

Rather people think you to be a fool than you open your mouth and confirm it.

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Compare the schematics of both and you'll see that none of the "arduino pins" map to the same ports or bits of a port on the 328 and 2560.

e.g.
pin 13:  PB5 vs PB7
pin  8:   PB0 vs PH5
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Centurion RSA
Offline Offline
Full Member
***
Karma: 0
Posts: 166
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks James, I did not think of going to the schematics, but it makes sense. Thanks man.
Logged

Rather people think you to be a fool than you open your mouth and confirm it.

Pages: [1]   Go Up
Jump to: