Pages: [1]   Go Down
Author Topic: Trouble understanding physical pin numbers vs pin names  (Read 79 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I'm very new and I can't find a good explanation for understanding the relationship between physical pin numbers and actual pin names.

For example, I'm looking at a Leonardo schematic, physical pin 32 shows its pin modes as "(ICP3/CLK0/OC4A)PC7" with a given pin name of "IO13*". I can't for the life of me figure out why calling that pin "IO13*" makes any sense and where that correlation is made. It confuses me to see something like pinMode(13,OUTPUT); that's referring to IO13* not the actual 13th pin.

Furthermore, lets say I want to use physical pin 9, named "SCLK" in the Leonardo schematic, as a digital output. I'm not sure how to relate pin 9 to being a digital IO so I can pass it into the function pinMode();

Thank you for any help!

Here's a link to the Leonardo schematic for reference.
http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf
« Last Edit: June 09, 2014, 07:22:07 pm by makethings » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26344
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Look at pins_arduino.h for the mapping from port to software name.
There are 3 arrays that really define stuff - the first list the order of the ports, the 2nd lists the bits within that port.
Then there is the datasheet that maps the port/bit to a physical pin.

There are also several good guides/pictures that show the mapping, as well as the chart linked to on the Products/Leonardo page
http://arduino.cc/en/Hacking/PinMapping32u4
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

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

Thank you! This is exactly what I was looking for.
Logged

Pages: [1]   Go Up
Jump to: