Hummingboard Base/Professional GPIOs
Description
[]
GPIO, or General-Purpose Input/Output is a mechanism that allows a computing board to provide electrical contacts for signalling to a wide range of external devices. These pins allow commerical and hobbyist projects to do things like communicate with a “breakout board”, or individual physical modules - like a motor.
GPIO interfaces are different than other capabilities on a circuit board (like LVDS or the RTC integration) in that they provide a non-specific electrical interface. While these other interfaces have a set specification and set capability for an intended use (connecting to an LCD panel or a real-time clock, in the cited examples respectively) GPIO pins are used at the developer's discretion. You could connect a motor. Or a temperature sensor. Or a lock solenoid. Or any one of millions of other device combinations for bringing information into the system - or sending information out from the HummingBoard device.
GPIO Header Pinout
PIN | Signal | Pin | Signal |
---|---|---|---|
1 | 3.3V | 2 | 5V |
3 | I2C_SDA | 4 | 5V |
5 | I2C_SCL | 6 | GND |
7 | GPIO 1 | 8 | UART TX |
9 | GND | 10 | UART RX |
11 | GPIO 73 | 12 | GPIO 72 |
13 | GPIO 71 | 14 | GND |
15 | GPIO 10 | 16 | GPIO 194* |
17 | 3.3V | 18 | GPIO 195* |
19 | SPI_MOSI | 20 | GND |
21 | SPI_MISO | 22 | GPIO 67 |
23 | SPI_SCLK | 24 | ECSPI2_SS0 |
25 | GND | 26 | ECSPI2_SS1 |
Pins 16 and 18 are actually SD3_CMD and SD3_CLK signals that can be muxed to support flex can TX/RX interface (i.e. those can be connected to an external CAN)
Note: SPI and I2C can also be muxed to be GPIO
Accessing GPIO from Linux userspace
General
Please have a look at WiringX, which also supports the Hummingboard:
Manual
The external GPIOs are available under the /sys/class/gpio folder in Linux.
Get the current list of reserved GPIO
> mount -t debugfs none /sys/kernel/debug > cat /sys/kernel/debug/gpio
Reserve/free a GPIO pin
> echo XX > /sys/class/gpio/export > echo XX > /sys/class/gpio/unexport
Set GPIO pin Direction
> echo in > /sys/class/gpio/gpioXX/direction > echo out > /sys/class/gpio/gpioXX/direction
Set the value of an output pin
> echo 1 > /sys/class/gpio/gpioXX/value > echo 0 > /sys/class/gpio/gpioXX/value
Get the value of an input pin
> cat > /sys/class/gpio/gpioXX/value
Serial UART port access
The UART port for debug can be accessed on the 26 pin header as follows -
Pin 6/9/14/20/25 GND
Pin 1 3.3V
Pin 8 buffered i.MX6 UART TX - pulled up to 3.3v
Pin 10 buffered i.MX6 UART RX - pulled up to 3.3v
Notice that the pin number starts as pin #1 on the edge of the board, towards the micro-USB connector; then number #2 is the one towards the corner of the board.