1 Definition of Embedded Systems
An embedded system is a specialized computer system that is part of a device or equipment. Typically, an embedded system consists of a control program stored in ROM on an embedded processor control board. In fact, all devices with digital interfaces, such as watches, microwaves, video recorders, and cars, use embedded systems. Some embedded systems also contain operating systems, while others implement the entire control logic with a single program (bare metal). Embedded systems are a combination of software and hardware, which can be tailored to meet the strict requirements of application systems regarding functionality, reliability, cost, size, and power consumption.
2 Components of Embedded Systems
2.1 Hardware Layer
The hardware layer includes embedded microprocessors, memory (SDRAM, ROM, Flash, etc.), general device interfaces, and I/O interfaces (A/D, D/A, I/O, etc.). Adding power circuits, clock circuits, and memory circuits to an embedded processor forms an embedded core control module. Both the operating system and application programs can be stored in ROM.
2.1.1 Embedded Microprocessor
The architecture of embedded microprocessors can adopt either the Von Neumann architecture or the Harvard architecture; the instruction set can choose between Reduced Instruction Set Computer (RISC) and Complex Instruction Set Computer (CISC). RISC computers contain only the most useful instructions in the channel, ensuring that the data channel quickly executes each instruction, thereby improving execution efficiency and simplifying CPU hardware design.
There are over 1000 types of embedded microprocessors worldwide, with more than 30 architectural series, among which mainstream architectures include ARM, MIPS, PowerPC, X86, etc.
2.1.2 Memory
Embedded systems require memory to store and execute code. The memory of embedded systems includes Cache, main memory, and auxiliary storage.
1>Cache
Cache is a small-capacity, high-speed memory array located between the main memory and the embedded microprocessor core, storing the program code and data most frequently used by the microprocessor over a period of time. When data read operations are needed, the microprocessor attempts to read data from Cache rather than from main memory, significantly improving system performance and increasing the data transfer rate between the microprocessor and main memory. The main goal of Cache is to reduce the memory access bottleneck posed by memory (such as main memory and auxiliary storage) to the microprocessor core, making processing faster and more real-time.
In embedded systems, Cache is entirely integrated into the embedded microprocessor and can be divided into data Cache, instruction Cache, or mixed Cache, with the size of Cache varying depending on the processor. Generally, mid- to high-end embedded microprocessors will integrate Cache.
2>Main Memory
Main memory is the register that the embedded microprocessor can directly access, used to store system and user programs and data. It can be located inside or outside the microprocessor, with a capacity ranging from 256KB to 1GB, depending on specific applications; generally, on-chip memory has a small capacity but is fast, while off-chip memory has a large capacity.
Common types of memory used as main memory include:
ROM types such as NOR Flash, EPROM, and PROM.
RAM types such as SRAM, DRAM, and SDRAM.
3>Auxiliary Storage
Auxiliary storage is used to store large amounts of program code or information; it has a large capacity but is much slower than main memory, used for long-term storage of user information.
Common external storage used in embedded systems includes: hard disks, NAND Flash, CF cards, MMC, and SD cards.
2.1.3 General Device Interfaces and I/O Interfaces
Embedded systems need a certain form of general device interfaces, such as A/D, D/A, I/O, to interact with the outside world. Peripherals achieve the input/output functions of the microprocessor by connecting to other devices or sensors outside the chip.Each peripheral usually has only a single function, and it can be either external to the chip or built into the chip.There are many types of peripherals, ranging from simple serial communication devices to very complex 802.11 wireless devices.
Commonly used general device interfaces in embedded systems include A/D (analog-to-digital conversion interface), D/A (digital-to-analog conversion interface), and I/O interfaces such as RS-232 (serial communication interface), Ethernet (network interface), USB (universal serial bus interface), audio interfaces, VGA video output interfaces, I2C (field bus), SPI (serial peripheral interface), and IrDA (infrared interface).
2.2 Intermediate Layer
The intermediate layer, also known as the Hardware Abstract Layer (HAL) or Board Support Package (BSP), separates the upper software from the lower hardware, allowing the system’s lower driver programs to be hardware-independent. Upper software developers do not need to care about the specific situation of the lower hardware and can develop according to the interfaces provided by the BSP layer. This layer generally includes initialization of relevant lower hardware, input/output operations of data, and configuration functions of hardware devices. BSP has the following two characteristics.
Hardware Correlation: Because the hardware environment of embedded real-time systems has application relevance, as the interface between upper software and hardware platform, BSP needs to provide methods for the operating system to operate and control specific hardware.
Operating System Correlation: Different operating systems have their own software hierarchy, and therefore, different operating systems have specific hardware interface forms.
In fact, BSP is a software layer between the operating system and the underlying hardware, including most software modules closely related to hardware in the system. Designing a complete BSP requires completing two parts of work: hardware initialization of the embedded system and BSP functionality, designing hardware-related device drivers.
2.3 Software Layer
2.3.1 System Software Layer
The system software layer consists of real-time multitasking operating systems (RTOS), file systems, graphical user interfaces (GUI), network systems, and general component modules. RTOS is the foundation and development platform for embedded application software.
2.3.2 Application Software Layer
The application software layer consists of applications developed based on real-time systems, used to implement control functions for the controlled objects. The functional layer faces the controlled objects and users, and to facilitate user operations, it often needs to provide a friendly human-machine interface.
3 Initialization of Embedded Systems
The system initialization process can be divided into three main stages, in the order from bottom to top, from hardware to software: chip-level initialization, board-level initialization, and system-level initialization.
3.1 Chip Level
Complete the initialization of the embedded microprocessor, including setting the core registers and control registers of the embedded microprocessor, the core operating mode of the embedded microprocessor, and the local bus mode of the embedded microprocessor, etc. Chip-level initialization gradually sets the embedded microprocessor from the default state upon power-on to the working state required by the system. This is a purely hardware initialization process.
3.2 Board Level
Complete the initialization of other hardware devices outside the embedded microprocessor. Additionally, some software data structures and parameters need to be set to establish the hardware and software environment for subsequent system-level initialization and application program execution. This is an initialization process that includes both software and hardware.
3.3 System Level
BSP transfers control of the embedded microprocessor to the embedded operating system, which completes the remaining initialization operations, including loading and initializing hardware-independent device drivers, establishing system memory areas, and loading and initializing other system software modules such as network systems, file systems, etc. Finally, the operating system creates an application program environment and hands over control to the entry point of the application program.
4 Project Management Process
Embedded system project management is divided into: project initiation –> project planning –> project implementation –> project closure –> project maintenance.
The specific nodes are as follows:
Product initiation report –> product feasibility analysis report –> preliminary design (preparation of preliminary schedule) –> detailed hardware design –> detailed software design –> detailed structural design –> prototype production –> software self-test (verification phase) –> “test outline” and testing –> formation of production documents –> document archiving –> small batch trial production –> mass production –> final document archiving.
5 Development Process
Project requirements –> system proposal (proposal review) –> scheme design (design specification) –> hardware and software development (development documentation) –> principle prototype (test report) –> engineering prototype (test report) –> type testing or certification (test summary report or certification certificate) –> R&D phase acceptance.
6 Productization Process
Design data import (Sch, PCB, Gerber, BOM, CAD, etc.) –> production process documentation (gerber, SMT, BOM (COST Down), operation instructions) –> testing documentation (testing requirements, testing records, product inspection standards, etc.) –> yield (first pass rate, yield rate, pass rate, etc.) –> after-sales quality tracking –> quality issue feedback and continuous improvement –> version iteration.
7 Practical Examples of Hardware-Software Integration
7.1 Core System Self-Check (Abnormal Process Handling Indication)
7.2 Peripheral Initialization (GPRS Power-On Timing; Power Distribution)
7.3 Working State Switching (Register Flipping, Hardware Defect Compensation, Leakage Control, etc.)
7.4 Interrupt Handling (Overvoltage and Overcurrent Protection, Abnormal Handling)
7.5 Circuit Component Level Reliability Design (I2C Dead Loop Problem: Defects of Single Condition Judgment, Need for Timer Involvement)
7.6 System Level Reliability Design (Communication Command Redundancy, Global Reset Command Resending)
7.7 Simple Applications (A/D Precision (12BIT–>10BIT))
7.8 Cost-Effectiveness Improvement (Button Debouncing, Electrostatic Protection (Hardware Inherent Features))
7.9 Functional Expansion and Reuse (Variable Tone Buzzer (PWM), Variable Frequency LED, etc. (Hardware Function Expansion))
7.10 Advanced Applications (Image Compression, MPEG-1, -2, -4, H.263, H.264, Digital Filtering, uV Level Amplification Filtering Circuit Design)
Statement:This article is original by the author, and the content of the article is the author’s personal opinion. The Electronic Enthusiast Network reproduces it only to convey a different viewpoint and does not represent the Electronic Enthusiast Network’s endorsement or support of this viewpoint. If there are any objections, please feel free to contact the Electronic Enthusiast Network.
-
HIT and others banned from using MATLAB, how strong is the domestic software that claims to replace it?
-
One year after the opening of the Science and Technology Innovation Board, nearly 50 semiconductor companies summarized!
-
SSD pure domesticization is coming, main control chip manufacturers fully support!
-
5G XR game! What explosive points do Huawei, Qualcomm, and HTC bring to the table?
-
The latest global TOP500 supercomputer list is out! Revealing the expansion path of Nvidia’s dominance over two-thirds of the territory!