Design of communication interface of dual-core system based on DSP/ARM

The core of embedded system is embedded microprocessor and embedded operating system. The core of the early embedded system hardware is various types of 8-bit and 16-bit single-chip microcomputers; in recent years, 32-bit processors have been widely used due to their high performance and low price. In recent years, another type of data-intensive processing chip DSP has appeared. Due to its special structure, special hardware multiplier 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 is various types of 8-bit and 16-bit single-chip microcomputers; in recent years, 32-bit processors have been widely used due to their high performance and low price. In recent years, another type of data-intensive processing chip DSP has appeared. Due to its special structure, special hardware multiplier 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 expandable operating system. Linux implements many modern operating system theories, and supports a complete hardware driver, network communication protocol 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 either use ARM and DSP chips for collaborative development, or use ARM or DSP for independent development. Linux is selected as the operating system, in order to give full play to the efficiency of the system.

1 The overall design of the system

Because of 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 requirements of portability; on the other hand, it is also required to have enough kinds of interfaces to facilitate the expansion of performance. Based on the above considerations, HY7202 is selected as the CPU in the development platform.

As the data computing 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. Taking into account 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 206 MHz at most, the overall block diagram of the system is shown as in Fig. 1.

Design of communication interface of dual-core system based on DSP/ARM

The system software platform structure is shown in Figure 2. The software platform is divided into ARM part and DSP part, and the interface software design part of ARM and DSP. The ARM part uses Hynix PATCH’s ARM Linux Version 2.4.18 as the operating system, and transplants Linux standard libraries GLIBC, LIBJPG, LIBPNG, IMLIB, LIBWWW, LIBFLASH and Chinese character libraries 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, it is convenient to develop Internet-based network terminals, remote control, remote data collection, and remote data processing products. At the application level, the system platform integrates window management programs, Chinese cultural web browsers (supports HTML, XML), Flash players (supports Flash4, Flash5, Flash6), text editors, games, etc. for PDA development, set-top boxes Internet 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, increases 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 both have complete subsystem software. The core of the connection between the subsystems is the HPI interface of the DSP device itself.

2 ARM and DSP communication interface design

(1) Introduction of HPI port of DSP

HPI is a kind of parallel port provided by chips such as TMS320C54X, which is specially used for parallel communication between DSP and external host. HPI interface has standard HPI interface and enhanced HPI interface. For C5416 and C5420DSP devices, their host interface is an enhanced host interface. The standard HPI interface is an 8-bit bus interface, which forms a 16-word by combining 2 8-bit bytes. The enhanced HPI interface is divided into two types: 8-bit and 16-bit. The 8-bit enhanced host interface has the same operating sequence as the standard HPI interface. The main difference is that the standard type can only access 2 KB of 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

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

Design of communication interface of dual-core system based on DSP/ARM

Use address line RA[3:0]Generate control signals required for HPI access. A0 and A1 determine the type of register to be accessed. A2 decides whether to access the first byte or the second byte: when A2=0, the data written is the first byte; when A2=1, the data written is the second byte . In HPI-8, all address lines and control lines are sampled on the falling edges of HDS1 and HDS2, not determined by HR/W, so HR/W indicates whether the current operation is read or write through the address line A3, and the data latch signal It is produced by nRCS3 and nRW0 after phase and together. KSCAN[2]Set as the PORTA interrupt input pin of HMS30C7202, DSP communicates with 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 a driver under Linux is completely similar to other Unix systems, but it is very different from the driver under DOS or Window environment. Linux drivers can be compiled into the kernel, or they can be dynamically added and unloaded in the form of modules. This feature of Linux can reduce the kernel according to the target system, which is more suitable for embedded systems.

(1) Basic principles of Linux driver

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

In Linux, a device driver is a collection of related functions. It contains equipment service subroutines and interrupt handling routines. Each equipment service subroutine deals with only one type of equipment or closely related equipment. Its purpose is to accept abstract commands and execute them from software that has nothing to do with the device. 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. The equipment program uses the structure file_operations to link with the file system. Driver loading under Linux is shown in Figure 4.

Design of communication interface of dual-core system based on DSP/ARM

(2) HPI driver

HPI interface can use I/O port mode, and I/O access mode can also be used. The system platform adopts I/O access mode, maps HPI access control registers, data registers, and address registers to the space starting with the memory physical address 0X0C000000, and operates HPI by accessing memory 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, the program cannot directly access the physical address. The device driver is a part of the kernel. It runs in kernel mode like other codes in the kernel. If the driver makes a mistake, the system will be severely damaged. Therefore, it is necessary to map the physical address to the kernel space. Under Linux, it is implemented by virtul_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 internal RAM space of the DSP, the system communication allocates 2 K words (16 bits) inside the DSP as the frame buffer, and reads and writes 1 K words each, and the protocol uses one bit sliding Window protocol. The frame format is listed in Table 1.

Design of communication interface of dual-core system based on DSP/ARM

The Links:   LQ10D41 LP150X10-A3K2

Author: Yoyokuo