Enhancement of GPIO Pins

The ODROID Boards provide GPIO pin headers that you can easily use.

Check this document to know deployment of the pin map and its export GPIO numbers.

ODROID-C1

J2 - 2x20 PINS

GPIO wPi Name Alternative/
Driving Capability
Mode V PU/PD PIN PIN PU/PD V Mode Alternative/
Driving Capability
Name wPi GPIO
- - 3.3V - - - - 1 2 - - - - 5.0V - -
74 - I2CA_SDA - IN 1 - 3 4 - - - - 5.0V - -
75 - I2CA_SCL - IN 1 - 5 6 - - - - GND - -
83 7 GPIOY.3 -/2mA IN 0 P/U 7 8 P/U 1 ALT1 - GPIOX.16 - 113
- - GND - - - - 9 10 P/U 1 ALT1 - GPIOX.17 - 114
88 0 GPIOY.8 -/3mA IN 1 P/U 11 12 P/U 0 IN -/2mA GPIOY.7 1 87
116 2 GPIOX.19 -/2mA IN 1 P/U 13 14 - - - - GND - -
115 3 GPIOX.18 -/2mA IN 0 P/D 15 16 P/U 1 IN -/3mA GPIOX.7 4 104
- - 3.3V - - - - 17 18 P/U 1 IN -/3mA GPIOX.5 5 102
107 12 GPIOX.10 PWM1/2mA IN 1 P/U 19 20 - - - - GND - -
106 13 GPIOX.9 -/3mA IN 1 P/U 21 22 P/U 1 IN -/3mA GPIOX.6 6 103
105 14 GPIOX.8 -/4mA IN 1 P/U 23 24 P/D 0 IN -/2mA GPIOX.20 10 117
- - GND - - - - 25 26 P/U 1 IN - GPIOX.21 11 118
76 - I2CB_SDA - IN 1 - 27 28 - 1 IN - I2CB_SCL - 77
101 21 GPIOX.4 -/3mA IN 1 P/U 29 30 - - - - GND - -
100 22 GPIOX.3 -/3mA IN 1 P/U 31 32 P/U 1 IN -/3mA GPIOX.2 26 99
108 23 GPIOX.11 PWM0/3mA IN 0 P/D 33 34 - - - - GND - -
97 24 GPIOX.0 -/3mA IN 1 P/U 35 36 P/U 1 IN -/3mA GPIOX.1 27 98
- - ADC.AIN0 10bit ADC#1(0~1.8V) - - - 37 38 - - - Output! 1.8V REF - -
- - GND - - - - 39 40 - - - 10bit ADC#0 (0~1.8V) ADC.AIN1 - -

2017/09/27 17:47 · luke.go

ODROID-C2

J2 - 2x20 PINS

GPIO wPi Name Alternative Mode V PU/PD PIN PIN PU/PD V Mode Alternative Name wPi GPIO
- - 3.3V - - - - 1 2 - - - - 5.0V - -
205 - I2CA_SDA - IN 1 - 3 4 - - - - 5.0V - -
206 - I2CA_SCL - IN 1 - 5 6 - - - - GND - -
249 7 GPIOX.21 - IN 1 P/U 7 8 P/U 1 ALT2 /dev/ttyS1 TXD1 - 240
- - GND - - - - 9 10 P/U 1 ALT2 /dev/ttyS1 RXD1 - 241
247 0 GPIOX.19 - IN 1 P/U 11 12 P/D 0 IN - GPIOX.10 1 238
239 2 GPIOX.11 - IN 1 P/U 13 14 - - - - GND - -
237 3 GPIOX.9 - IN 1 P/U 15 16 P/U 1 IN - GPIOX.8 4 236
- - 3.3V - - - - 17 18 P/U 1 IN - GPIOX.5 5 233
235 12 GPIOX.7 PWM1 IN 1 P/U 19 20 - - - - GND - -
232 13 GPIOX.4 - IN 1 P/U 21 22 P/U 1 IN - GPIOX.3 6 231
230 14 GPIOX.2 - IN 1 P/U 23 24 P/U 1 IN - GPIOX.1 10 229
- - GND - - - - 25 26 P/D 0 IN - GPIOY.14 11 225
207 - I2CB_SDA - IN 1 - 27 28 - 1 IN - I2CB_SCL - 208
228 21 GPIOX.0 - IN 1 P/U 29 30 - - - - GND - -
219 22 GPIOY.8 - IN 1 P/U 31 32 P/U 1 IN - GPIOY.13 26 224
234 23 GPIOX.6 PWM0 IN 0 P/D 33 34 - - - - GND - -
214 24 GPIOY.3 - IN 1 P/U 35 36 P/U 1 IN - GPIOY.7 27 218
- - ADC.AIN1 10bit ADC (0~1.8V) - - - 37 38 - - - - 1.8V REF - -
- - GND - - - - 39 40 - - - 10bit ADC(00~1.8V) ADC.AIN0 - -

2017/06/16 17:01 · luke.go

ODROID-C4

J2 - 2x20 PINS

WE SHOULD CHECK THE PIN MAP!!!

Default Pin State GPIO & Export No Net Name Pin Number Pin Number Net Name GPIO & Export No Default Pin State
- - 3.3V 1 2 5.0V - -
I(P/D) GPIOX.17 (#493) I2C1_SDA 3 4 5.0V - -
I(P/U) GPIOX.18 (#494) I2C1_SCL 5 6 GND - -
I(P/D) GPIOX.5 (#481) 7 8 TXD1 GPIOX.12 (#488) I(P/U)
- - GND 9 10 RXD1 GPIOX.13 (#489) I(P/U)
I(P/U) GPIOX.3 (#479) 11 12 PWM_E GPIOX.16 (#492) I(P/U)
I(P/U) GPIOX.4 (#480) 13 14 GND - -
I(P/U) GPIOX.7 (#483) PWM_F 15 16 GPIOX.0 (#476) I(P/U)
- - 3.3V 17 18 GPIOX.1 (#477) I(P/U)
I(P/U) GPIOX.8 (#484) SPI0_MOSI 19 20 GND - -
I(P/U) GPIOX.9 (#485) SPI0_MISO 21 22 GPIOX.2 (#478) I(P/U)
I(P/U) GPIOX.11 (#487) SPI0_SCLK 23 24 SPI0_CS0 GPIOX.10 (#486) I(P/U)
- - GND 25 26 GPIOH.6 (#433) I(P/D)
I(P/U) GPIOA.14 (#474) I2C-2 SDA 27 28 I2C-2 SCL GPIOA.15 (#475) I(P/U)
I(P/U) GPIOX.14 (#490) 29 30 GND - -
I(P/U) GPIOX.15 (#491) 31 32 GPIOH.7 (#434) I(P/D)
I(P/U) GPIOX.6 (#482) PWM_C 33 34 GND - -
I(P/D) GPIOX.19 (#495) PWM_D 35 36 GPIOH.5 (#432) -
ADC.AIN2 37 38 REF 1.8V
- - GND 39 40 ADC.AIN0

2019/10/29 16:27 · luke.go

ODROID-XU4

Expansion Connectors


The XU3/XU4 provides one 30-pin dual row expansion header “CON10”.
The location and pinout of these connectors is illustrated below. All signals on expansion headers are 1.8V except PWRON signal.

CON 10 - 2x15 pins

Default Pin State GPIO & Export No Net Name Pin Number Pin Number Net Name GPIO & Export No Default Pin State
- - 5V0 1 2 GND - -
I XADC0AIN_0 ADC_0.AIN0 3 4 UART_0.CTSN GPA0.2 (#173) I(PUDN)
I(PUDN) GPA0.3 (#174) UART_0.RTSN 5 6 UART_0.RXD GPA0.0 (#171) I(PUDN)
I(PUDN) GPA2.7 (#192) SPI_1.MOISI 7 8 UART_0.TXD GPA0.1 (#172) I(PUDN)
I(PUDN) GPA2.6 (#191) SPI_1.MISO 9 10 SPI_1.CLK GPA2.4 (#189) I(PUDN)
I(PUDN) GPA2.5 (#190) SPI_1.CSN 11 12 PWRON Input Range (1.8V ~ 5V) I
I(PUDN) GPX1.5 (#21) XE.INT13 13 14 I2C_1.SCL GPB3.3 (#210) I(PUDN)
I(PUDN) GPX1.2 (#18) XE.INT10 15 16 I2C_1.SDA GPB3.2 (#209) I(PUDN)
I(PUDN) GPX1.6 (#22) XE.INT14 17 18 XE.INT11 GPX1.3 (#19) I(PUDN)
I(PUDN) GPX2.6 (#30) XE.INT22 19 20 XE.INT20 GPX2.4 (#28) I(PUDN)
I(PUDN) GPX2.5 (#29) XE.INT21 21 22 XE.INT23 GPX2.7 (#31) I(PUDN)
I XADC0AIN_3 ADC_0.AIN3 23 24 XE.INT17 GPX2.1 (#25) I(PUDN)
I(PUDN) GPX1.7 (#23) XE.INT15 25 26 XE.INT16 GPX2.0 (#24) I(PUDN)
I(PUDN) GPX3.1 (#33) XE.INT25 27 28 GND - -
- - VDD_IO(1.8V) 29 30 GND - -

CON 11 - 2x6 pins

CON11 is available only in XU4 not XU3.
All signals on expansion headers are 1.8V

Default Pin State GPIO & Export No Net Name Pin Number Pin Number Net Name GPIO & Export No Default Pin State
- - 5V0 1 2 GND - -
- - VDD_IO(1.8V) 3 4 I2C_5.SDA GPA2.2 (#187) I(PUDN)
I(PUDN) GPX3.2 (#34) XE.INT26 5 6 I2C_5.SCL GPA2.3 (#188) I(PUDN)
I(PUDN) GPZ.0 (#225) I2S_0.SCLK 7 8 GND - -
I(PUDN) GPZ.1 (#226) I2S_0.CDCLK 9 10 I2S_0.SDO GPZ.4 (#229) I(PUDN)
I(PUDN) GPZ.2 (#227) I2S_0.LRCK 11 12 I2S_0.SDI GPZ.3 (#228) I(PUDN)

GPIO Map for WiringPi Library (CON10 2 x 15)

Net Name GPIO & Export No WiringPi GPIO Header Pin Header Pin WiringPi GPIO GPIO & Export No Net Name
5V0 5V0 1 2 GND GND
ADC_0.AIN0 AIN0(1.8V Max) GPIO_25 3 4 GPIO_01 GPA0.2(#173) UART_0.RTSN
UART_0.CTSN GPA0.3(#174) GPIO_00 5 6 GPIO_16 GPA0.0(#171) UART_0.RXD
SPI_1.MOSI GPA2.7(#192) GPIO_12 7 8 GPIO_15 GPA0.1(#172) UART_0.TXD
SPI_1.MISO GPA2.6(#191) GPIO_13 9 10 GPIO_14 GPA2.4(#189) SPI_1.CLK
SPI_1.CSN GPA2.5(#190) GPIO_10 11 12 PWR_ON(INPUT) PWR_ON
XE.INT13 GPX1.5(#21) GPIO_02 13 14 GPIO_09 GPB3.3(#210) I2C_1.SCL
XE.INT10 GPX1.2(#18) GPIO_07 15 16 GPIO_08 GPB3.2(#209) I2C_1.SDA
XE.INT14 GPX1.6(#22) GPIO_03 17 18 GPIO_19 GPX1.3(#19) XE.INT11
XE.INT22 GPX2.6(#30) GPIO_22 19 20 GPIO_21 GPX2.4(#28) XE.INT20
XE.INT21 GPX2.5(#29) GPIO_26 21 22 GPIO_23 GPX2.7(#31) XE.INT23
ADC_0.AIN3 AIN3(1.8V Max) GPIO_29 23 24 GPIO_11 GPX2.1(#25) XE.INT17
XE.INT15 GPX1.7(#23) GPIO_05 25 26 GPIO_06 GPX2.0(#24) XE.INT16
XE.INT25 GPX3.1(#33) GPIO_27 27 28 GND GND
VDD_IO VDD_IO(1.8V) 29 30 GND GND

GPIO Map for WiringPi Library (Shifter-Shield 40 Pin)

GPIO WiringPi Name Mode Initial Level Header Pin Header Pin Initial Level Mode Name WiringPi GPIO
3.3V 1 2 5v
209 8 I2C1.SDA ALT1 1 3 4 5v
210 9 I2C1.SCL ALT1 1 5 6 0v
18 7 GPIO. 18 IN 1 7 8 1 ALT1 UART0.TX 15 172
0v 9 10 1 ALT1 UART0.RX 16 171
174 0 GPIO.174 ALT1 1 11 12 1 ALT1 GPIO.173 1 173
21 2 GPIO. 21 IN 1 13 14 0v
22 3 GPIO. 22 IN 1 15 16 1 IN GPIO. 19 4 19
3.3v 17 18 1 IN GPIO. 23 5 23
192 12 MOSI ALT1 1 19 20 0v
191 13 MISO ALT1 1 21 22 1 IN GPIO. 24 6 24
189 SCLK ALT1 0 23 24 1 OUT CE0 10 190
0v 25 26 1 OUT GPIO. 25 11 25
187 30 I2C5.SDA ALT2 1 27 28 1 ALT2 I2C_5.SCL 31 188
28 21 GPIO. 28 IN 1 29 30 0v
30 22 GPIO. 30 IN 1 31 32 1 IN GPIO. 29 26 29
31 23 GPIO. 31 IN 1 33 34 0v
24 POWER ON 35 36 1 IN GPIO. 33 27 33
25 AIN.0 37 38 1v8 28
0v 39 40 AIN.3 29

The “gpio readall” shows the pin-map of 40-pin-Shifter-Shield not 30-Pin-header.

PCB Layout for pin map

2017/07/24 17:40 · luke.go

ODROID-N2

J2 - 2x20 PINS

WE SHOULD CHECK THE PIN MAP!!!

Default Pin State GPIO & Export No Net Name Pin Number Pin Number Net Name GPIO & Export No Default Pin State
- - 3.3V 1 2 5.0V - -
I(P/D) GPIOX.17 (#493) I2C-2 SDA 3 4 5.0V - -
I(P/U) GPIOX.18 (#494) I2C-2 SCL 5 6 GND - -
I(P/D) GPIOA.13 (#473) 7 8 TXD1 GPIOX.12 (#488) I(P/U)
- - GND 9 10 RXD1 GPIOX.13 (#489) I(P/U)
I(P/U) GPIOX.3 (#479) 11 12 PWM_E GPIOX.16 (#492) I(P/U)
I(P/U) GPIOX.4 (#480) 13 14 GND - -
I(P/U) GPIOX.7 (#483) 15 16 GPIOX.0 (#476) I(P/U)
- - 3.3V 17 18 GPIOX.1 (#477) I(P/U)
I(P/U) GPIOX.8 (#484) SPI0_MOSI 19 20 GND - -
I(P/U) GPIOX.9 (#485) SPI0_MISO 21 22 GPIOX.2 (#478) I(P/U)
I(P/U) GPIOX.11 (#487) SPI0_CLK 23 24 SPI0_SS0 GPIOX.10 (#486) I(P/U)
- - GND 25 26 GPIOA.4 (#464) I(P/D)
I(P/U) GPIOA.14 (#474) I2C-3 SDA 27 28 I2C-3 SCL GPIOA.15 (#475) I(P/U)
I(P/U) GPIOX.14 (#490) 29 30 GND - -
I(P/U) GPIOX.15 (#491) 31 32 GPIOA.12 (#472) I(P/D)
I(P/U) GPIOX.5 (#481) 33 34 GND - -
I(P/D) GPIOX.6 (#482) 35 36 GPIOX.19 (#495) -
ADC.AIN3 37 38 REF 1.8V
- - GND 39 40 ADC.AIN2

2018/12/17 12:20 · luke.go

Login as root

You have to login as root user.

odroid@odroid:~$ sudo su

To deal with GPIO

You can access each GPIO pin using sysfs interface. This example uses pin number 18 that is connected to the GPIO #477 (GPIOX.1) on the ODROID-N2/C4.

Do echo the number to export file to export GPIO pin access controller.

root@odroid:~# echo 477 > /sys/class/gpio/export

Configure direction

# To input
root@odroid:~# echo in > /sys/class/gpio/gpio477/direction
 
# To output
root@odroid:~# echo out > /sys/class/gpio/gpio477/direction

Read/Write a value

# When if GPIO direction is input
# Read a value
root@odroid:~# cat /sys/class/gpio/gpio477/value
 
# When if GPIO direction is output
# Write a value: high
root@odroid:~# echo 1 > /sys/class/gpio/gpio477/value
 
# Write a value: low
root@odroid:~# echo 0 > /sys/class/gpio/gpio477/value
2020/03/16 15:46 · luke.go