Arduino pins

Atemega 168 and 328 processors used on Arduino board have 3 ports: B, C and D. Ports B and D have 8 lines each, port B has 7 lines. Official names of lines look like PB4 (meaning line number 4 in port B). On Arduino boards PB6 and PB7 are connected to crystal oscillator and PC6 is configured as reset line. Consequently PB6, PB7 and PC6 can not be used for other purpose.

To simplify use Arduino environment refers to pins via numbers starting from 0. Additionally Arduino environment divides pins into digital ones and analog ones. There are 14 digital pins and 6 or 8 (depending on exact version of Arduino board) analog pins. However, one can use the first 6 analog pins as digital pins, the corresponding number is 14 plus "analog number" of the pin. Correspondence between Arduino numeration and ports is given by the following diagram:

 ATMEL ATMEGA8, 168 and 328 / ARDUINO

                  +-\/-+
            PC6  1|    |28  PC5 (AI 5)
      (D 0) PD0  2|    |27  PC4 (AI 4)
      (D 1) PD1  3|    |26  PC3 (AI 3)
      (D 2) PD2  4|    |25  PC2 (AI 2)
 PWM+ (D 3) PD3  5|    |24  PC1 (AI 1)
      (D 4) PD4  6|    |23  PC0 (AI 0)
            VCC  7|    |22  GND
            GND  8|    |21  AREF
            PB6  9|    |20  AVCC
            PB7 10|    |19  PB5 (D 13)
 PWM+ (D 5) PD5 11|    |18  PB4 (D 12)
 PWM+ (D 6) PD6 12|    |17  PB3 (D 11) PWM
      (D 7) PD7 13|    |16  PB2 (D 10) PWM
      (D 8) PB0 14|    |15  PB1 (D 9) PWM
                  +----+

MSP430 Launchpad pins

The MSP430 processors used in MSP430 Launchpad logically have 3 ports P1, P2 and P3, each 8 bits wide. However, in 20 pin chips port P3 is not connected to outside world, so only usable ports are P1 and P2. On MSP430 Launchpad boards pins are numbered consecutively in counterclockwise direction. The same numbers are used in Energia environment. Correspondence between ports and pin numbers is given by the following diagram:
                      +-\/-+
               VCC   1|    |20  GND
         (A0)  P1.0  2|    |19  XIN
   (RX)  (A1)  P1.1  3|    |18  XOUT
   (TX)  (A2)  P1.2  4|    |17  TEST
         (A3)  P1.3  5|    |16  RST#
         (A4)  P1.4  6|    |15  P1.7  (A7) (SCL) (MISO)
         (A5)  P1.5  7|    |14  P1.6  (A6) (SDA) (MOSI)
               P2.0  8|    |13  P2.5
               P2.1  9|    |12  P2.4
               P2.2 10|    |11  P2.3
The TEST and RST pins are used by debugging interface so normally can not be used for other purpose. However, if there is no need for debugging, then both can be used as normal outputs. There are two LED-s and a two buttons on board attached as follows:
P1.0       red LED
P1.6       green LED
P1.3       button S2
RST        button S1 (RESET)
One can disconnect each of LED-s removing appropriate jumper.

Stellaris Launchpad pins

Processor in Stellaris Launchpad has 6 GPIO ports: A, B, C, D, E, F. All GPIO pins, except for PB0 and PB1 are 5V tolerant. Logically each port has 8 I/O lines. However, only 6 lines of port E and 5 lines of port F are present, which together gives 43 I/O lines. Connector in Stellaris Launchpad simply uses pins names and the names may be used in Energia environment so there is no need to translate between numbers and names. Note, there is a misprint: line PE0 is marked as P30. Some I/O lines are not available on the on-board connector: line PA0 and PA1 are connected to serial port in debugging part, PC0, PC1, PC2 and PC3 are used by debugging interface, PD4 and PD5 are used by USB interface. Some lines on the on-board connector are connected to devices included on board:
  line          Energia      function
                 number
   PF4            31            SW1
   PF0            17            SW2
   PF1            30          RGB LED (Red)
   PF2            40          RGB LED (Blue)
   PF3            39          RGD LED (Green)
Also line PB6 is connected to PD0, and PB7 is connected to PD1. Line PD7 is connected to +5V from USB connector via a 10 kOhm resistor (in order to detect voltage on USB). This means that it is hard to use PD7 for other purpose. More information, in particular list of analog pins.

Maple mini and STM32F1 minimal board pins

STM32F103CBT6 and STM32F103C8T6 processors have four input-output ports: A, B, C and D. Port D have only 2 lines and in our boards they are used by crystal oscillator, so we can not use this port and may ignore it. Port C has only 3 lines: PC13, PC14 and PC15. Port A and B have 16 lines each. Pins PA0 to PA7, PB0 and PB1 can work as 12-bit analog input. Pins PA8 to PA15, PB2 to PB4 and PB6 to PB15 are 5V tolerant.
                USB connector
              Vcc          Vcc
              GND          GND
         PB8  but          Vbat
         PB7   15          14   PC13
         PB6   16          13   PC14
         PB5   17          12   PC15
         PB4   18          reset
         PB3   19          11   PA0
         PA15  20          10   PA1
         PA14  21          9    PA2
         PA13  22          8    PA3
         PA12  23          7    PA4
         PA11  24          6    PA5
         PA10  25          5    PA6
         PA9   26          4    PA7
         PA8   27          3    PB0
         PB15  28          2    PB2
         PB14  29          1    PB10
         PB13  30          0    PB11
         PB12  31          Vin
Pin PB1 has number 33 and is connected to the on-board LED, but has no other connection. Pin PB9 is used to reset USB connection.

Minimal STM32F103C8T6 boards are similar to Maple Mini. However, instead of numbers they use line names. Also they have 32 kHz crystal connected to lines PC14 and PC15. Lines PA13 and PA14 (SWDIO and SWDCLK) are connected to debug connector. The LED on board is connected to line PC13 (to turn on the LED the output must be LOW!). Pin PB2 is connected via 100 kOhm resistor to a jumper. Unlike Maple Mini there is no user button (except for two biggest boards).

In fact, we have three different kinds of minimal STM32F103C8T6 boards. The smallest have four pin debugging connector. The other have 20 pin ARM JTAG connector. Middle one have double row pin headeres on both sides. The biggest have extra user button connected to PA0 and 24C01 eeprom connected to I2C1 (SCL do PB6, SDA do PB7).

ST-Link

Green ST-Link interface support JTAG, SWD and SWIM. Pink one supports SWD and SWIM. We need SWD (JTAG has more capabilities, but uses more pins, SWIM is for STM8 processors). Pink ST-Link has pinout written on the case. Green ST-Link has the following pinout:
             ----
NRST      1 |    |  2  3.3V
5V        3 |    |  4  TCK (SWCLK)
SWIM      5      |  6  TMS (SWDIO)
GND       7 |    |  8  JTDI
SWIM  RST 9 |    | 10  JTDO
             ----
Note: Gap in the frame above corresponds to gap in physical connector.

ARM JTAG connector

Bigger minimal STM32F103C8T6 boards contain 20-pin ARM debugging connector with the following pinout:

                ----
       VREF  1 |    |  2 VSUPPLY
      nTRST  3 |    |  4 GND
        TDI  5 |    |  6 GND
(SWDIO) TMS  7 |    |  8 GND
(SWCLK) TCK  9      | 10 GND
       RTCK 11      | 12 GND
        TDO 13 |    | 14 GND
       nRST 15 |    | 16 GND
      DBGRQ 17 |    | 18 GND
     DGBACK 19 |    | 20 GND
                ----
Note: Gap in the frame above corresponds to gap in physical connector.