🛠 Configuring Digital I/O (DIO) on the BIWCL-PAT

BIOSSTAR BIWCL-PAT: 3.5" Industrial SBC with Intel Wildcat Lake · intermediaire · Apprenez à piloter le header DIO 8 bits de la carte BIWCL-PAT pour interagir avec des capteurs ou actionneurs industriels.

Objectifs

This tutorial aims to master the Digital Input/Output (DIO) interface of the BIWCL-PAT single-board computer. Unlike classic microcontroller GPIOs, this industrial board exposes a dedicated 8-bit DIO header, ideal for switching logic signals in automation environments. We will configure these pins to light an LED (output) and read a switch state (input) under Linux, a key skill for integrating simple peripherals without using USB or serial.

Matériel nécessaire

Étapes

  1. Header Identification: Locate the 8-bit DIO connector on the board. It is usually a male pin header (2x4 or 1x8) near the serial ports. Consult specific technical documentation to identify GND, 3.3V/5V (if available), and the 8 IO lines. Note that logic levels may require level shifters if driving external 24V loads.
  1. Output Wiring (LED): Connect the LED cathode to a GND pin on the DIO header. Connect the LED anode (via resistor) to the DIO_OUT_1 pin. Ensure correct polarity.
  1. Input Wiring (Button): Connect one pin of the push button to a GND pin. Connect the other pin to the DIO_IN_1 pin. Use an internal pull-up resistor if supported by the Linux driver, or an external pull-up to 3.3V/5V to avoid floating states.
  1. sysfs Access (Linux): Open a terminal. DIO interfaces are often exposed via /sys/class/gpio. Identify corresponding GPIO numbers via dmesg | grep gpio or the manufacturer's mapping table. Export pins if necessary:
echo <num_gpio_output> > /sys/class/gpio/export
echo <num_gpio_input> > /sys/class/gpio/export
  1. Direction Configuration: Set the output pin to write mode and input to read mode:
echo out > /sys/class/gpio/gpio<num_gpio_output>/direction
echo in > /sys/class/gpio/gpio<num_gpio_input>/direction
  1. Output Test: Turn on the LED by writing 1 to the value file:
echo 1 > /sys/class/gpio/gpio<num_gpio_output>/value

The LED should light up. Write 0 to turn it off.

  1. Input Reading: Press the button and read the state:
cat /sys/class/gpio/gpio<num_gpio_input>/value

The state should toggle between 0 and 1 depending on pull-up/down configuration.

Vérification

The LED must turn on and off on command. The value read on the input pin must toggle when pressing the button. If it fails, check physical connections, board power, and ensure the appropriate kernel module (e.g., gpio-bios or specific Intel driver) is loaded (lsmod | grep gpio).

Pour aller plus loin

For critical applications, avoid cat polling and use interrupts via epoll or libraries like libgpiod. For analog signals or complex protocols, explore the integrated RS232/422/485 serial ports or I2C/SPI interfaces if exposed via specific headers or M.2 adapters.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials