The core of embedded systems is embedded microprocessors and embedded operating systems. The hardware core of early embedded systems was various types of 8-bit and 16-bit single-chip microcomputers; in recent years, 32-bit processors have been widely used for their high performance and low price. In recent years, another type of data-intensive processing chip, DSP, has emerged. Due to its special structure, specialized hardware multiplier and special instructions, DSP can quickly implement 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 modern operating system theories and supports complete hardware drivers, network communication protocols and multi-processor architectures. The disclosure of its source code is more conducive to the embedded application of operating systems.
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. Linux is selected as the operating system to give full play to the system's performance.
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. Therefore, 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 a sufficient variety of interfaces to facilitate performance expansion. 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 communications and portable applications with its high cost performance. Considering the processing requirements of 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. The overall system block diagram is shown in Figure 1.
The structure of the system software platform is shown in Figure 2. The software platform is divided into the ARM part and the DSP part, as well as the interface software design part between ARM and DSP. The ARM part uses the ARM Linux Version 2.4.18 of Hynix's PATCH as the operating system, and on this basis, the Linux standard libraries GLIBC, LIBJPG, LIBPNG, IMLIB, LIBWWW, LIBFLASH and Chinese character library are transplanted. The graphical interface uses Microwindows 0.9 and its control library FLNX to provide an embedded graphical interface platform. The system platform has powerful network communication functions. Through the platform WEBSERVER, FTP, TELNET, INETD and other network tools and applications, it can easily develop Internet-based network terminals, remote control, remote data acquisition, and remote data processing products. At the application layer, the system platform integrates window management programs, a full Chinese network browser (supporting HTML and XML), a Flash player (supporting Flash4, Flash5, and Flash6), a text editor, games, etc. for PDA development, set-top box Internet access solutions, and a virtual oscilloscope that can be used for embedded data acquisition and processing.
The DSP part provides a complete HPI driver (DSP part) and communication protocol, adds corresponding data processing control algorithm program, and uses HPI parallel interface to communicate with host ARM for data exchange, which can be used in various real-time processing and control fields.
In addition, DSP and ARM can be used as independent systems, and they both have complete subsystem software. The core of the connection between subsystems is the HPI interface of the DSP device itself.
2 Communication interface design between ARM and DSP
(1) Introduction to DSP HPI port
HPI is a parallel port provided by TMS320C54X and other chips, 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 C5420 DSP devices, their host interface is enhanced host interface. Standard HPI interface is an 8-bit bus interface, which forms a 16-word by combining 2 8-bit bytes. Enhanced HPI interface is divided into 8-bit and 16-bit. The operation timing of 8-bit enhanced host interface is the same as that of 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 DSP. 16-bit enhanced HPI interface uses 16-bit bus, and the access operation can be completed with just one host operation.
(2) HPI hardware connection
The interface circuit between HMS30C7202 and TMS320C5416 is shown in Figure 3. The system uniformly addresses all control registers, address registers, and data registers of the HPI interface and maps them to the I/O memory space starting from the physical address 0X0C000000 of HMS30C7202.
The address lines RA[3:0] are used to generate the control signals required for HPI access. A0 and A1 determine the register type to be accessed. A2 determines whether the first byte or the second byte is accessed: when A2=0, it indicates that the data written is the first byte; when A2=1, it indicates that the data written is the second byte. In HPI-8, all address lines and control lines are sampled at the falling edge of HDS1 and HDS2, rather than determined by HR/W. Therefore, HR/W indicates whether the current operation is read or write through address line A3, and the data latch signal is generated by nRCS3 and nRW0 after ANDing. KSCAN[2] is set as the PORTA interrupt input pin of HMS30C7202, and the DSP communicates with the Linux underlying HPI driver through interrupts.
3 Design of communication interface driver for ARM and DSP
Linux is a variant of the Unix operating system. The principles and ideas of writing drivers under Linux are completely similar to those of other Unix systems, but they are very different from drivers under DOS or Window environments. Linux drivers can be compiled into the kernel, or dynamically added and uninstalled in the form of modules. This feature of Linux can tailor the kernel according to the target system, making it 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 treated as ordinary files, so they can be opened, closed, read, and written to by the same system calls as 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 only handles one device or closely related devices. Its purpose is to accept abstract commands from device-independent software and execute them. When executing a request, 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 device program uses the structure file_operations to connect to the file system. Driver loading under Linux is shown in Figure 4.
(2) HPI driver
The HPI interface can be used in I/O port mode or I/O access mode. The system platform uses I/O access mode to map the HPI access control register, data register, and address register to the space starting at the physical address of the memory 0X0C000000, and operate the HPI through the memory access instruction. 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
In Linux, similar to Windows, programs cannot directly access physical addresses. Device drivers are part of the kernel and run in kernel mode like other code in the kernel. If the driver fails, the system will be seriously damaged, so the physical address needs to be mapped to the kernel space. In Linux, this is achieved through 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 uses a frame structure. Since the enhanced HPI interface allows access to all RAM spaces inside the DSP, the system communication allocates 2 K words (16 bits) inside the DSP as a frame buffer, with 1 K words for reading and writing, and the protocol uses a one-bit sliding window protocol. The frame format is listed in Table 1.
Conclusion
This paper introduces the hardware platform of dual-core embedded system composed of ARM and DSP dual CPU, and the method of using open source Linux as the operating system in embedded system, gives the overall block diagram of system design, and introduces the design of ARM and DSP communication interface in detail. This design method can be applied to the design of most modern embedded systems and has certain practical value.
Previous article:Method of Implementing FlexRay Bus on Embedded DSP
Next article:Converged processors provide core platform for smart grid
Recommended ReadingLatest update time:2024-11-16 18:01
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- The disappearing boundary between MCU and MPU
- DS18B20 STM32G474 driver
- 【Fudan Micro FM33LC046N】Clock output test
- Python Basics: Dictionary Application
- A brief introduction to vehicle-mounted domain controllers
- Design of LED emergency lighting controller based on MSP430
- Disassembly of Taiwan TES-1316 temperature meter with temperature recording function
- Allwinner R528 core board and development board
- Pay attention when drawing and punching PCB!!
- Introduction to Multithreaded Programming in Embedded Systems