You are on page 1of 31

Embedded Systems

Overview Phan Duy Hng (PhD) ES Lecturer Hanoi FPT University

Content
What is an Embedded System ? Embedded System Structure General Characteristics of Embedded Systems Design Issues Design Metrics Essential Considerations Programming New trends in ES
2

What examples of embedded systems do you know ?

Examples

Telecommunication systems Consumer electronics Transportations systems Medical equipment


Embedded System

Example 1: The Domestic Fridge

An Embedded System
Compressor Control Alarm

The Embedded Computer

Display

Human Interaction Networked Interaction (Maybe!)

Actual Temperature Required Temperature

Example 2: Car Door Control, within a Larger Network


ight Door

window stall sensor

window control buttons

Dash Board
window motor lock control lock actuator

Climate Control Driver's eat

open door sensor

teering

Central Control

ir Bag

adio & CD

C N Bus Le t Door

Example 3: The Derbot Autonomous Guided Vehicle


Ultrasound Ranging Module
Pulse Echo

ump Sensor Left Light Sensor Left Light Sensor Rear PIC Power Regulation Management 9V Alkaline
9V 5V Serial Data

ump Sensor Right Light Sensor Right Ultrasound Servo

Analog to Digital Converter

Compass
Serial Clock Serial Extension us Pulse Width Modulation Stream x2

Microcontroller

Motor Drive Interface

Motor Left

Motor Right

Example 4: Electrocardiograph

What is an embedded system ?

wiki

An embedded system is a computer system designed to perform one or a few dedicated functions often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. In contrast, a general-purpose computer, such as a personal computer, is designed to be flexible and to meet a wide range of an end-user s needs.

10

Embedded System Structure


se te ace is la e a etc

Si al C iti i

e
ata e si

e C Software

te
t t i e t t Va ia les

ut Va ia les

Har ware

t e

ste s

An embedded system is a system whose principal function is not computational, but which is controlled by a computer embedded within it.
11

uP varieties

uController: includes
I/O devices On-board memory.

Digital signal processor (DSP):


Optimized for digital signal processing.

Typical embedded word sizes: 8-bit, 16-bit, 32-bit.

12

Characteristics General Characteristics Application Specific Characteristics DSP Characteristics Distributed Characteristics

13

Design Design Issues Design Metrics What is Co-design?

14

Knowledge ?

15

A Mix of Disciplines

Digital Electronics Analogue Electronics

Integrated Circuit Design

Computer Architecture Embedded Systems Software Engineering

Sensors and Measurements Electric Motors Actuators

Control Engineering

Data Communications

16

Essential Considerations

Real Time Systems Memory Organization Instruction Set Communication/I/O Interfaces Portability ? Low Power ( attery Life) Software, Tools

17

Real time system ?

18

Memory Organisation

Address

Data Memory
Data

Data Memory

Central Processing Unit (CPU)

Address

Input/ Output
Data

Central Processing Unit (CPU)

Address

Input/ Output
Data Address

Program Memory

Program Memory
Data

a) The Von Neumann Way

b) The Harvard Way

19

CPU Cache

20

What can the Computer Actually Do? - Instructions and Instruction Sets
A computer executes instructions in its Arithmetic Logic Unit (ALU), running through a series of instructions called a progr m. An ALU can only do a few things, but it can do them very fast. A typical 8-bit ALU can do the list shown below. A is the Accumulator, a digital register where the computations actually occur, and M is a location in memory. The ALU in turn forms part of the Central Processing Unit (CPU).

A D A A A M M A AND A w M O Aw M E O Aw A left Shift A right Rotate A left Rotate A right Complement A Clear A

A = A plus 1 A=A-1 A = A plus M A=A-M A=AM A=A+M A = A+ M A = 2A A=A2

A = NOT A A=0

21

How Instruction Sets are Made: the CISC Machine


Any CPU has a set of instructions that it recognises and responds to; all programs are built up in one way or another from this instruction set. We want computers to execute code as fast as possible, but how to achieve this aim is not always an obvious matter. One approach is to build sophisticated CPUs with exotic instruction sets, with an instruction ready for every foreseeable operation. This leads to the CISC, the Complex Instruction Set Computer. A CISC has many instructions, and considerable sophistication. Yet the complexity of the design needed to achieve this tends to lead to slow operation. One characteristic of the CISC approach is that instructions have different levels of complexity. Simple ones can be expressed in a short instruction code, say one byte of data, and execute quickly. Complex ones may need several bytes of code to define them, and take a long time to execute.

A CISC machine is generally recognised by: Many instructions (say over one hundred), some with considerable sophistication; Instruction words are of different length; Instructions take different lengths of time to execute.
22

How Instruction Sets are Made: the RISC Machine

Another approach is to keep the CPU very simple, and have a limited instruction set. This leads to the RISC approach the Reduced Instruction Set Computer. The instruction set, and hence overall design, is kept simple. This leads to fast operation. One characteristic of the RISC approach is that each instruction is contained within a single binary word. That word must hold all information necessary, including the instruction code itself, as well as any address or data information also needed. A further characteristic, an outcome of the simplicity of the approach, is that every instruction normally takes the same amount of time to execute.

A RISC machine is generally recognised by: Few instructions (say well below one hundred), Each performs a very simple action; All instructions are single word; All, or almost all instructions take the same length of time to execute.
23

Programming

Language features implemented for a particular platform Hardware Operating system Libraries Templates Excellent for embedded systems work As always, try to write the clearest, cleanest, most maintainable code

24

Complexity

25

Reliability

Embedded systems often reside in machines that are expected to run continuously for years without errors, and in some cases recover by themselves if an error occurs. Specific reliability issues may include: The system cannot safely be shut down for repair, or it is too inaccessible to repair. The system must be kept running for safety reasons. Often backups are selected by an operator. The system will lose large amounts of money when shut down.

26

New trends in ES HW

27

New trends in ES SW

28

The Microchip PIC Families

Details about the 8-bit PIC Architecture


Instructions and data are on separate buses, increasing speed and overall performance While fetching an instruction on the program bus, data can be read or written on the data bus Data bus is 8-bits wide Program Memory bus optimized to any widths that fit within the design goals of the microcontroller Wider busses allow more information to be transferred from memory to the CPU, enabling many instructions to be executed in a single clock cycle 12-bit ( aseline), 14-bit (Midrange) and 16-bit (PIC18) instructions are upward compatible and maximize processing efficiency
29

The Microchip PIC Families

dsPIC PIC24 PIC32

30

A Gathering of Microprocessors and Microcontrollers


Motorola 68HC05B16 PIC 16F877

PIC 16C72 PIC 16F84A

Motorola 68000

PIC 12F508

features also appear across all their microcontrollers, and knowledge of one family can lead with ease to knowledge of another
31

You might also like