Jump to content

Wiren Board 6.1: GPIO List

From Wiren Board
This is the approved revision of this page, as well as being the most recent.

The article describes the connection of the built-in peripherals to the processor signals for Wiren Board 6 (revision 6.1).

The easiest and most convenient way to work with the controller hardware is via MQTT, by contacting wb services: wb-mqtt-gpio, wb-mqtt-adc, etc. wb- services allow you to work with hardware through a unified interface MQTT and hide hardware differences between hardware revisions controllers.

Work bypassing the standard wb- services is usually used when the software is running on different Linux controllers from different vendors, and work through the corresponding kernel interfaces is already implemented in the software. This article contains a description of the peripherals needed to work with them through the standard kernel interfaces. When working with kernel interfaces, don't forget to disable the corresponding wb- service.

Most of the peripherals described in this article are also described in the /wirenboard node in the controller's Device Tree. Services wb-mqtt-gpio, wb-mqtt-adc, etc. take the description of the peripherals from there, reading the description every time the controller starts. This method is also preferred for third party software to maintain compatibility with past and future hardware revisions hardware.

Working with GPIOs in Linux

GPIO (General-purpose input / output - general-purpose input / output) is an electrical circuit contact that can take one of two logical states - one or zero. The user can set and read the GPIO state.

In different devices, a high logic level can be represented by different voltages - keep an eye on this. In Wiren Board controllers, the logical unit is 3.3 V.

WARNING: do not directly connect signals with a voltage greater than 3.3V to the controller's GPIO! If you need to connect a device that produces a signal with a higher voltage, use matching circuits. In some cases, if the signal voltage is not more than 5 V, then it is possible to match the signals through a 20 kΩ resistor.

For working with GPIO on Linux, see kernel documentation. You can also read the obsolete instruction in our Wiki - Working with GPIO.

For other controller versions see GPIO tables of different controller versions.

При работе с GPIO рекомендуем использовать адресацию по меткам, так как номера могут отличаться в разных версиях контроллера.

Посмотреть метки GPIO можно командой cat /sys/kernel/debug/gpio, или в разделе ниже.

GPIOs on terminals

terminal function GPIO i.mx6UL pin notes
W1 (in) 1-wire/DI GPIO1_IO11 11 P14 1-wire by default
W2 (in) 1-wire/DI GPIO4_IO12 108 A3


GPIOs for transistors (A1-A4)

terminal function GPIO GPIO number i.mx6UL pin notes
A1 (out) ADC/FET/DI GPIO3_15 79 open collector output;
A2 (out) ADC/FET/DI GPIO3_16 80 ooen collector output;
A3 (out) ADC/FET/DI GPIO3_17 81 open collector output;
A4 (out) ADC/FET/DI GPIO3_18 82 open collector output;


ADC channels

terminal ADC channel Divider Final formula(no divider) V max. measured notes
A1 4 88k7, 12k
A2 2
A3 1
A4 3
Vin 8 88k7, 12k
5Vout 5 33k, 12k


Pins for internal use

sodim pin GPIO GPIO number i.mx6UL pin function
84 GPIO1_IO13 13 transistor 1-wire pull up
77 GPIO4_IO16 112 transistor 1-wire pull up (W2)
36 GPIO1_IO27 27 5V out
176 GPIO3_IO14 78 LCD_DATA09 RFM69H IRQ
178 GPIO3_IO13 LCD_DATA08 RFM69H _DIO2
180 GPIO3_IO28 LCD_DATA23 RFM69 MISO
182 GPIO3_IO27 LCD_DATA22 RFM69 MOSI
186 GPIO3_IO25 LCD_DATA20 RFM69 SCK
184 GPIO3_IO26 LCD_DATA21 RFM69H chip select
104 GPIO4_IO24 120 SIM900R power FET (RESET)
164 GPIO3_IO20 84 SIM900R power KEY
166 GPIO3_IO19 83 SIM900R power status (input)
188 GPIO3_IO24 88 SIM slot select (low: 1, high: 2)
23 GPIO2_IO19 51 SD1_DATA1 watchdog input
162 PWM1_OUT Buzzer
80 Red LED
82 Green LED
69 2nd ethernet LED
65 GPIO1_IO18 18 STAT1 (BATTERY_CHARGING)
67 GPIO1_IO19 19 STAT2 (BATTERY_PRESENT)
152 GPIO3_IO10 Wi-Fi power (active low)
29 GPIO2_IO16 i2c for RTC, SDA
31 GPIO2_IO17 i2c for RTC, SCL
144 GPIO3_IO12 PAD_LCD_DATA07 i2c for EEPROM1, SDA
142 GPIO3_IO03 PAD_LCD_VSYNC i2c for EEPROM1, SCL
160 GPIO3_IO06 PAD_LCD_DATA01 i2c for EEPROM2, SDA
158 GPIO3_IO07 PAD_LCD_DATA02 i2c for EEPROM2, SCL
75 GPIO4_IO11 107 USB power
154 GPIO3_IO09 73 V_OUT_ON
156 GPIO3_IO08 72 V_OUT_ST
102 GPIO4_IO23 119 PAD_CSI_DATA02 RS-485-1 failsafe bias
190 GPIO3_IO23 87 PAD_LCD_DATA18 RS-485-2 failsafe bias
40 GPIO1_IO23 23 PAD_UART2_RTS_B CAN transceiver power


GPIO on MOD1 extension connector

sodim pin GPIO GPIO number imx6ul pin pinmux pad name pin function
- - - 3.3V -
30 GPIO1_IO24 H17 UART3_TX_DATA TX uart tx
32 GPIO1_IO25 H16 UART3_RX_DATA RX uart rx
- 5V -
34 GPIO1_IO26 H15 UART3_CTS_B DE uart de
- GND -


GPIO on MOD2 extension connector

sodim pin GPIO GPIO number imx6ul pin pinmux pad name pin function
- - - 3.3V -
98 GPIO4_IO21 E4 CSI_DATA00 TX uart tx MX6UL_PAD_CSI_DATA00__UART5_DCE_TX
49 JTAG_MOD TX (muxed через 3k, 12k PD) spdif out
100 GPIO4_IO22 E3 CSI_DATA01 RX MX6UL_PAD_CSI_DATA01__UART5_DCE_RX
- 5V -
52 GPIO1_IO09 M15 GPIO1_IO09 DE uart de, pwm, spdif in
- GND -


GPIO on MOD3 extension connector

sodim pin GPIO GPIO number imx6ul pin pinmux pad name pin function
- 3.3V -
194 GPIO3_IO21 85 LCD_DATA16 TX uart tx
192 GPIO3_IO22 86 LCD_DATA17 RX uart rx
112 GPIO4_IO28 124 D1 CSI_DATA07 MISO spi miso MX6UL_PAD_CSI_DATA07__ECSPI1_MISO
106 GPIO4_IO25 121 D4D CSI_DATA04 SCK spi sck MX6UL_PAD_CSI_DATA04__ECSPI1_SCLK
- 5V -
150 GPIO3_IO11 75 A10 LCD_DATA06 DE uart de
- GND -
110 GPIO4_IO27 123 D2 CSI_DATA06 MOSI spi mosi MX6UL_PAD_CSI_DATA06__ECSPI1_MOSI
108 GPIO4_IO26 122 D3 CSI_DATA05 SS spi ss MX6UL_PAD_CSI_DATA05__ECSPI1_SS0