Raspberry Pi GPIO Expansion - Low Level Peripherals

Version 4

    Introduction

     

    The Raspberry Pi allows peripherals and expansion boards to access the CPU by exposing the in and outputs. The production board has a 26-pin 2.54mm (100mil) expansion header, arranged in a 2x13 strip. They provide 8 GPIO pins plus access to I2C, SPI, UART), as well as +3V3, +5V and GND supply lines. Pin one is column 0 on the bottom row. Voltage levels are 3v3. There is no over-voltage protection on the board - the intention is that people interested in serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.


    It is also possible to reconfigure some of the pins to provide a second I2C interface.
    Kernel boot messages go to the UART at 115200bps.


    Header Pinout:

    Top Row

    5V0

    DNC

    GND

    TXD

    RXD

    GPIO1

    DNC

    GPIO4

    GPIO5

    DNC

    GPIO6

    SPI_CE0_N

    SPI_CE1_N

    Bottom Row

    3V3

    SDA0

    SCL0

    GPIO7

    DNC

    GPIO0

    GPIO2

    GPIO3

    DNC

    SPI_MOSI

    SPI_MISO

    SPI_SCLK

    DNC

     

    Colour legend

    +5V

    +3.3V

    Do not connect

    UART

    GPIO

    SPI

    I2C

     

    Power Pins

    Maximum permitted current draw from the 3v3 pin is 50mA.

    Maximum permitted current draw from the 5v pin is the USB input current (usually 1A) minus any current draw from the rest of the board.

    • Model A: 1000mA - 500mA -> max power draw: 500mA
    • Model B: 1000mA - 700mA -> max power draw: 300mA

     

    General Purpose Input/Output (GPIO)

    General Purpose Input/Output (GPIO) is a generic pin on a chip whose behaviour (including whether it is an input or output pin) can be controlled (programmed) through software. All the UART, SPI and I2C pins can be reconfigured as GPIO pins, to provide a total of 17 GPIO pins. Each of their functions is detailed in the Broadcom BCM2835 chipset datasheet.


    The available alternative functions and their corresponding pins are detailed below. These numbers are in reference to the chipset documentation and may not match the numbers exposed in linux or detailed above. Only fully usable functions are detailed, for some alternative functions not all the necessary pins are available for the functionality to be actually used. All exposed pins can be used for GPIO

     

    Top Row Pinout:

    Header

    2

    4

    6

    8

    10

    12

    14

    16

    18

    20

    22

    24

    26

    Chipset

    14

    15

    18

    23

    24

    25

    8

    7


    Function

    5V0

    DNC

    GND

    TXD

    RXD

    PWM

    DNC

    GPIO

    GPIO

    DNC

    GPIO

    SPI_CE0_N

    SPI_CE1_N

     

    Bottom Row Pinout:

    Header

    1

    3

    5

    7

    9

    11

    13

    15

    17

    19

    21

    23

    25

    Chipset

    0

    1

    4

    17

    21

    22

    10

    9

    11

    Function

    3V3

    SDA0

    SCL0

    GPIO

    DNC

    GPIO

    GPIO

    GPIO

    DNC

    SPI_MOSI

    SPI_MISO

    SPI_SCLK

    DNC

     

    The complete list of chipset pins which are available are:

    0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25

     

    • Pin 12 supports PWM.
    • GPIO voltage level is 3V3 and are not 5V tolerant.
    • Each GPIO can interrupt, high/low/rise/fall/change.

    It is also possible to reconfigure some of the pins to provide an ARM JTAG interface. However ARM_TMS isn't available for this (chipset pin 12 or 27 is needed).

    It is also possible to reconfigure some of the pins to provide an I2S (hardware mod may be required) or PCM interface.

     

    MIPI CSI-2

    The MIPI CSI-2 interface to a 15-way flat flex connector is Sony sub-LVDS.

     

    DSI

    The DSI interface to a 15-way flat flex connector.


    CEC

    HDMI-CEC (Consumer Electronics Control for HDMI) is supported by hardware but some driver work will be needed and currently isn't exposed into Linux userland.