# BPI-M2 Berry GPIO Pin define

**BPI-M2 Berry have 40 PIN GPIO as raspberry pi.**

![](https://4206255271-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2HWtRGSle2JoRWmwsz%2F-M2HWva6YC36keljqeN9%2F-M2HXODCyD7uxQAslf6K%2Fgpio%20pic.jpg?generation=1584080214545679\&alt=media)

Banana Pi has a 40-pin GPIO header that matches that of the Model B+ Raspberry Pi. Following is the Banana Pi GPIO Pinout:

|          | GPIO Pin Name | Default Function | Function2：GPIO | Function3  |
| -------- | ------------- | ---------------- | -------------- | ---------- |
|          |               | CON1-P01         | VCC-3V3        |            |
|          |               | CON1-P02         | DCIN           |            |
|          | CON1-P03      | TWI2-SDA         | PB21           | PWM5       |
|          |               | CON1-P04         | DCIN           |            |
|          | CON1-P05      | TWI2-SCK         | PB20           | PWM4       |
|          |               | CON1-P06         | GND            |            |
|          | CON1-P07      | PB3              | PB3            | PWM1       |
|          | CON1-P08      | UART2-TX         | PI18           | SPI1\_MOSI |
|          |               | CON1-P09         | GND            |            |
|          | CON1-P10      | UART2-RX         | PI19           | SPI1\_MISO |
|          | CON1-P11      | UART7-TX         | PI20           | PWM2       |
|          | CON1-P12      | UART2-CTS        | PI17           | SPI1\_CLK  |
|          | CON1-P13      | UART7-RX         | PI21           | PWM3       |
|          |               | CON1-P14         | GND            |            |
|          | CON1-P15      | PH25             | PH25           | CSI1-FIELD |
|          | CON1-P16      | UART2-RTS        | PI16           | SPI1\_CS0  |
|          |               | CON1-P17         | VCC-3V3        |            |
|          | CON1-P18      | PH26             | PH26           | CSI1-HSYNC |
|          | CON1-P19      | SPI0\_MOSI       | PC0            |            |
|          |               | CON1-P20         | GND            |            |
|          | CON1-P21      | SPI0\_MISO       | PC1            |            |
|          | CON1-P22      | PH27             | PH27           | CSI1-VSYNC |
|          | CON1-P23      | SPI0\_CLK        | PC2            |            |
|          | CON1-P24      | SPI0\_CS         | PC23           |            |
|          |               | CON1-P25         | GND            |            |
|          | CON1-P26      | PH24             | PH24           | CSI1-PCLK  |
|          | CON1-P27      | TWI3-SDA         | PI1            |            |
|          | CON1-P28      | TWI3-SCK         | PI0            |            |
|          | CON1-P29      | PH0              | PH0            | CSI1-D0    |
|          |               | CON1-P30         | GND            |            |
|          | CON1-P31      | PH1              | PH1            | CSI1-D1    |
|          | CON1-P32      | PD20             | PD20           | CSI1-MCLK  |
|          | CON1-P33      | PH2              | PH2            | CSI1-D2    |
|          |               | CON1-P34         | GND            |            |
|          | CON1-P35      | PH3              | PH3            | CSI1-D3    |
|          | CON1-P36      | UART5-RX         | PH7            | CSI1-D7    |
|          | CON1-P37      | UART4-TX         | PH4            | CSI1-D4    |
|          | CON1-P38      | UART5-TX         | PH6            | CSI1-D6    |
|          |               | CON1-P39         | GND            |            |
| CON1-P40 | UART4-RX      | PH5              | CSI1-D5        |            |

**CSI Camera Connector specification:**

The CSI Camera Connector is a 24-pin FPC connector which can connect external camera module with proper signal pin mappings. The pin definitions of the CSI interface are shown as below. This is marked on the Banana Pi board as “Camera”.

| CSI Pin Name | Default Function | Function2：GPIO |
| ------------ | ---------------- | -------------- |
| CN5-P01      | NC               |                |
| CN5-P02      | GND              |                |
| CN5-P03      | CSI0-SDA         | PI3            |
|              | CN5-P04          | CSI0-AVDD      |
| CN5-P05      | CSI0-SCK         | PI2            |
| CN5-P06      | CSI0-Reset       | PI7            |
| CN5-P07      | CSI0-VSYNC       | PE3            |
| CN5-P08      | CSI0-PWDN        | PI6            |
| CN5-P09      | CSI0-HSYNC       | PE2            |
|              | CN5-P10          | CSI0-DVDD      |
|              | CN5-P11          | CSI0-DOVDD     |
| CN5-P12      | CSI0-D7          | PE11           |
| CN5-P13      | CSI0-MCLK        | PE1            |
| CN5-P14      | CSI0-D6          | PE10           |
|              | CN5-P15          | GND            |
| CN5-P16      | CSI0-D5          | PE9            |
| CN5-P17      | CSI0-PCLK        | PE0            |
| CN5-P18      | CSI0-D4          | PE8            |
| CN5-P19      | CSI0-D0          | PE4            |
| CN5-P20      | CSI0-D3          | PE7            |
| CN5-P21      | CSI0-D1          | PE5            |
| CN5-P22      | CSI0-D2          | PE6            |
| CN5-P23      | GND              |                |
|              | CN5-P24          | CSI0-AFVCC     |

**Display specification**

MIPI DSI (Display Serial Interface)

The display Connector is a 40-pin FPC connector which can connect external LCD panel (MIPI DSI) and touch screen (I2C) module as well. The pin definitions of this connector are shown as below. This is marked on the Banana Pi board as “DSI”.

|         | DSI Pin Name | Default Function | Function2：GPIO |
| ------- | ------------ | ---------------- | -------------- |
|         |              | CN6-P01          | VCC-3V3        |
|         |              | CN6-P02          | IPSOUT         |
|         |              | CN6-P03          | VCC-3V3        |
|         | CN6-P04      | IPSOUT           |                |
|         |              | CN6-P05          | GND            |
|         |              | CN6-P06          | IPSOUT         |
|         |              | CN6-P07          | GND            |
|         |              | CN6-P08          | IPSOUT         |
|         |              | CN6-P09          | NC             |
|         |              | CN6-P10          | GND            |
|         |              | CN6-P11          | NC             |
|         |              | CN6-P12          | DSI-D0N        |
|         |              | CN6-P13          | NC             |
|         |              | CN6-P14          | DSI-D0P        |
|         |              | CN6-P15          | NC             |
|         |              | CN6-P16          | GND            |
|         | CN6-P17      | TWI0-SDA         | PB19           |
|         |              | CN6-P18          | DSI-D1N        |
|         | CN6-P19      | TWI0-SCK         | PB18           |
|         |              | CN6-P20          | DSI-D1P        |
|         | CN6-P21      | CTP-INT          | PI10           |
|         | CN6-P22      | GND              |                |
|         | CN6-P23      | CTP-RST          | PI11           |
|         | CN6-P24      | DSI-CKN          |                |
|         |              | CN6-P25          | GND            |
|         |              | CN6-P26          | DSI-CKP        |
|         | CN6-P27      | LCD-BL-EN        | PH16           |
|         |              | CN6-P28          | GND            |
|         | CN6-P29      | LCD-RST          | PH17           |
|         |              | CN6-P30          | DSI-D2N        |
|         | CN6-P31      | LCD-PWR-EN       | PH18           |
|         |              | CN6-P32          | DSI-D2P        |
|         |              | CN6-P33          | GND            |
|         |              | CN6-P34          | GND            |
|         | CN6-P35      | LCD-PWM          | PB2            |
|         |              | CN6-P36          | DSI-D3N        |
|         |              | CN6-P37          | GND            |
|         |              | CN6-P38          | DSI-D3P        |
|         |              | CN6-P39          | NC             |
| CN6-P40 | GND          |                  |                |

**UART specification:**

The header CON4 is the UART interface. For developers of Banana Pi, this is an easy way to get the UART console output to check the system status and log message.

|          | CON2  Pin Name | Default Function | GPIO |
| -------- | -------------- | ---------------- | ---- |
|          | CON2 P03       | UART0-TXD        |      |
|          | CON2 P02       | UART0-RXD        |      |
| CON2 P01 | GND            |                  |      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bananapi.gitbook.io/bpi-m2-ultra-open-source-single-board-computer/bpi-m2-berry-hardware/bpi-m2-berry-gpio-pin-define.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
