Jotrin Electronics
Cart
arrow
Description Quantity Total (USD) Operation
loading
Shopping cart products
Shopping cart products : 0
Home > Processor/DSP > Design of interface conversion card based on AT91RM9200 processor

Design of interface conversion card based on AT91RM9200 processor

Update Time: 2020-04-17 10:31:41

The interface bus provides an effective communication method for a group of connected devices. It is a sign of the development of automatic test systems. It can be said that the history of the development of interface bus technology is the history of the development of automatic test systems. The level of interface bus technology development marks automatic testing The level of development. The interface conversion scheme proposed in this paper solves the mutual conversion between several common standard interfaces including USB bus, GPIB bus, and network. This solution uses embedded Linux operating system and ARM processor as the hardware and software platform, and has achieved good application results in the application of automatic test system.

Hardware system design

The hardware platform is based on the ARM920T processor AT91RM9200. This processor not only has rich on-chip resources and standard interfaces, but also has low power consumption, low cost, high performance, and supports many major embedded operating systems. It uses level 5 Integer pipeline structure, performance up to 200MIPS, with standard ARMv4 memory management unit (MMU), two USB2.0 full speed (12Mb / s) host ports, one USB2.0 full speed (12Mb / s) device port and 10 / 100 Base-T Ethernet interface. The chip has multiple operating modes, and its current in low-power standby mode is only 3.1mA.

processor AT91RM9200

The hardware system structure design of this solution mainly includes AT91RM9200 processor, GPIB module, JTAG interface, network module, 32M SDRAM, 16M FLASH, serial port, USB master-slave port and other parts. Among them, the GPIB module is realized by the CPLD device EPM1270 logic control GPIB interface chip NAT9914, and the network module realizes 10 / 100M adaptive network connection by connecting the external DM9161. In addition, the dual host transceiver built into the processor can be connected to a USB device.

Software system design

Linux system transplantation

The Linux operating system is the “kernel” of an operating system that can run on different types of computers. It provides the core of the software that provides command lines or interfaces between programs and computer hardware. The embedded Linux system is divided into 4 levels from a software perspective, namely boot loader (Boot Loader), kernel, file system and user program.

Boot Loader is a small program that runs before the operating system kernel runs. Through this small program, you can initialize the hardware device and establish a map of the memory space, so as to bring the system's hardware and software environment to a suitable state, so as to prepare the correct environment for the final call to the operating system kernel.

In this scheme, the Linux kernel uses the Linux2.6.16 kernel. Because this solution needs to access the U disk, the kernel must support the U disk module, including SCSI support, SCSI disk support, USB mass STorage support, VFAT (windows95) support, MSDOS partiTION tables, etc. The USB device port can communicate with the USB host in three ways: some of the most complete and complex devices, using user-defined kernel modules to run complex high-level protocols on the standard USB bus, driven by the corresponding user on the USB host Programs and applications to complete the connection; other USB devices based on Linux systems use the USB bus to achieve a simple point-to-point serial connection between the device and the host, the application on the host actually uses the main operating system to provide USB programming interface, but the implementation is a serial communication protocol; the last one is the device uses the host computer as a gateway, the USB device is connected to the office LAN or the Internet, so that the USB device constitutes an analog Ethernet interface. This solution adopts the last method and configures the USB RNDIS gadget module in the kernel. The module uses the USB interface as a physical medium to simulate a fictitious Ethernet device.

The file system is the link between the user-mode process and the kernel-mode process. Making a file system with specific functions is an indispensable part of transplanting an embedded system. This solution uses the Busybox software toolkit to construct the EXT2 file system. This software package integrates common Linux commands, which can be cut down according to requirements, which greatly facilitates the development of embedded systems. [page]

Application specific implementation

The conversion of data between multiple interfaces is mainly implemented in user-mode applications. The main function of this application is data exchange between two USB master ports (one connected to USB instrument and one connected to U disk), one USB slave port, GPIB port and network port. The program automatically detects whether the interface is in a connected state: if it is, it monitors whether there is data to be transmitted, and passes the monitored data to other interfaces in a connected state.

The functions of each subprocess are as follows:

Subprocess 1: The realization of the USB slave port mainly depends on the support of the USB RNDIS gadget module in the kernel. When the USB slave port is connected to the PC, the Ethernet interface is simulated on the PC and the data is transferred using the TCP / IP network protocol;

Child process 2: USB main port 1 is dedicated to the USB port of the USB device;

Subprocess 3: The USB main port 2 is dedicated to the U disk, and the U disk is actually connected. When data is transferred to the U disk, the U disk is mounted on the Linux operating system and the data is stored to the U disk in a binary manner. In the linux.txt file, if there is no data transmission within 15s, the U disk will be uninstalled;

Subprocess 4: The network port uses the TCP / IP network protocol to transmit data. Subprocess 1 and subprocess 4 respectively implement the network server function;

Subprocess 5: Prepare 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 immediately jumps to the interrupt processing to execute the program-related operations.

Because the analysis of the interface bus protocol is completed in the Linux driver, the data transmission between the subprocesses directly represents the communication of the interface bus. The child process creates its own dedicated pipeline FIFO to complete the data exchange between processes.

Each child process has a main thread to complete the connection status detection of the port.  The processing of the port output data is mainly completed by the thread readfifo. It reads the data of the dedicated pipeline FIFO of the process. If the data is read from the FIFO, and the port connection flag bit is 1 (indicating that the port is connected), then Fill this data into the output buffer of the port, otherwise discard the read data. The processing of the input data of the port is completed by another thread. If the port is connected, the main thread will create the sub-thread to read the input data of the port in real time and pass the data to other processes through a dedicated pipeline.

In the entire application, the data forwarding of each port utilizes the data communication technology between Linux processes. Each port is set with a certain size of data buffer, so that data can be sent continuously without being affected by the speed of the peripheral controller, the received data is reliable, and the possibility of erroneous reception and erroneous judgment is reduced as much as possible.

Conclusion

This article introduces a 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 the network. This conversion card has a wide range of practical applications, such as PC remote control of USB devices through the network or GPIB host to control USB devices and so on. At present, this solution has been successfully applied to the expansion of the interface of the oscilloscope. Facts have proved that this solution can provide help for building an automatic test system with a large number of interface buses, and has achieved good results.

Tag: AT91RM9200

Share:

Previous: Lite-On Technology Selected as a Member of 2012 DJSI two years in a row, ranked as the Sector Leader of Electronic Component & Equipment

Next: What are the types of chip packaging

 

Cart

Account Center

jotrin03

Live Chat

sales@jotrin.com