Você está na página 1de 82

Embedded Systems Development

Embedded Systems Development Dr. Y S Rao 1

Dr. Y S Rao

What are Embedded Systems

• They are Embedded ‘in’

• They are not desktops

• Not mainframes or mini’s

Automotive- engine, doors, mirrors

• A heating furnace controller- Thermostat

• A mobile phone

• Medical device • DSP based systems

Avionics

Embedded Processors

Embedded vs. Desktop Processors

Advantages:

• Lower cost

• Optimized Instruction Set

• Lower Power

• Smaller footprint

consumption

Disadvantages:

Slower clock speeds

• Less Processing power

Applications

Embedded Processors:

• Cell phones / pagers / PDAs

• DAQ

• Controls (Automotive, Industrial)

• “Smart” Media

Desktop Processors:

• Desktop computers

• Notebook computers / Laptops

Why Use Embedded Systems

• User functionality portability

• User convenience, comfort - HVAC, Auto,

Appliances, GPS, TV remote, DVR, iPod

• Low power and safety – iron, coffee maker, LED Lighting

• Commercial/industrial applications

Complex features to be simplified

• Replace electro-mechanical systems

• Cost reduction

• Quality improvement

An Embedded System

Inputs
Inputs
Inputs
Inputs
Inputs
Inputs
Inputs
Inputs

Inputs

Inputs
Inputs
Inputs

Microcontroller

(uC)

Outputs

Outputs

Outputs

An Embedded Control System

Inputs Microcontroller Outputs (uC) Feedback
Inputs
Microcontroller
Outputs
(uC)
Feedback

Beware of the computer!

Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change
Beware of the computer! • computers + SoCs = hardware / software mix • complete change

• computers + SoCs = hardware / software mix

complete change in device interaction

• ever-growing number of critical applications

7

Embedded Systems on Chip

• Many processing units • Large embedded software

CPU DSP GLU RAM ROM FPGA
CPU
DSP
GLU
RAM
ROM
FPGA

Hardware or Software?Embedded Systems on Chip • Many processing units • Larg e embedded software CPU DSP GLU

8

Why Computerizing Objects?

1. Simplicity and uniformity of digital information

texts, images, sounds, movies, money, forces, count, store, organize, transmit, encrypt, visualize,

2. The fabulous information engine

Moore : computers => microprocessors => SoCs progress in the sensor field

3. Advances in numerical methods

control & information theory algorithmics numerical analysis

Applications and Constraints

A pp lications and Constraints flight-control, engines, brakes, fuel, power, climate safety-critical =>

flight-control, engines, brakes, fuel, power, climate safety-critical => certification

trajectory, attitude, image, telecom mission -critical => very high quality mission-critical => very high quality

telecom mission -critical => very high quality telephone, audio, TV, DVD, games business critical =>

telephone, audio, TV, DVD, games business critical => time-to market + quality

pacemakers, diabet control, robot surgeons life-critical => TBD (!) life-critical => TBD (!)

Microcontroller Manufacturers

• ARM – Advanced RISC Machines

• Atmel

• Cypress- programmable blocks

• Freescale Semiconductor- uC, DSP

Intel- 8051/8052 cores

• Microchip

• NEC

• Renasas

• Sharp

ST Microelectronics

• Texas Instruments- uC, DSP

• Many others

Microcontrollers Spectrum

• $0.15 - $0.20 Far Eastern parts

• A 4-bit 4-pin $0.35 ST part

• Musical gift card uC

• 8-bit 8K flash,1K RAM, 16-I/O

• 8-Bit, 256K flash, 32K RAM, 64-I/O

• 32-Bit, 2M Flash, 64K RAM, TPU

• A high end $50 Marvell processor

GbE, USB HS

DSPs

Design Goal: Reliability

Mission Critical

Life-Threatening

• 24/7/365

• Can’t reboot!

Design Goal: Performance

Multitasking and Scheduling

• Optimized I/O Assembly Language

• Limits, Inaccuracies of Fixed Precision

Design Issues

• Design Methodology

• Time To Market

Clock Speed

• Power Consumption

Silicon Technology

• Consumer Market: Minimize Manufacturing Cost.

• No chance for future modification.

• Silicon Technology • Consumer Market: Minimize Manufacturing Cost. • No chance for future modification. 15
A Low End Microcontroller Flash 256 x 12 I/O Clock (3) RISC Reset Watch Input
A Low End Microcontroller
Flash
256 x 12
I/O
Clock
(3)
RISC
Reset
Watch
Input (1)
Dog
RAM
16 Bytes

Microcontroller Functionality

• Core processor - Voltages

Memory Flash, RAM, EEPROM, FRAM,

DDR2

Input/Output interface voltage

• Timers

• Interrupts

• Serial Communication- SPI, I2C, UART

• USB, CAN-BUS, IR, SD-Cards

Analog A/D, DAC, Comparator, Op-amp

A Typical Microcontroller

RAM Flash EEPROM Clock I/O Core Reset Power Timers Comm Analog
RAM
Flash
EEPROM
Clock
I/O
Core
Reset
Power
Timers
Comm
Analog

Power-On Reset Modules

• Internal reset

Internal and/or external reset

• Programmable threshold voltage

• Programmable duration

Programmable Osc startup time

• Brown-out condition - programmable

Hysteresis • Watchdog timer

Battery Powered Applications

• Sleep mode

• Currents down to 20nA

• All kinds of modes available

• Reduced clock frequencies

Core options

• Selective peripherals sleep mode

Wake up modes clocks, timers, interrupts

• Watchdog timer

Why Worry About Power ?

Why Worry About Power ? Microprocessor Clock Rates 21

Microprocessor Clock Rates

Why Worry About Power ? Microprocessor Clock Rates 21

Process Technology and Supply Voltage

Process Technology and Supply Voltage 22

Why Worry About Power ? Portability

Why Worry About Power ? Portability Battery industry does not have a Gordon Moore 2 3

Battery industry does not have a Gordon Moore

23

A Typical Microcontroller

RAM Flash EEPROM Clock I/O Core Reset Power Timers Comm Analog
RAM
Flash
EEPROM
Clock
I/O
Core
Reset
Power
Timers
Comm
Analog

A High End Microcontroller

JTAG

2MB Flash

NEXUS

64KB SRAM

64- Ch DMA

 

32 K Cache

Freescale

 

32 -Ch TPU

DSP

32-Bit

MMU

(2)

MPC5554

 

CAN Bus

(3)

A/D

40-Ch

PLL

64-Ch

I/O

32-Bit External Bus

Microcontroller Selection Criterion

• Speed of operation, complexity – 8/16/32 Bits

• Cost – HW/SW tradeoffs

• Power consumption - TI, Microchip, Freescale

• Memory Size – Flash, RAM, EEPROM

• # of I/O

• Analog – A/D, DAC, Comparator, Op-amp

• Serial Communication- SPI, I2C, USB, IR, GbE

• Product Family

• Development tools

• Timers – input capture, output compare

Environmental conditions

Embedded Systems Development

• System development

• Electronics

PCB Layout

• Software

• Mechanical

Product qualification

• DFM – design for manufacturability

System Development

• Architecture

Complexity- MIPS required

• Sub-systems interface - Master/slave

• Communication - Networking protocols

Power bud et

• HW/SW tradeoffs

• uC selection

• System tests – regulatory agencies

Electronics Development

Design specs

• Design for testability

• uC and components selection

• Worst case analyses

Schematics CAD tools, Design rule checks

• Simulations

• Proof of concept, Prototyping

• Design validation

• Product qualification

Electronics Development Tools

Schematic capture- Orcad, PADS, Cadence, Mentor

• Analog simulation- pSpice, LTSpice

• Logic Simulation- Orcad, Cadence, Mentor

VHDL, Verilog

• Worst case analyses- simulations

• Proof of concept, Prototyping- PALs, FPGAs

• DFMEA- UL, agencies approval

• Reliability predictions - MTBF

ASICs & Programmable Logic

Application Specific ICs

• PAL, PLD, FPGA- uCs with PLDs

• Gate Arrays

• Standard Cells

• Custom ICs

• Languages- VHDL, Verilog

• Functional simulation • Timing simulations

• Floor planning

• Back-annotation

PCB Layout

CAD tools- Orcad, Protel, PADS, Allegro, Mentor

Netlist

• # of layers

Mechanical outline

• 3D fit

Noise considerations- diff-pair, impedance-matching

• Thermal considerations

• DRC

• Gerber output

• Fabrication

Real -Time Software Development

Hold on there!

What is real time software?

Software Development

Specs

Architecture

• SW Design

Languages ‘C’, C++, Assembly

• OS’

Simulations

• Tools – compilers, assemblers, programmers, emulators

• Real time aspects - ISRs

• SW/HW tradeoffs

• System integration

Real Time Software Development

• Timers

• Interrupts

Tasks

• Priorities

Real Time Software

External

External

Event

Event

Timer 1

Timer n

I/O

Micro-

Controller Core SW

Prioritized

Interru ts

p

Task 1 Task 2 Task n
Task 1
Task 2
Task n

Inputs

Real Time Software Development

Interrupts – ISRs

• ‘C’ v/s Assembly

Timers input capture and output compare

• Tasks and priorities

• RTOS’

Worst case analysis

Programming Languages Used in N ew Embe dd ed D es i gns 90.0% 80.0%

Programming Languages Used in New Embedded Designs

90.0% 80.0% 70.0% 1998-1999 60.0% 1999-2000 50.0% 40.0% 30.0% 20.0% 10.0% 0.0% Assembly C C++
90.0%
80.0%
70.0%
1998-1999
60.0%
1999-2000
50.0%
40.0%
30.0%
20.0%
10.0%
0.0%
Assembly
C
C++
Java
Other
Use of Real-Time Kernels in New Embedded Designs. 100.0% 80.0% 60.0% 40.0% 20.0% 0.0% 4-bit

Use of Real-Time Kernels in New Embedded Designs.

100.0% 80.0% 60.0% 40.0% 20.0% 0.0% 4-bit 8-bit 16-bit 32-bit 64-bit Special
100.0%
80.0%
60.0%
40.0%
20.0%
0.0%
4-bit
8-bit
16-bit
32-bit
64-bit
Special

Real Time Systems

Real time systems have to guarantee that they will respond to an external event within a specified amount of time.

• Real Time systems don’t have to be “real fast. They do have to be reliably on time”.

Type of Real Time Systems

Based on the type of timing guarantee they provide, real time systems are classified as soft real time” or “hard real time”.

Soft Real Time systems

Soft real time systems provide a time guarantee, but missing an event is not catastrophic. For example, image decoding used during satellite TV reception must be completed within a “frame time”. If this guarantee is missed, there will be a visible glitch. Annoying but not catastrophic!

Hard Real Time Systems

Hard real time systems are used when missing a timing deadline will lead to catastrophic results. For example, a missile guidance system should not miss any events!

So why use soft real time systems at all? • Both soft and hard real

So why use soft real time systems at all?

Both soft and hard real time systems provide a real time guarantee. But if we can afford to miss a few events, this guaranteed response time can be much shorter.

• Soft real time systems would be used in non-critical applications which need to be very fast.

Is real time software any different?

Interrupt handling has to be specially careful.

Since interrupt handling and task scheduling is done at the operating system level, special real time compliant operating systems should be used.

What are watchdog timers?

Most embedded system software is in the form of an endless loop, which waits for events and processes them when they occur.

• A watchdog timer helps with system recovery if there is a “hang up” while servicing some event.

47

Software Development - Tools

Programmers- development, in-circuit, field

• Emulators- JTAG

• Simulators • Assemblers

• Compilers

• Linkers

• Loaders

• CASE tools

Version control

Architecture Micro-Architecture RTL design circuits DFT (test) Place&Route components dimensioning communication c o
Architecture Micro-Architecture RTL design circuits DFT (test) Place&Route components dimensioning communication c o

Architecture

Micro-Architecture

RTL design

circuits

DFT (test)

Place&Route

components

dimensioning

communication

concurrency

pipeline

resource sharing

gates, clocks registers, RAMs critical path

cells, clock trees area, speed

testability scan insertion

Word, Excel, Visio System C

Word, Visio

VHDL, Verilog

Verilog +

$ 1 000 000

,

,

Masks

Chips

scan insertion Word, Excel, Visio System C Word, Visio VHDL, Verilog Verilog + $ 1 000
scan insertion Word, Excel, Visio System C Word, Visio VHDL, Verilog Verilog + $ 1 000

49

Translation of Code on Host : Compiling

C Source File (s) C Compiler C Header File (s) Preprocessing Compiling C Object File
C Source File (s)
C Compiler
C Header File (s)
Preprocessing
Compiling
C
Object File (s)
Linker
C System Libraries
C
Executable File
Host Computer
Embedded System
The build and load process for desktop application programs. Ob ject Fi les Compiler Executable

The build and load process for desktop application programs.

Object Files

Compiler Executable Linker Im age Fil e Assembler Run-Time Library:
Compiler
Executable
Linker
Im
age
Fil
e
Assembler
Run-Time Library:

Operating System Image:

Loade r
Loade r
Read-Write Memory (RAM)

Read-Write Memory (RAM)

Read-Write Memory (RAM)
Read-Write Memory (RAM)
Read-Write Memory (RAM)
Boot Process
Boot
Process
The build and load process for em be dd ed appli ca ti on programs.

The build and load process for embedded application programs.

Locator Object Files Executable Image File ROM Read-Write Image Memory Compiler File (RAM) L inker
Locator
Object
Files
Executable
Image File
ROM
Read-Write
Image
Memory
Compiler
File
(RAM)
L
inker
Assembler
Program
Initialization
Re-Entrant Library:
Read-Only
Memory
Real-Time Kernel:
ROM
(ROM)
"Burner"

What is ISP?

What is ISP? • In-System (ISP) means : Programmable ability to reconfigure the logic and f

In-System (ISP) means :

Programmable

ability to

reconfigure the logic and functionality of a device, board or complete electronic system.

This can be done before, during and after its manufacture and shipment to the end user.

The

system . – This can be done before, during and after its manufacture and shipment to

Case Studies

Mobile Phone User Interface

Touch

Screen

Freescale

68HC05

Power

Battery

Touch Screen Freescale 68HC05 Power Battery Keypad I nputs Micro- Phone Freescale Dragonball 68328 Speaker

Keypad

I nputs

Screen Freescale 68HC05 Power Battery Keypad I nputs Micro- Phone Freescale Dragonball 68328 Speaker Radio

Micro-

Phone

68HC05 Power Battery Keypad I nputs Micro- Phone Freescale Dragonball 68328 Speaker Radio LCD Driver

Freescale

Dragonball

68328

Speaker

Radio

LCD

Driver

Graphics

LCD

Postal Mail Sorting Device

Postal

Mail

Pieces

Optical

Encoder

Power

Supply

Optical Flash Freescale Isolation RAM 68HCxx PLD RS232
Optical
Flash
Freescale
Isolation
RAM
68HCxx
PLD
RS232

PC

Application

eBook

Rechargeable

Battery

PCMCIA

Touch

Screen

PC/104

Pentium

Processor

Video

Xilinx

Graphics

FPGA

LCD

Product: Hunter Programmable Digital Thermostat. Microprocessor: 4-bit 58

Product: Hunter Programmable Digital Thermostat.

Microprocessor: 4-bit

Product:Vendo V- MAX 720 vending machine. Microprocessor: 8-bit Motorola 68HC11. 59

Product:Vendo V- MAX 720 vending machine.

Microprocessor:

8-bit Motorola

68HC11.

Product: Sonicare Plus toothbrush. Microprocessor: 8-bit Zilog Z8.

Product: Sonicare Plus toothbrush. Microprocessor: 8- bit Zilog Z8 . 60
P ro d uc t: Miele dishwashers. Microprocessor: 8- bit M ot oro la 68HC05.

Product: Miele dishwashers.

Microprocessor:

8-bit Motorola

68HC05.

Product: NASA's Mars Sojourner Rover. Microprocessor: 8-bit Intel 80C85. 62

Product: NASA's Mars Sojourner Rover.

Microprocessor:

8-bit Intel 80C85.

Product: CoinCo USQ-712 coin chang er. Microprocessor: 8-bit Motorola 68HC912. 63

Product: CoinCo USQ-712 coin changer.

Microprocessor:

8-bit Motorola

68HC912.

Product: Garmin StreetPilot GPS Receiver. Microprocessor: 16-bit. 64

Product: Garmin StreetPilot GPS Receiver.

Microprocessor:

16-bit.

Product: TIQIT Computer’s “Matchbox PC”. Microprocessor: 32-bit AMD Elan SC410. 65

Product: TIQIT Computer’s “Matchbox PC”.

Microprocessor:

32-bit AMD Elan

SC410.

Product: Palm Vx handheld. Microprocessor: 32-bit Motorola Dragonball EZ. 66

Product: Palm Vx handheld.

Microprocessor:

32-bit Motorola Dragonball EZ.

Product: Motorola i1000plus iDEN Multi- Service Digital Phone . Microprocessor: Motorola 32 -bit MCORE. 67

Product: Motorola i1000plus iDEN Multi- Service Digital Phone.

Microprocessor:

Motorola 32-bit MCORE.

Product: Rio 800 MP3 Player. Microprocessor: 32-bit RISC. 68

Product: Rio 800 MP3 Player.

Microprocessor:

32-bit RISC.

Product: RCA RC5400P DVD player. Microprocessor: 32 - bi t R ISC . 69

Product: RCA RC5400P DVD player.

Microprocessor:

32-bit RISC.

Product: IBM Research’s Linux wrist watch prototype. Microprocessor: 32-bit ARM RISC. 70

Product: IBM Research’s Linux wrist watch prototype.

Microprocessor:

32-bit ARM RISC.

Product: Sony Aibo ERS - 110 Robotic Dog. Microprocessor: 64-bit MIPS RISC. 71

Product: Sony Aibo ERS-110 Robotic Dog.

Microprocessor:

64-bit MIPS RISC.

72
72
73
73

Web Servers… get smaller

Web Servers… get smaller 74

iPic : Tiny Web-Server

iPic : Tiny Web - Server 2mm * 2mm , PIC 12c508 512b ROM , 24b

2mm*2mm,

PIC 12c508 512b ROM, 24b RAM,

6bits IO, 4MHz RC

76

Embedded Systems

Classification

Classification

•1. Autonomous •2. Real-time •3. Networked •4. Mobile Categories

1. Autonomous Systems

Autonomous systems function in standalone mode.

Many Embedded systems used for process control in manufacturing units and automobiles fall this category. • Ex: Air-conditioner, CD players

2. Real-time Systems

• Real – time embedded systems are required to carry out specific tasks in a specified amount of time. • These systems are extensively used to carry out time critical tasks in process control

• Ex: Boiler Plant

3. Networked Embedded Systems • Monitor plant parameters, such as temperature, pressure, and humidity, and

3. Networked Embedded Systems

• Monitor plant parameters, such as temperature, pressure, and humidity, and the data over the network to a centralized system for online monitoring.

• Ex: Web camera monitoring the plant floor transmits its video output to a remote controlling organization.

81

4. Mobile``````

• Mobile gadgets need to store data bases locally in their memory.

• These gadgets imbibe powerful computing and communication capabilities to perform real-time tasks and handle multimedia applications.

• The gadgets embed powerful processor and OS, and a lot of memory with minimal power consumption.