Go Down

Topic: Pinout for Port Registers on Arduino Mega?? (Read 68035 times) previous topic - next topic

Christopher Baker

Jun 17, 2009, 11:06 am Last Edit: Jun 17, 2009, 11:07 am by bakercp Reason: 1
Hi there,

My Arduino program uses port registers extensively (PORTB, PORTD, etc).  Currently, I am merging the work of several Arduino Diecimilas onto one Arduino Mega but I can't find any conclusive information about how the Mega Pinout corresponds to the higher port registers (PORTE, PORTF, etc).  I see the port registers referenced on the 1280 data sheet and in the Arduino AVR code libraries, but could use some assistance.

Would someone please point me in the right direction?

Thank you!
Christopher Baker


I posted a spreadsheet here that may help: http://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0


Unfortunately, I don't think anyoyone has made a pin mapping diagram for the mega yet.

Check the mega schematic for the ATmega1280.

For example, look at the top right corner of the 1280:  You'll see a group of 8 pins, ATmega pins 71 through 78.  These are labeled PAn, where n is 0 to 7.  These are the individual pins of PORTA, along with their corresponding signals (conveniently labeled PAn as well).  Now look to the right a bit at JP1, and you'll find these signals again.  The green text tells me these are arduino pins 22 through 29.



Unfortunately, I don't think anyoyone has made a pin mapping diagram for the mega yet.

... and while I'm typing those words, mem posts one. :)



Christopher Baker


I know this is old topic. But having some problem with library that use PORTX registers. So shield that use the library work on Duemilanove and Uno but does not work with Arduino Mega2560 board.

The Shield make use of pin (digital I/O) 2,3,4,5,6 & 7.

I have applied above mapping (change code in the library) which still does not work.

One simple question. Is the port register mapping for ATMega1280 applies to ATMega2560? If not then it explain why still does not works!


Go Up