Step 6: Pin outs
Digital pins:
Digital pin 1: Port A, Bit 0 = PA0
Digital pin 2: Port A, Bit 1 = PA1
...
Digital pin 8: Port A, Bit 7 = PA7
Digital pin 9: Port B, Bit 0 = PB0
Digital pin 10: Port B, Bit 1 = PB1
etc. etc. etc.
Analog pins:
The analog pins are defined like the above, but the ADC pin with the first register (after the alphabet; Port A is before Port B etc.) what has ADC and the first bit (bit 0) is analog pin 0, the ADC pin with the first register what has ADC and the second bit of that register is analog pin 1.
etc. etc.
PWM pins:
PWM pins have the same pin numbers as normal digital pins. To see witch digital pins are PWM enabled, look at the pin out in the datasheet. At some pins, there will stand "OC#@" There the # is a number and the @ is a letter. The @ is not always present. So on every pin there is stand OC + a number + a letter (not always) has hardware PWM.
Serial pins:
Serial pins are defined as RXD and TXD. Some times there are multiply hardware Serial lines. If this is present, TXD and RXD are Serial, TXD1 and RXD1 are Serial1 etc. etc.
Other pins:
To see that pins have I,,2,,C, SPI etc. look at the datasheet and search for the corresponding pins (I,,2,,C: SDA and SCL etc.)
Interrupts:
The interrupt pins are labeled with INT#, there # is the number of the interrupt.
If anything is unclear, post a comment.
Remove these ads by
Signing Up







































Visit Our Store »
Go Pro Today »




A great job for a 14 Year old boy!
themroc
I wish to add another board for ATmega32 with std pin mapping as shown in this instructable. How can do that? Do I just have to add another board profile in "boards.txt" or do I also need to add a pin mapping file in the core folder?
That would be a lot of work, and I don't feel like explaining it.
Jan
Well, I am not able to compile servo program for Atmega16. Do you know how to solve it? It gives me the following errors
..\arduino-0022\libraries\Servo\Servo.cpp: In function 'void initISR(timer16_Sequence_t)':
..\arduino-0022\libraries\Servo\Servo.cpp:159: error: 'TIFR1' was not declared in this scope
..\arduino-0022\libraries\Servo\Servo.cpp:160: error: 'TIMSK1' was not declared in this scope
I would recommend a google search. I'm sure you will find something.