The printing on the Gertboard indicated the port and pin numbers internal to the Atmega microcontroller… However this is normally hidden from the user by the Arduino’s “wiring” library and rather than refer to (e.g.) Port B, bit 5, you’d normally refer to “pin 15”.
The mapping is fairly straightforward, but to help you connect wires to pins on the Gertboard, here is a handy table to let you see what the connections are:
Gertboard ATmega Port/Pin |
Ardino Wiring Pin |
Notes |
---|---|---|
PB5 | 13 | (LED) |
PB4 | 12 | |
PB3 | 11 | PWM |
PB2 | 10 | PWM |
PB1 | 9 | PWM |
PB0 | 8 | |
PD7 | 7 | |
PD6 | 6 | PWM |
PD5 | 5 | PWM |
PD4 | 4 | |
PD3 | 3 | PWM |
PD2 | 2 | |
PD1 | 1 | TxD |
PD0 | 0 | RxD |
PC5 | Analog In 5 | SCL |
PC4 | Analog In 4 | SDA |
PC3 | Analog In 3 | |
PC2 | Analog In 2 | |
PC1 | Analog in 1 | |
PC0 | Analog In 0 |
Note that Pin 13 is hardwired to a small LED on Arduino Duemilanove and newer boards – it’s not connected to anything on the Gertboard.
Pins missing that you may expect to find on an Arduino are the positive and ground power connections and the analog reference voltage. This is tied to 3.3v in the ATmega on the Gertboard, so you must make sure that you take this into account when using the analog inputs. ie. you must call:
analogReference (DEFAULT) ;
when using analog inputs. Also, remember that to read a voltage, the calculation is
volts = analogReading * 3.3 / 1023.0
as the reference voltage is 3.3v.