🛠 Mastering Advanced I/O on BIWCL-PAT: GPIO, Sensors and Display
Objectives
This tutorial aims to configure the advanced input/output interfaces of the BIOSTAR BIWCL-PAT card. You will learn to manage the 8-bit DIO header for controlling industrial peripherals, utilize RS232/422/485 serial ports for communication with PLCs, and configure triple display (HDMI, DP, LVDS) under Linux. These skills are essential for integration into edge computing systems or interactive kiosks.
Required Materials
- BIOSTAR BIWCL-PAT card (Intel Core Series 3 "Wildcat Lake" SoC).
- Stable 9-24V DC power supply.
- Installed OS: Ubuntu 24.04 LTS recommended for Python scripts.
- Wiring for the DIO header (standard 2x4 pin connector).
- 3.3V/5V compatible sensor module or actuator.
- LVDS screen (if testing dedicated display) and HDMI/DP screens.
- USB-to-Serial converter for initial COM port debugging.
Steps
Boot the card on Ubuntu 24.04. Open a terminal and update repositories to ensure compatibility with GPIO and video drivers: ``bash sudo apt update && sudo apt upgrade -y sudo apt install python3-gpiozero python3-serial ``
- System Access and Preparation
The DIO header allows direct interaction with industrial components. Under Linux, GPIO pins are often exposed via the sysfs filesystem or libgpiod. Identify the physical pins corresponding to the 8-bit DIO header. For a quick test with gpiozero (which may require specific mapping configuration for this card), create a simple Python script to light an LED connected to a DIO output: ```python from gpiozero import LED from time import sleep
- Configuring the 8-bit DIO Header
# Replace 'GPIO17' with the actual pin number mapped to DIO led = LED(17) while True: led.on() sleep(1) led.off() sleep(1) ``` *Note: Check the technical datasheet for the exact mapping of DIO pins to the Intel SoC GPIO lines.*
The card has 4 serial ports. Under Linux, they usually appear as /dev/ttyS0 to /dev/ttyS3. To configure a port in RS485 mode (often used for Modbus), you must handle the Request To Send (RTS) control line. Use pyserial: ```python import serial import time
- Using Serial Ports (RS232/422/485)
# Configuration for RS485 (adjust port according to physical pin) ser = serial.Serial('/dev/ttyS1', 9600, timeout=1) ser.rtscts = False ser.dsrdtr = False
while True: ser.write(b'TEST_MSG\n') time.sleep(1) ``` Ensure that physical jumpers (if present) or BIOS settings are set to the desired serial mode (232, 422, or 485).
The card manages three independent outputs via the integrated GPU. Under Linux, use xrandr to check and configure resolutions. To enable the LVDS screen alongside HDMI: ``bash xrandr --output LVDS-1 --mode 1920x1200 --rotate normal xrandr --output HDMI-1 --mode 3840x2160 --right-of LVDS-1 `` This allows having an operator interface on LVDS and a large-format display on HDMI, typical of interactive kiosks.
- Managing Triple Display
Verification
- GPIO/DIO: The connected LED should blink according to the Python script. Use a multimeter to check voltage levels (0V/3.3V or 5V) on DIO pins.
- Serial: Connect an oscilloscope or logic analyzer to TX/RX pins to confirm data transmission at 9600 baud.
- Display: Verify that all three screens are active and independent via the
xrandr --querycommand. No graphical artifacts should appear on 4K outputs.
Going Further
Explore the integration of M.2 B-Key modules for 4G/5G connectivity to transmit sensor data in real-time. You can also configure a hardware watchdog via GPIOs to restart the card in case of software lockup, thereby increasing reliability in critical industrial environments.