Wednesday, February 5, 2025
knowledgeMaterialsNewsTechnology

Design of Communication Interface Based on DSP/ARM Dual Core System

The core of embedded system is embedded microprocessor and embedded operating system. The core of the early embedded system hardware was various types of 8-bit and 16-bit microcontrollers; however, in recent years, 32-bit processors have been widely used due to their high performance and low price. In recent years, another kind of data-intensive processing chip DSP has appeared. Because of its special structure, special hardware multipliers and special instructions, DSP can quickly realize various digital signal processing and meet various high real-time requirements.

The core of embedded system is embedded microprocessor and embedded operating system. The core of the early embedded system hardware was various types of 8-bit and 16-bit microcontrollers; however, in recent years, 32-bit processors have been widely used due to their high performance and low price. In recent years, another kind of data-intensive processing chip DSP has appeared. Because of its special structure, special hardware multipliers and special instructions, DSP can quickly realize various digital signal processing and meet various high real-time requirements. With the increasing complexity of modern embedded systems, operating systems have become an indispensable part of embedded systems. Free embedded operating systems, such as Linux, have developed rapidly with their continuous improvement. Linux is a free, powerful, reliable, scalable and extensible operating system. Linux implements many theories of modern operating systems, and supports complete hardware drivers, network communication protocols and multi-processor architecture. The open source code is more conducive to operating system embedded applications.

Based on the above analysis, the author developed a dual-core embedded system based on ARM and DSP chips. The system makes full use of the respective characteristics of ARM and DSP. It can use ARM and DSP chips for collaborative development, or use ARM or DSP for independent development. The operating system chooses Linux, in order to facilitate to give full play to the efficiency of the system.

1 Overall design of the system

Due to the strong control performance of ARM chips, ARM is mainly used for control and a small amount of data processing in embedded systems. In this way, on the one hand, the CPU is required to have low power consumption and sufficient clock frequency to run the operating system to meet the portable requirements; Based on the above considerations, HY7202 is selected as the CPU in the development platform.

As the data operation part, DSP can give full play to its unique advantages in digital signal processing. TI’s C54xx series 16-bit fixed-point DSP is widely used in various communication and portable applications with its high cost performance. Considering the processing requirements for large data throughput applications such as digital video and digital images, TI’s TMS320C5416 chip is selected. Its clock frequency can reach up to 206 MHz, and the overall block diagram of the system is shown in Figure 1.

Design of Communication Interface Based on DSP/ARM Dual Core System

The structure of the system software platform is shown in Figure 2. The software platform is divided into ARM part and DSP part, as well as the interface software design part of ARM and DSP. The ARM part uses ARM Linux Version 2.4.18 of Hynix’s PATCH as the operating system, and transplants the Linux standard library GLIBC, LIBJPG, LIBPNG, IMLIB, LIBWWW, LIBFLASH and Chinese character library on this basis. The graphical interface provides an embedded graphical interface platform with Microwindows 0.9 and its control library FLNX. The system platform has a powerful network communication function, through the platform WEBSERVER, FTP, TELNET, INETD and other network tools and applications can easily develop Internet-based network terminal, remote control, remote data acquisition, remote data processing products. On the application layer, the system platform integrates the window management program, the full Chinese culture web browser (supports HTML, XML), Flash player (supports Flash4, Flash5, Flash6), text editors, games, etc. for PDA development, set-top boxes Internet access solutions, and virtual oscilloscopes that can be used for embedded data acquisition and processing.

The DSP part provides a complete HPI driver (DSP part) and communication protocol, adds the corresponding data processing program control algorithm program, and uses the HPI parallel interface to communicate with the host ARM for data exchange, which can be used in various real-time processing and control fields.

In addition, DSP and ARM can each be used as independent systems, and they all have complete subsystem software. The core of the connection between the subsystems is the HPI interface that the DSP device itself has.

2 Communication interface design of ARM and DSP

(1) Introduction of HPI port of DSP

HPI is a parallel port provided by chips such as TMS320C54X, which is specially used for parallel communication between DSP and external host. The HPI interface includes a standard HPI interface and an enhanced HPI interface. For the C5416 and C5420DSP devices, their host interface is an enhanced host interface. The standard HPI interface is an 8-bit bus interface that combines 2 8-bit bytes to form a 16-word. The enhanced HPI interface is divided into 8-bit and 16-bit. The 8-bit enhanced host interface is the same as the standard HPI interface, the main difference is that the standard type can only access 2 KB dedicated RAM, while the enhanced type can access the entire RAM area of ​​the DSP. The 16-bit enhanced HPI interface uses a 16-bit bus, and only one host operation can complete the access operation.

(2) HPI hardware connection

Design of Communication Interface Based on DSP/ARM Dual Core System

The interface circuit between HMS30C7202 and TMS320C5416 is shown in Figure 3. The system addresses all the control registers, address registers and data registers of the HPI interface uniformly, and maps them to the I/O memory space starting from the physical address 0X0C000000 of the HMS30C7202.

Use address line RA[3:0]Generates control signals required for HPI access. A0 and A1 determine the access register type. A2 decides whether to access the first byte or the second byte: when A2=0, it means the written data is the first byte; when A2=1, it means the written data is the second byte . In HPI-8, all address lines and control lines are sampled at the falling edge of HDS1 and HDS2, not determined by HR/W, so HR/W indicates whether the current operation is read or write through address line A3, and the data latch signal It is co-produced by nRCS3 and nRW0. KSCAN[2]Set as the PORTA interrupt input pin of HMS30C7202, the DSP communicates with the Linux bottom HPI driver through interrupt mode.

3 ARM and DSP communication interface driver design

Linux is a variant of the Unix operating system. The principle and idea of ​​writing driver program under Linux is completely similar to other Unix systems, but it is very different from the driver program under DOS or Window environment. Linux drivers can be compiled into the kernel, or dynamically added and unloaded in the form of modules. This feature of Linux can cut the kernel according to the target system, which is more suitable for embedded systems.

(1) Basic principles of Linux drivers

In Linux, all devices are divided into three types: character device, block device and network device. All devices are regarded as ordinary files, so they can be opened, closed, read and written by using the same system calls to manipulate ordinary files. Each device in the system is represented by a device special file.

In Linux, a device driver is a collection of related functions. It contains device service subroutines and interrupt handlers, each device service subroutine handles only one device or a closely related device. Its purpose is to accept abstract commands from device-independent software and execute them. When a request is executed, the specific operation is based on the interface provided by the controller driver, and the interrupt mechanism is used to call the interrupt service subroutine to cooperate with the device to complete the request. Device programs are associated with the file system using the structure file_operations. The driver loading under Linux is shown in Figure 4.

Design of Communication Interface Based on DSP/ARM Dual Core System

(2) HPI driver

The HPI interface can use the I/O port method or the I/O access method. The system platform adopts I/O access mode, which maps HPI access control register, data register and address register to the space starting from the memory physical address 0X0C000000, and operates HPI through memory access instructions. The specific physical address of HPI is defined as follows:

#defineHPI_BASE0X0C000000//HPI base address
#define HPD_READ_LOWHPI_BASE+0X0012
//Read the first byte of the data register ?
#define HPA_WRITE_HIGHHPI_BASE+0X000C
//write the second byte of the address register

Under Linux, similar to Windows, programs cannot directly access physical addresses. The device driver is a part of the kernel, it runs in the kernel mode like other code in the kernel, if the driver fails, it will seriously damage the system, so the physical address needs to be mapped to the kernel space. Implemented under Linux by virtual_address=(u32)ioremap (HPI_BASE, HPI_LENGTH). The main structure of the driver is as follows:

struct file_operations hpi_fops={
owner:THIS_MODULE,
read: hpi_read,
write: hpi_write,
poll : hpi_poll,
open: hpi_open,
release: hpi_release,
};

The HPI communication protocol adopts a frame structure. Since the enhanced HPI interface allows access to all the space of the internal RAM of the DSP, the system communication allocates 2 K words (16 bits) as the frame buffer in the DSP, and reads and writes 1 K words each. The protocol adopts a one-bit sliding Window Protocol. The frame format is listed in Table 1.

Design of Communication Interface Based on DSP/ARM Dual Core System

4 Conclusion

This paper introduces the hardware platform of the dual-core embedded system composed of ARM and DSP dual CPUs, and the method of using Linux with open source code as the operating system in the embedded system. The overall block diagram of the system design is given, and the ARM and DSP are introduced in detail. Design of communication interface. This design method can be applied to the design of most modern embedded systems and has certain practical value.