Go Down

Topic: Converting code from 328p to 2560 (Read 339 times) previous topic - next topic

Marius

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 :-)
Rather people think you to be a fool than you open your mouth and confirm it.

James C4S

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
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Marius

Thanks James, I did not think of going to the schematics, but it makes sense. Thanks man.
Rather people think you to be a fool than you open your mouth and confirm it.

Go Up