Professional Documents
Culture Documents
田 华
653528817@qq.com
课程特点、主要内容及学习目标 Cour
se characteristics, main content an
d learning objectives
课程特点:软硬件并重、实践性强的特点
学习目标:掌握嵌入式系统的相关软硬件知识、初步具备嵌入式系统
软硬件设计能力,为今后从事嵌入式系统研究与开发打下良好的基础
Course features: equal emphasis on software and hardware, strong
practical characteristics
( 1 )裸板程序开发(无操作系统)
Keil for ARM
闭卷考试
平时成绩 40% :
学习通预习 + 出勤 + 随堂测试 + 作业 + 小测
+ 项目设计
期末成绩 60%
Closed book exam
Normal grade 40%:
第 1 章 嵌入式系统基础知识
计算机系统( Computer System )
嵌入式系统( Embedded System )
嵌入式系统( Embedded System )
1.1 嵌入式系统的定义和组成
1.1.1 嵌入式系统的定义
IEEE (国际电气和电子工程师协会)给出的定义
以应用为中心、以计算机技术为基础,软件硬件可裁
剪,适应应用系统对功能、可靠性、成本、体积、功耗严格
要求的专用计算机系统。嵌入式系统是一种专用的计算机系
统,作为装置或设备的一部分。
Application-centric and computer-based, software and
hardware can be tailored to meet the application syste
m's strict requirements for function, reliability, cost, vol
ume, and power consumption. An embedded system is
a dedicated computer system as a part of a device or e
到对象体系中的专用计算机系统” The definition of
embedded system by Professor Limin He of Beijing
University of Aeronautics and Astronautics: "dedicated
computer system embedded in the object system"
对象体系是指嵌入式系统所嵌入的宿主系统。
The object system refers to the host system
embedded in the embedded system.
“ 嵌入性”、“专用性”与“计算机系统”是嵌
入式系统的 3 个基本要素。
"Embeddedness", "speciality" and "computer
system" are the three basic elements of
embedded systems.
嵌入式系统一般由以下 4 个部分组成:
嵌入式微处理器
外围硬件设备
嵌入式操作系统
用户应用程序
Embedded systems generally consist of the following
4 parts:
Embedded microprocessor
Peripheral hardware equipment
1 .嵌入式系统的发展历史( 4 个阶段) 1. Th
e history of embedded system developme
nt (4 stages)
( 1 )无操作系统阶段( 20 世纪 60 年代)
(1) No operating system stage (1960s)
单片机作为微控制器
单线程的程序
完成监测、伺服和设备指示等多种功能
一般没有操作系统的支持
程序设计多采用汇编语言
MCU as a microcontroller
Single-threaded program
Complete multiple functions such as monitoring, servo and
equipment instructions
Generally not supported by the operating system
Assembly language
简便、价格低廉,在工业控制领域中得到了非常广泛的应用
Simple and inexpensive, it has been widely used in the field of
industrial control
( 2 )简单操作系统阶段( 20 世纪 80 年代)
一些简单的嵌入式操作系统开始出现并得到迅速发展。
操作系统虽然还比较简单,但已经初步具有了一定的兼容性和扩展
性,内核精巧且效率高,大大缩短了开发周期,提高了开发效率。
(2) Simple operating system stage (1980s)
系统能够运行在各种不同类型的微处理器上,具备文件管理、设
备管理、多任务、网络、图形用户界面等功能,并提供了大量的应用程
序接口( API ),使应用软件的开发变得更加简单。
分布控制、柔性制造、数字化通信、信息家电等。
Hardware real-time requirements have increased, the software
scale of embedded systems has expanded, and real-time
multitasking operating systems have gradually formed.
( 1 )新的微处理器层出不穷,精简系统内核,优化关键算法,降
低功耗和软硬件成本。
( 3 )嵌入式系统的开发成了一项系统工程,开发厂商提供强大的
硬件开发工具和软件支持包。
(1) New microprocessors emerge in endlessly, streamline syst
em cores, optimize key algorithms, and reduce power consum
ption and hardware and software costs.
硬件层
中间层
系统软件
应用软件层
Embedded computer system is the core of the entire
embedded system, divided into
Hardware layer
middle layer
system software
Application software layer
执行装置(被控对象):接受嵌入式计算机系统发出的控制命令,
执行所规定的操作或任务。 Execution device (controlled object):
accepts the control command issued by the embedded
computer system, and executes the specified operation or
1 .嵌入式计算机系统的硬件层
1. Hardware layer of embedded computer
system
硬件层通常以嵌入式处理器为中心,包含有电源电路、时钟
电路和存储器电路的电路模块,操作系统和应用程序固化在
模块的 ROM 中。
The hardware layer includes embedded microprocessor
s, memories (SDRAM, ROM, Flash, etc.), general equipm
ent interfaces and I/O interfaces (A/D, D/A, I/O, etc.).
( 2 )存储器
嵌入式系统的存储器包含
Cache
主存储器
辅助存储器
The memory of the embedded system contains
Cache
Main memory
Auxiliary storage
①Cache
位于主存储器和嵌入式微处理器内核之间的快速存储器阵列
存放的是最近一段时间微处理器使用最多的程序代码和数据
。
Fast memory array located between main memory and
embedded microprocessor core
Stored is the most recently used program code and data of
the microprocessor.
微处理器尽可能的从 Cache 中读取数据,而不是从主存中读取,
提高微处理器和主存之间的数据传输速率。 The microprocessor
reads data from the Cache as much as possible, rather than from
the main memory, which improves the data transfer rate between
the microprocessor and the main memory.
用来存放系统和用户的程序及数据
嵌入式微处理器能直接访问
包含 ROM 和 RAM ,可以位于微处理器的内部或外部。
常用的 ROM 类存储器有 NOR Flash 、 EPROM 和 PROM 等
RAM 类存储器有 SRAM 、 DRAM 和 SDRAM 等。
Used to store system and user programs and dat
a
Embedded microprocessor can directly access
Contains ROM and RAM, which can be located in
side or outside the microprocessor.
③ 辅助存储器
③Auxiliary memory
嵌入式系统与外界交互所需要的通用设备接口
GPIO 、 A/D 、 D/A 接口
RS-232 接口、 Ethernet
USB 接口
音频接口、 VGA 视频输出接口
I2C (现场总线)
SPI (串行外围设备接口)
IrDA (红外线接口)等。
(3) General equipment interface and I/O interface
General equipment interface needed for embedded system to
interact with the outside world
GPIO, A/D, D/A interface
RS-232 interface, Ethernet
omputer system
中间层也称为硬件抽象层( Hardware Abstract Layer , HAL )
或板级支持包( Board Support Package , BSP )
The middle layer is also called Hardware Abstract Layer (HA
L) or Board Support Package (BSP)
BSP 是一个介于操作系统和底层硬件之间的软件层次,包括了系统
中大部分与硬件联系紧密的软件模块。
BSP is a software level between the operating system and the
underlying hardware, including most of the software modules
in the system that are closely related to the hardware.
系统软件层通常包含有
嵌入式操作系统 ( EOS )
文件系统
图形用户接口( GUI )
网络系统
通用组件模块
The system software layer usually includes
EOS 负责嵌入式系统的软件、硬件的资源分配、任务调度,控制协调。
除了具备一般操作系统最基本的任务调度、同步机制、中断处理、文
件处理等功能外,还有如下特点:
实时性强;
支持开放性和可伸缩性的体系结构,具有可裁减性;
提供统一的设备驱动接口;
提供操作方便、简单、友好的图形 GUI 和图形界面;
支持 TCP/IP 协议及其他协议,提供 TCP/UDP/IP/PPP 协议支持及统一的 MAC
访问层接口,提供强大的网络功能;
嵌入式操作系统的用户接口通过系统的调用命令向用户程序提供服务;
嵌入式系统一旦开始运行就不需要用户过多的干预;
嵌入式操作系统和应用软件被固化在嵌入式系统计算机的 ROM 中;
具有良好的硬件适应性(可移植性)。
Strong real-time;
Support openness and scalability of the system structure, with scalability;
Provide a unified device driver interface;
Provide convenient, simple and friendly graphical GUI and graphical interfac
e;
2 )文件系统
(File System , FS)
与通用操作系统的文件系统不完全相同,主要提供文件存储、检索
和更新等功能,一般不提供保护和加密等安全机制。
可以方便的挂接不同存储设备的驱动程序,支持多种存储设备。
以系统调用和命令方式提供文件的各种操作
It is not exactly the same as the file system of a general opera
ting system. It mainly provides functions such as file storage,
retrieval, and update. Generally, it does not provide security
mechanisms such as protection and encryption.
3 )图形用户接口
( Graphic User Interface , GUI )
GUI 使用户可以通过窗口、菜单、按键等方式来方便地操作计算
机或者嵌入式系统。
QT 、 MiniGUI 等。
GUI allows users to conveniently operate a computer or em
bedded system through windows, menus, buttons, etc.
由所开发的应用程序组成,面向被控对象和用户。
为方便用户操作,通常需要提供一个友好的人机界面。
Used to realize the control function of the controlled object
RTOS 要求系统中的任务不但执行结果要正确,而且必
须在一定的时间约束( Deadline )内完成。
RTOS requires that the tasks in the system not
only have correct execution results, but also must
be completed within a certain time constraint
(Deadline).
1 . RTOS 定义
RTOS 是指能够在指定或者确定的时间内完成系统功
能和对外部或内部、同步或异步事件做出响应的系统
。
RTOS 的正确性不仅依赖于系统计算的逻辑结果,还
依赖于产生这个结果的时间。
RTOS refers to a system that can complete syste
m functions and respond to external or internal, s
ynchronous or asynchronous events within a spe
cified or determined time.
( 1 )约束性
RTOS 任务的约束包括
时间约束
资源约束
执行顺序约束
性能约束。
(1) Constraint
The constraints of RTOS tasks include
Time constraint
Resource constraints
Execution order constraint
( 2 )可预测性
RTOS 完成实时任务所需要的执行时间应是可知的。
可预测性包括
硬件时延的可预测性
软件系统的可预测性
(2) Predictability
The execution time required for RTOS to complet
e real-time tasks should be known.
Predictability includes
Predictability of hardware delay
( 3 )可靠性
大多数 RTOS 要求有较高的可靠性,要求系统在最坏情况下都能正常工
作或避免损失。可靠性是 RTOS 的重要性能指标。
( 4 )交互性
嵌入式计算机系统作为控制系统,必须在规定的时间内对被控子系统请
求做出反应。
被控子系统也必须能够正常工作或准备对任何异常行为采取动作。
(3) Reliability
Most RTOSs require high reliability and require the system to wor
k normally or avoid losses in the worst case. Reliability is an impo
rtant performance indicator of RTOS.
(4) Interactivity
As the control system, the embedded computer system must resp
ond to the request of the controlled subsystem within the specifie
d time.