🛠 Mastering I/O on the BIWCL-PAT
Objectifs
This tutorial guides you through discovering the Input/Output interfaces of the BIOSTAR BIWCL-PAT industrial board. We will focus on the 8-bit DIO (Digital Input/Output) header and the RS232/422/485 serial ports, essential for automation and sensor reading. By the end of this guide, you will know how to configure pins to send digital signals and communicate via serial port under Ubuntu 24.04.
Matériel nécessaire
- BIOSTAR BIWCL-PAT board powered by 9-24V DC.
- A screen or SSH access for software configuration.
- A USB-TTL converter module or an adapted serial cable if working from an external PC (though the board natively manages serial ports).
- A multimeter to check voltage levels on the DIO header (optional but recommended).
- Connection cables (Dupont or terminal block depending on your board's physical connector).
Étapes
- System Preparation: Ensure your operating system (Ubuntu 24.04 recommended for development) is up to date. Open a terminal and install GPIO control tools if necessary via
sudo apt install gpiod-tools.
- DIO Pin Identification: The 8-bit DIO header allows control of 8 digital lines. Consult the specific technical documentation for your board revision to identify physical pins corresponding to DIO0 to DIO7 lines. Note that logic levels are generally 3.3V or 5V; check the datasheet to avoid damaging components.
``bash gpiodetect gpioinfo gpiochip0 ` Identify the active line. To set it to high state (1): `bash gpioset gpiochip0 0=1 ``
- Configuring an Output: To light a simple LED (with a resistor) or send a high signal, use the
gpiodcommand to export the line. For example, if DIO0 is identified as chip 0, line 0:
``bash echo "Test Serie" > /dev/ttyS0 `` Ensure that the BIOS or driver configuration matches the chosen mode (RS232 is often the default).
- Using Serial Ports: The board features 4 serial ports configurable as RS232, 422, or 485. Under Linux, these ports usually appear as
/dev/ttyS0to/dev/ttyS3. To send data via RS232, open the port with a tool likeminicomor via command line:
``bash gpioget gpiochip0 1 `` The output will return 0 or 1 depending on the voltage level applied to the pin.
- Reading Input: To read a state on a DIO pin configured as input, use
gpioget:
Vérification
To validate your configuration, connect an LED (with a 220 to 330 ohm resistor) between a DIO pin and Ground (GND). Execute the gpioset command to set the pin to high state. The LED should light up. For the serial port, connect TX and RX lines in a loop (loopback) if possible, or use another device to receive the "Test Serie" message. Verify that the message is received correctly without garbled characters, confirming proper transmission speed (baud rate) settings.
Pour aller plus loin
Once these basics are mastered, explore the use of more complex industrial protocols like Modbus RTU via RS485 serial ports. You can also test the LVDS output to connect a 1920x1200 industrial screen, or configure the 2.5GbE Ethernet ports for high-speed network communication with other edge computing equipment.
Other tutorials for this board
- BIWCL-PAT: First connections and boot-up
- Configuring Digital I/O (DIO) on the BIWCL-PAT
- Advanced Setup: BIOS, NVMe, and Triple Display on BIWCL-PAT
- Mastering Advanced I/O on BIWCL-PAT: GPIO, Sensors and Display
- Deploying an Industrial Automation Station on BIWCL-PAT
- Configure the three video outputs on BIWCL-PAT