53
Embedded System Design Class: International graduate stud ent Instructor: Wei, Chao-Huang ( 魏魏魏 ) Office: S706-3 E-Mail: [email protected] Mobile Phone: 0930-937-932 Skype: drwei06

Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: [email protected]@mail.stut.edu.tw

Embed Size (px)

Citation preview

Page 1: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Embedded System Design

Class: International graduate student

Instructor: Wei, Chao-Huang (魏兆煌 )Office: S706-3E-Mail: [email protected] Phone: 0930-937-932Skype: drwei06

Page 2: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Course Schedule

Hardware Design (VHDL & Schematic Entry) Software Design (Microprocessor & C) HW & SW Co-design Small Real Time Operating System Ethernet NetworkEthernet Network Final Project

Page 3: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Reference Books & Webpage

"Digital Design with CPLD Applications and VHDL", Robert K. Dueck, Thomson.

Any book about "C Language and 8051 Microprocessor".

Design Entry and Synthesis Tools (Quartus II):

http://www.altera.com/products/software/quartus-ii/subscription-edition/design-entry-synthesis/qts-des-ent-syn.html

Embedded System Design :http://www.cs.ucr.edu/~vahid/courses/122a_f99/index.html

Page 4: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Content

What are embedded systems History and development of embedded systems Composition of embedded systems Characteristic of embedded systems Embedded system hardware development Embedded system software development

Page 5: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

1. What are embedded systems?

Definition: Embedded system : any device that includes a

programmable computer but is not itself a general-purpose computer.

Data processing systems except PCs and mainframe computers.

Embedded systems are application dedicated computing system.

Page 6: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

A More Detailed Definition

Embedded system are application oriented devices, which should be optimized with hardware and software resources. A special computing system with demand of functionality, reliability, cost, size, and power consumption.

Generally, an embedded system consists of 4 parts -- embedded microprocessor, peripheral hardware equipment, embedded operating system and user's application program , used for realizing the functions , such as control on other equipment , monitoring or management.

Page 7: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Embedding a computer

Page 8: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Example: Digital camera

Microcontroller

CCD preprocessor Pixel coprocessorA2D

D2A

JPEG codec

DMA controller

Memory controller ISA bus interface UART LCD ctrl

Display ctrl

Multiplier/Accum

Digital camera chip

lens

CCD

Input interface

Output display

Digital signal processor

Central processor

Page 9: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Software Architecture

Application Software

Hardware

Page 10: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

PDA: Handspring Visor Hardware Specs:

Operating System: Palm OS version 3.5.2H

Processor: 33 MHz Motorola Dragonball VZ (16-bit)

Memory: 8 MB RAM, 2M ROM Display: 160x160 pixel, High-Res B&W,

4-bit (16 shades of gray) . Touch Panel Battery: 2 AAA batteries PC Connection : USB, IrDA, UART Expansion Slot: PCMCIA  

Page 11: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

High-End Embedded System

Page 12: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Examples

Personal digital assistant (PDA). Printer. Cell phone. Automobile: engine, brakes, air condition, etc. Audio Video Recorder/Player. Household appliances. PC Keyboard/Mouse.

Page 13: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Reference Interpretation (1)

An "embedded system" is any computer system or computing device that performs a dedicated function or is designed for use with a specific embedded software application.

Embedded systems may use a ROM-based operating system or they may use a disk-based system, like a PC. But an embedded system is not usable as a commercially viable substitute for general purpose computers or devices.

Page 14: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Reference Interpretation (2)

A specialized computer system that is part of a larger system or machine. Typically, an embedded system is housed on a single microprocessor board with the programs stored in ROM. Virtually all appliances that have a digital interface -- watches, microwaves, VCRs, cars -- utilize embedded systems. Some embedded systems include an operating system, but many are so specialized that the entire logic can be implemented as a single program.

Page 15: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Reference Interpretation(3)

The embedded system can be divided into chip, board, and system level.

System on chip - Processor including the procedure or the algorithm in one chip.

System on board - board contains some core module.

System on system - in main computing system.

Page 16: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

1.2 History and development of embedded systems

First microprocessors was presented in 1971, it marks the beginning of the embedded system.

View history of embedded systems from 4 respects: Hardware Software Products System architecture

Page 17: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

History of embedded hardware

1971: Intel 4004, 4-bit microprocessor TI, TMS1000, 4-bit microcontroller

ROM, RAM, CPU + I/O port 1980: Intel MCS-51, 8microcontroller 16-bit, 32-bit microprocessor … 1990’s, DSP

TMS320C30

Page 18: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Classification and term of the embedded processor (1)

Micro-Controller Unit (MCU) i.e. Single chip. The early processor that integrated the whole

computer in a chip, the inside has a certain processor unit as the core, and program in ROM. Some essential peripheral hardware such as RAM, bus, bus logic, timer / counter, I/O, serial port, A/D, D/A converter, etc. are also integrated.

Intel 8051 Micro-Processor Unit (MPU)

The MPU must be assembled with other essential peripheral hardware together on a circuit board to carry out the embedded function.

ARM series , MIPS

Page 19: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Classification and term of the embedded processor (2)

Digital Signal Processor (DSP) The system structure and instructions are special des

igned, that makes it suited to carrying out high speed digital signal processing algorithm.

TI TMS320C30 -> System-on-Chip (SoC)

Mix the important processor kernel and various peripheral together on a chip, can reduce the consumption power and chip size further.

Intel PCA architecture: PXA 255

Page 20: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Microprocessor varieties

Microcontroller: includes I/O devices, on-board memory.

Digital signal processor (DSP): microprocessor optimized for digital signal processing.

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

Page 21: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

History of embedded software

Procedure control and monitoring Operating system

1981, Embedded real time kernel VTRX32 1990’s, QNX-4 pSOS, VxWorks, Palm OS, WinCE, Embedded

Linux, LynxOS, uCOS, Nucleus…

Page 22: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Architecture develops of embedded system

Hardware system 4-bit single chip 8-bit/ 16-bit single chip 32-bit special purpose m

icroprocessor 32-bit DSP SoC SoPC

Software system Real-time control/

monitoring procedure Dedicate system General purpose

system

Page 23: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

IA & Embedded System

Information Appliance An appliance specializing in information :

Knowledge, facts, graphics, images, video, or sound. An information appliance is designed to perform activity, such as music, photography, or writing. A distinguishing feature of information appliance is the ability to share information among themselves. (Don Norman)

Page 24: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

IA & Embedded System (cont’d)

The core of the IA machine is an embedded system

The cost of a IA machine is depends on cost of embedded system

The usability of a IA machine is depends on software of embedded system

The development of the IA machine is followed with the trend of embedded system

Page 25: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

1.4 Basic construction of an embedded system

Processor I/OI/O

Software

Storage

Input Output

Page 26: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Fundamental hardware and software elements

Hardware Embedded processor Memory/Storage Circuits and power

supply Interface controller

and connector

Software Real time operating

system (RTOS) Board Support

Package ( BSP ) Device Driver Protocol Stack Application programs

Page 27: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Typical embedded system hardware architecture

Chip Board Circuit

CPU Core

External Devices

USB LCD Pen Keyboard IRDA Others

Connection for DebuggingPorts

ResetCircuit

OscillationCircuit

PowerSupply

DMA

Timer

Prescaler

A/D

I/O Port

InterruptControler

ConnectingDRAM

ConnectingSRAM

ConnectingFlash

ConnectingROM

CPUBCU

Page 28: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Small Web enabled embedded system

Page 29: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Typical embedded system software architecture (VxWorks)

Software tools,application programs

VxWorks LibrariesTCP/IP I/O System

Wind kernel

BSP

File System

SCSI DriverNetwork Driver

Hardware dependent Software

EthernetController

SerialController

ClockTimer

SCSIController

Hardware

Hardware Independent Software

Page 30: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Embedded Operating System Where to use

Multi-Task Convenient user's interface Network function Upgrade and advance development

Basic functions of operating system Scheduling of multi-task Memory management Hardware resource management

Page 31: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Embedded Linux

Basic components: Boot loader Linux kernel

Further: Hardware drivers Application programs File systems based on ROM or RAM TCP/IP stack GUI

Page 32: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Real-time operation

Must finish operations by deadlines. Hard real time: missing deadline causes failure. Soft real time: missing deadline results in

degraded performance. Many systems are multi-rate: must handle operations

at widely varying rates.

Page 33: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Experiment board of this course

Expansion Connectors

Microprocessor8051 family

UART to PC

Programable Logic chip

Page 34: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Non-functional requirements

Many embedded systems are mass-market items that must have low manufacturing costs. Limited memory, microprocessor power, etc.

Power consumption is critical in battery-powered devices. Excessive power consumption increases system

cost even in wall-powered devices.

Page 35: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Design teams

Often designed by a small team of designers. Often must meet tight deadlines.

6 month market window is common. Can’t miss back-to-school window for calculator.

Page 36: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

1.6 Embedded system software development

Programming Languages Assemble, C, Java… Cross compiler

A kind program, which compiles the execution code of target machine on another host machine.

Page 37: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Procedure of development

Debug

Target Board

System ImageFile

.obj File

C/AssembleSource Code

Library Linker

Cross Compiler

Reset & Download

OS kernel Device Driver

Page 38: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Download and Debugging of execution code

Development Platform

Target Platform

Download execution code

Return debug information

Page 39: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Debugging method of embedded systems

LED Simulator ICE (In-Circuit Emulator) Embedded ICE based on Jtag interface Logic analyzer

Page 40: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Simulator

Simulator A Software based on host computer totally, Simulate

functions and instructions of target machine. Characteristic

Simple and executable Lack online function debug and real-time emulation Can imitate the target processor only, it is unable to i

mitate the function about I/O of the processor Common used as primary debugging tool.

Page 41: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

ICE ICE: In-Circuit Emulator

The tradition method for testing the printed circuit board.

ICE is a special device. It has special clips or connectors to touch each pin of the specific CPU chip, and can monitor the logic level on this CPU chip.

Because the integrated level of the IC is improving constantly, the pin of the chip is increasing also. In addition, the surface mount technology reduces the chip size. So, it is ddifficult to use routine online emulation way…

Page 42: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Embedded ICE Embedded ICE: a set of debugging registers

IBCR (Instruction Break Control Register) DBAR (Data Break Address Register) …

JTAG Interface JTAG (Joint Test Action Group) has defined a standard of boundary scan,

need only 5 pins to realize the function of online emulation . ARM architecture processors have embedded ICE unit, which

can be connected with the JTAG interface. Meanwhile, in order to trace the function in real time, ARM processor embedded a tracing unit implicitly that enables real time debug through a logic analyzer.

Page 43: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

ARM debugging system

Page 44: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Embedded System Design

Top-down design: start from most abstract description; work to most detailed.

Bottom-up design: work from small components to big system.

Real design uses both techniques.

Page 45: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Levels of abstraction

requirements

specification

architecture

componentdesign

systemintegration

Page 46: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Structure of this course

Not covered in this course, Embedded OS will be in next semester

Page 47: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Classification of embedded processors

Microprocessor (MPU) Microcontroller (MCU) Digital Signal Processor (DSP) System on Chip (SoC)

Page 48: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Storage

ROM PROM , EPROM , EEPROM Flash ROM

Flash ROM will be used in embedded system as boot ROM and hard disk.

RAM SRAM DRAM

Page 49: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

1.5 Characteristic of embedded systems

Dedicate for special application The embedded system is a specia

l-purpose system, while the PC is for general applications.

Technology integration Soft-/Hardware, computing and

network communication integration

Constrain of real-time Use RTOS commonly

Constrain of power consumption

Usually no difference of system software and application software, Software in ROM.

Small system kernel High reliability Resources much less then PC Requirement of special

development tools Not market monopoly

Page 50: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Characteristics of embedded systems

Sophisticated functionality. Real-time operation. Low manufacturing cost. Low power. Designed to tight deadlines by small teams.

Page 51: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

Functional complexity

Often have to run sophisticated algorithms or multiple algorithms. Cell phone, laser printer.

Often provide sophisticated user interfaces.

Page 52: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

PXA255 Architecture

Page 53: Embedded System Design Class: International graduate student Instructor: Wei, Chao-Huang ( 魏兆煌 ) Office: S706-3 E-Mail: drwei@mail.stut.edu.twdrwei@mail.stut.edu.tw

USB Host controller

PXA250 Application processor

IrDA FF UART

MMC/SD Card

BT UART

Touch Screen

SPI to Touch Screen

USB Client

LCD Toshiba

LTM04C380K

SDRAM

Flash Memory

Boot ROM

CPLD & Board level Registers

Driver and Transceiver

Compact Flash

AC97 Codec CS4201

Audio Jack

Debug Leds

Accelerometer sensor

HEX-encoding switches

Expansion-card slot

Power System

Ethernet Controller