finding out the software names of hardware pins

Hi all,

I have an AT90CAN128 chip which i have found a bootloader for so i can run arduino sketches on it, but what i want to know is how to work out what the pins are called in software.

so for example there is an LED attached to physical pin 6, through trial and error i found that loading the blink sketch and referring to the LED pin as 36 worked.

i want to access the SPI port on the chip and need to know what the IDE is expecting as far as pin numbering goes and how they relate to the actual hardware.

i assume this must be pretty easy, there must be some sort of list for each chip that the IDE reads when you select a board type, but i am not sure how to find this out.

thanks for the help

Consult the data sheet for the AT90CAN128. The port names and individual pin functions are the key and they are all discussed in great detail in the data sheet. For example, the SPI port is PORTB in both the AT90CAN128 and ATmega328p, but the pins used are different. As for LEDs, that would depend on how the board is wired.

See pins_arduino.h in the core you're using - or maybe pins_arduino.c (varies between cores). It may be in a variants folder, or it may be just one, with lots of ifdefs. Find the section corresponding to your chip, and you can see how they do it; that's where the pin mapping is done. It's customary to include ASCII art showing which pins are which, as well.

thanks for the help guys, the information i was looking for was indeed in pins_arduino.h

thanks again!