🛠 Configuring GPIO I/O on PICO-PTH4

AAEON PICO-PTH4: Pico-ITX Board with Intel Panther Lake SoC · intermediaire · Apprenez à utiliser les connecteurs internes GPIO de la PICO-PTH4 pour interfacer des capteurs et actionneurs via Linux.

Objectives

This tutorial aims to familiarize you with using General Purpose Input/Output (GPIO) pins on the AAEON PICO-PTH4. While this card is optimized for AI and industrial workloads with its Panther Lake SoC, it retains essential physical interfaces for automation and IoT. We will configure GPIO pins for reading a simple logic state, utilizing the internal connectors available on the PCB.

Required Equipment

Steps

  1. Connector Identification: Locate the dedicated GPIO connector on the PICO-PTH4 board. Technical documentation indicates internal connectors for GPIO, SMBus/I2C, and serial ports. Ensure the board is powered off before connecting external components.
  1. Circuit Wiring: Connect a GPIO pin to a push-button, then to ground (GND). Use a pull-up or pull-down resistor if your software configuration does not handle it natively. This tutorial assumes an internal pull-up configuration enabled via the Linux kernel.
  1. Tool Installation: Open a terminal and install libraries for GPIO control via sysfs or libgpiod.
sudo apt update
sudo apt install libgpiod2 gpiod-tools
  1. GPIO Line Identification: Use the gpiodetect tool to list available GPIO chips.
sudo gpiodetect

Note the chip name (e.g., gpiochip0) and identify lines corresponding to physical connector pins. Exact mapping depends on the PICO-PTH4 electrical schematic.

  1. State Reading: To read a specific line (e.g., line 18), use:
sudo gpioget gpiochip0 18

The system returns 0 (low) or 1 (high) depending on button state.

  1. Monitoring Script: Create a simple bash script to monitor state changes.
#!/bin/bash
while true; do
  STATE=$(sudo gpioget gpiochip0 18)
  if [ "$STATE" -eq 0 ]; then
    echo "Button pressed"
  fi
  sleep 0.1
done

Verification

Run the script and press the button. "Button pressed" messages should appear. If no response is detected, check wiring, 12V power, and ensure GPIO device permissions are correctly configured.

Going Further

Explore I2C/SMBus bus usage mentioned in PICO-PTH4 specs for complex sensors. Combine GPIO data with Core Ultra X7 358H AI capabilities to process sensor streams in real-time, leveraging 180 TOPS for anomaly detection.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials