c1 Intro Student Version

download c1 Intro Student Version

of 31

Transcript of c1 Intro Student Version

  • 8/6/2019 c1 Intro Student Version

    1/31

    1

    Embedded Systems

    Overview

    Phan Duy Hng (PhD)

    ES Lecturer Hanoi FPT University

  • 8/6/2019 c1 Intro Student Version

    2/31

    2

    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

  • 8/6/2019 c1 Intro Student Version

    3/31

    3

    What examples ofembedded systems do you know ?

  • 8/6/2019 c1 Intro Student Version

    4/31

    4

    Examples

    Telecommunication systems

    Consumer electronics

    Transportations systems

    Medical equipment

    EmbeddedSystem

  • 8/6/2019 c1 Intro Student Version

    5/31

    5

    Example 1: The Domestic Fridge

    The

    Embedded

    Computer

    An Embedded

    System

    Compressor Control

    Actual Temperature

    HumanInteraction

    Alarm

    Display

    Required Temperature

    Networked

    Interaction

    (Maybe!)

  • 8/6/2019 c1 Intro Student Version

    6/31

    6

    Example 2: Car Door Control, within a LargerNetwork

    Dash

    Board

    irBag

    adio

    Climate

    & CD

    Door

    Door

    teeringDriver's

    eat

    CentralControl

    C N Bus

    Control

    Le t

    ight

    open door sensor

    window control buttons

    lock controllock actuator

    window motor

    window stall sensor

  • 8/6/2019 c1 Intro Student Version

    7/31

    7

    PIC

    Pulse Width Modulation

    Serial Data

    SerialMicrocontroller

    Compass

    Motor Drive

    Interface

    Stream x2

    UltrasoundRanging

    Pulse Echo

    Motor

    ump Sensor

    Power

    Management

    Regulation

    9V

    Alkaline

    5V

    9V

    Right

    ump Sensor

    Left

    Light Sensor

    Left

    Light Sensor

    Right

    Analog to Digital

    Converter

    Left

    Motor

    Clock

    Module

    Serial Extension

    us

    Light Sensor

    Rear UltrasoundServo

    Right

    Example 3: The Derbot Autonomous Guided Vehicle

  • 8/6/2019 c1 Intro Student Version

    8/31

    8

    Example 4: Electrocardiograph

  • 8/6/2019 c1 Intro Student Version

    9/31

    9

    What is an embedded system ?

  • 8/6/2019 c1 Intro Student Version

    10/31

    10

    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 andto meet a wide range of an end-user s needs.

    wiki

  • 8/6/2019 c1 Intro Student Version

    11/31

    11

    Embedded System Structure

    An embedded system is a system whose principal function is not

    computational, but which is controlled by a computer embedded within it.

    utVa ia les t t

    se te ace

    Va ia les

    i t t e ste s

    e e C te

    Software

    Har ware

    Si

    al

    C

    iti

    i

    ata

    C

    esi

    t

    t

    i

    e

    is la e a etc

  • 8/6/2019 c1 Intro Student Version

    12/31

    12

    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.

  • 8/6/2019 c1 Intro Student Version

    13/31

    13

    Characteristics

    General Characteristics

    Application Specific CharacteristicsDSP Characteristics

    Distributed Characteristics

  • 8/6/2019 c1 Intro Student Version

    14/31

    14

    Design

    Design Issues

    Design MetricsWhat is Co-design?

  • 8/6/2019 c1 Intro Student Version

    15/31

    15

    Knowledge ?

  • 8/6/2019 c1 Intro Student Version

    16/31

    16

    A Mix of Disciplines

    Embedded Systems

    Electronics

    Electric Motors

    Computer Architecture

    Software Engineering

    Integrated CircuitDesign

    Digital

    AnalogueElectronics

    Actuators

    Sensors and

    Measurements

    Control

    Engineering

    DataCommunications

  • 8/6/2019 c1 Intro Student Version

    17/31

    17

    Essential Considerations

    Real Time Systems

    Memory Organization

    Instruction Set

    Communication/I/O Interfaces Portability ? Low Power ( attery Life)

    Software, Tools

  • 8/6/2019 c1 Intro Student Version

    18/31

    18

    Real time system ?

  • 8/6/2019 c1 Intro Student Version

    19/31

    19

    a) The Von NeumannWay b) The Harvard Way

    Memory Organisation

    Data

    Memory

    Program

    Memory

    Address

    Data

    Central

    ProcessingUnit (CPU)

    Input/Output CentralProcessing

    Unit (CPU)

    Data

    Memory

    Input/Output

    Program

    Memory

    Address

    Data

    Address

    Data

    Address

    Data

  • 8/6/2019 c1 Intro Student Version

    20/31

    20

    CPU Cache

  • 8/6/2019 c1 Intro Student Version

    21/31

    21

    AD AA A M

    M AAND Aw MO Aw ME O Aw M

    A leftShift A rightRotate A leftRotate A rightComplement AClearA

    A = A plus 1A = A - 1A = A plus MA = A - MA = A MA = A + MA = A M+A = 2AA = A 2

    A = NOTAA = 0

    A computer executes instructions in itsArithmetic Logic Unit(ALU), running through a series of

    instructions called aprogr m. An ALU can only do a few things, but it can do them very fast. Atypical 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).

    What can the Computer Actually Do? - Instructions and Instruction Sets

  • 8/6/2019 c1 Intro Student Version

    22/31

    22

    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, buthow 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 SetComputer. 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 shortinstruction 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 considerablesophistication;

    Instruction words are of different length;

    Instructions take different lengths of time to execute.

    How Instruction Sets are Made: the CISC Machine

  • 8/6/2019 c1 Intro Student Version

    23/31

    23

    Another approach is to keep the CPU very simple, and have a limited instruction set. This leads tothe RISC approach the Reduced Instruction SetComputer. 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.

    How Instruction Sets are Made: the RISC Machine

    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.

  • 8/6/2019 c1 Intro Student Version

    24/31

    24

    Programming

    Language features implemented for a particularplatform

    Hardware

    Operating system

    Libraries

    Templates

    Excellent for embedded systems work

    As always, try to write the clearest, cleanest, mostmaintainable code

  • 8/6/2019 c1 Intro Student Version

    25/31

    25

    Complexity

  • 8/6/2019 c1 Intro Student Version

    26/31

    26

    Reliability

    Embedded systems often reside in machines that areexpected 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 istoo 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 shutdown.

  • 8/6/2019 c1 Intro Student Version

    27/31

    27

    New trends in ES HW

  • 8/6/2019 c1 Intro Student Version

    28/31

    28

    New trends in ES SW

  • 8/6/2019 c1 Intro Student Version

    29/31

    29

    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 canbe read or written on the data bus

    Data bus is 8-bits wide

    Program Memory bus optimized to any widths that fitwithin the design goals of the microcontroller

    Wider busses allow more information to be transferredfrom memory to the CPU, enabling many instructions to beexecuted in a single clock cycle

    12-bit ( aseline), 14-bit (Midrange) and 16-bit (PIC18)instructions are upward compatible and maximize

    processing efficiency

  • 8/6/2019 c1 Intro Student Version

    30/31

    30

    The Microchip PIC Families

    dsPIC PIC24

    PIC32

  • 8/6/2019 c1 Intro Student Version

    31/31

    31

    A Gathering of Microprocessors and Microcontrollers

    PIC 16F84A

    PIC 16F877

    PIC 12F508

    Motorola

    68HC05B16PIC 16C72

    Motorola 68000

    features also appear across

    all their microcontrollers,and knowledge of one family can lead

    with ease to knowledge of another