Pages: [1]   Go Down
Author Topic: Port Registers for the Mega 328  (Read 1168 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.arduino.cc/en/Reference/PortManipulation

This is the webpage for the port information on the 168 and there are links to the 328, but there is no information there. Can anyone tell me the reserved port names and pin designations for the Mega 328?
Logged

You laugh I laugh
You cry I cry
You fall off a bridge I laugh so hard I fall off with you

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 4323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

They should be exactly the same as it says on the page you referenced.

Don
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But the 328 has 53 digital pins and the 168 only has 13 digital pins, what are the port Registers for the rest of the 40 pins?
Logged

You laugh I laugh
You cry I cry
You fall off a bridge I laugh so hard I fall off with you

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 127
Posts: 8517
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But the 328 has 53 digital pins
Oh no it doesn't, you're thinking of the ATmega2560 family. The 168 and 328 are exactly the same pinout wise.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 4323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your nomenclature is slightly twisted which lead to the confusion.   The early Arduino Duemilanove was initially shipped with an Atmel ATmega168 processor.  Later versions of the Duemilanove were shipped with the Atmel ATmega328 processor as is the Uno.  The early Arduino Mega was shipped with the Atmel ATmega1280 processor.  The current version is called the Mega2560 and it ships with the Atmel ATmega2560 processor.

Since there has never been an Arduino Mega 328 board I had no idea that you were referring to an Arduino Mega board and I assumed you were referring to an Atmel Mega328.

Now to answer your question or more specifically to tell you how to get the answer to your question.  You will have to look at the schematic and work your way from the Arduino pin numbers that are scattered around the diagram back to the chip itself and then look for the Atmel pin names.  For example on the Arduino Mega2560 diagram you will find a block labeled ADCL near the lower right corner of the processor.  These seem to be the A0 - A7 pins in Arduino terminology and they connect to the PF0 - PF7 pins in Atmel terminology.  You would access them as PORTF, PINF and DDRF.  Similarly A8 - A15 go to PK0 - PK7 and they would be accessed with PORTK, PINK and DDRK.  The preceding information is not guaranteed, some corroboration from others would be appreciated.  Note that I picked the easy ones, some of the ports appear to be really scrambled with respect to the Arduino nomenclature.


Don
Logged

Florida
Offline Offline
Sr. Member
****
Karma: 4
Posts: 431
hookedup!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I found this link helpful ..
https://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0

From this forum entry
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1245229578

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am so embarrassed! Yes, it is the 2560 I was speaking about. I just gonna go sit in the corner now and look at schematics. Thanks floresta & marker.
Logged

You laugh I laugh
You cry I cry
You fall off a bridge I laugh so hard I fall off with you

Pages: [1]   Go Up
Jump to: