Share this

Interface conversion card design based on embedded Linux

2026-04-06 06:23:31 · · #1
Abstract: This paper proposes an interface conversion scheme that solves the mutual conversion between several common standard interfaces, including USB bus, GPIB bus, and network. This scheme uses an embedded Linux operating system and an ARM processor as the hardware and software platform, and has achieved good application results in automated test systems. Keywords: USB bus, GPIB bus, embedded Linux I. Introduction: Interface buses provide an effective communication method for a group of interconnected devices. It is a hallmark of the development of automated test systems; the history of interface bus technology development is essentially the history of automated test system development, and the level of interface bus technology development signifies the level of automated test development. II. Hardware System Design The hardware platform is based on the ARM920T processor AT91RM9200. This processor not only has abundant on-chip resources and standard interfaces, but also features low power consumption, low cost, high performance, and support for multiple major embedded operating systems. It adopts a 5-stage integer pipeline architecture, achieving a performance of up to 200 MIPS. It has a standard ARMv4 memory management unit (MMU) and integrates two USB 2.0 full-speed (12Mb/s) host ports, one USB 2.0 full-speed (12Mb/s) device port, and a 10/100 Base-T Ethernet interface. This chip has multiple operating modes, with a low-power standby mode current of only 3.1mA. The hardware system architecture of this solution is shown in Figure 1, mainly including an AT91RM9200 processor, a GPIB module, a JTAG interface, a network module, 32M SDRAM, 16M FLASH, a serial port, and USB master/slave ports. The GPIB module is implemented by controlling the GPIB interface chip NAT9914 through the logic of the CPLD device EPM1270, and the network module achieves 10/100M adaptive network connectivity through an external DM9161. Additionally, the processor's built-in dual-host transceiver can connect USB devices. III. Software System Design 1. Linux System Porting The Linux operating system is the "kernel" of an operating system that can run on different types of computers. It provides the core software part that interfaces between the command line or programs and the computer hardware. From a software perspective, an embedded Linux system is divided into four layers: the boot loader, the kernel, the file system, and user programs. The boot loader is a small program that runs before the operating system kernel. This small program initializes hardware devices and establishes a memory space mapping, bringing the system's hardware and software environment to a suitable state to prepare the correct environment for the final call to the operating system kernel. This solution uses Linux kernel version 2.6.16. Because this solution requires access to USB flash drives, the kernel must include modules supporting USB flash drives, including SCSI support, SCSI disk support, USB mass storage support, VFAT (Windows 95) support, and MSDOS partition tables. There are three ways for USB devices to communicate with the USB host: some of the most feature-complete and complex devices use user-customized kernel modules to implement complex high-level protocols running on the standard USB bus, with the corresponding user drivers and applications on the USB host handling the connection; other Linux-based USB devices use the USB bus to achieve a simple point-to-point serial connection between the device and the host, where the application on the host actually uses the USB programming interface provided by the host operating system, but implements a serial communication protocol; the last method involves the device using the host computer as a gateway to connect the USB device to an office LAN or the Internet, thus creating a simulated Ethernet interface. This solution employs the last method, configuring the USB RNDIS gadget module in the kernel. This module uses the USB interface as the physical medium to simulate a virtual Ethernet device. The file system serves as the link between user-mode and kernel-mode processes; creating a file system with specific functions is an indispensable part of porting embedded systems. This solution utilizes the Busybox software toolkit to construct the EXT2 file system. This package integrates commonly used Linux commands and can be customized as needed, greatly facilitating embedded system development. 2. Specific Implementation of the Application Data conversion between multiple interfaces is primarily implemented in the user-mode application. The main function of this application is data exchange between two USB master ports (one for a USB device, one for a USB flash drive), one USB slave port, a GPIB port, and a network port. The program automatically detects whether the interface is connected: if so, it listens for data to be transmitted and forwards the detected data to other connected interfaces. The overall framework of the application is shown in Figure 2. 3. The functions of each subprocess are as follows: Subprocess 1: The implementation of the USB slave port mainly relies on the support of the USB RNDIS gadget module in the kernel. When the USB slave port is connected to the PC, it simulates an Ethernet interface on the PC and transmits data using the TCP/IP network protocol. Subprocess 2: USB master port 1 is dedicated to the USB port of USB devices. Subprocess 3: USB master port 2 is dedicated to USB flash drives. It actually connects the USB flash drive. When data is transferred to the USB flash drive, it mounts the USB flash drive on the Linux operating system and stores the data in binary format in the linux.txt file on the USB flash drive. If there is no data transmission within 15 seconds, the USB flash drive will be unmounted. Subprocess 4: The network port transmits data using the TCP/IP network protocol. Subprocess 1 and subprocess 4 respectively implement the network server function. Subprocess 5: Prepares an interrupt routine for the GPIB port in the Linux operating system. When the GPIB port has an action, it will first generate an interrupt, and the application will immediately jump to the interrupt handler to execute the relevant program operations. Since the parsing of the interface bus protocol is completed in the Linux driver, the data transmission between subprocesses directly represents the communication of the interface bus. The child processes create their own dedicated FIFO pipes to facilitate inter-process data exchange. Each child process has a main thread that performs port connection status detection; the flowchart of the main thread is shown in Figure 3. Port output data processing is primarily handled by the `readfifo` thread, which reads data from the process's dedicated FIFO pipe. If data is read from the FIFO and the port connection flag (`flag`) is 1 (indicating the port is connected), the data is filled into the port's output buffer; otherwise, the data is discarded. Port input data processing is handled by another thread. If the port is connected, the main thread creates a child thread to read the port's input data in real time and transmits the data to other processes via a dedicated pipe. Throughout the application, data forwarding for each port utilizes Linux inter-process communication technology. Each port has a data buffer of a certain size, enabling continuous data transmission unaffected by the peripheral controller's speed, ensuring reliable data reception, and minimizing the possibility of erroneous reception and judgment. IV. Conclusion This paper introduces the hardware and software design of an interface conversion card based on the AT91RM9200 platform and embedded Linux, which implements data communication between USB, GPIB, and network. This conversion card has wide-ranging practical applications, such as enabling PCs to remotely control USB devices over a network or enabling GPIB hosts to control USB devices. Currently, this solution has been successfully applied to oscilloscope interface expansion, proving its effectiveness in building automated test systems with numerous interface buses, and achieving excellent results.
Read next

CATDOLL 138CM Yoyo (TPE Body with Soft Silicone Head)

Height: 138cm Weight: 26kg Shoulder Width: 30cm Bust/Waist/Hip: 65/61/76cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22
CATDOLL 115CM Hedi TPE

CATDOLL 115CM Hedi TPE

Articles
2026-02-22
CATDOLL 108CM Bebe

CATDOLL 108CM Bebe

Articles
2026-02-22
CATDOLL Dodo 109CM TPE

CATDOLL Dodo 109CM TPE

Articles
2026-02-22