57
Introduction to Embedded system [UNIT-I] V.V.C.E.T Department of EEE Page 1 EMBEDDED SYSTEMS DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING UNIT – I INTRODUCTION TO EMBEDDED SYSTEM Introduction Functional building blocks of embedded systems Processor Register Memory devices Ports Timer Interrupt controllers Introduction to Software Programming in Embedded system Prepared by M.Sujith, Lecturer, Department of Electrical and Electronics Engineering, Vidyaa Vikas College of Engineering and Technology. HOD/EEE HOD/EEE HOD/EEE HOD/EEE PRINCIPAL PRINCIPAL PRINCIPAL PRINCIPAL

Unit 1-embedded system

  • Upload
    sujith

  • View
    4.407

  • Download
    0

Embed Size (px)

DESCRIPTION

emebedded system_anna university,coimbatore

Citation preview

Page 1: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 1

EMBEDDED SYSTEMS

DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING

UNIT – I

INTRODUCTION TO EMBEDDED SYSTEM

� Introduction

� Functional building blocks of embedded systems

� Processor

� Register

� Memory devices

� Ports

� Timer

� Interrupt controllers

� Introduction to Software Programming in Embedded system

Prepared by

M.Sujith,

Lecturer,

Department of Electrical and Electronics Engineering,

Vidyaa Vikas College of Engineering and Technology.

HOD/EEEHOD/EEEHOD/EEEHOD/EEE PRINCIPALPRINCIPALPRINCIPALPRINCIPAL

Page 2: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 2

INTRODUCTION TO EMBEDDED SYSTEM

EMBEDDED SYSTEM

• Embedded system is one that has computer- hardware and software embedded in it as one of its most important component which makes a system dedicated for an application (s) or specific part of an application or product or part of a larger system.”

• Embedded system is a single purpose computer built in to larger system for processing the control and monitoring the system

COMPONENTS OF EMBEDDED SYSTEM

• It has Hardware

Processor, Timers, Interrupt controller, I/O Devices, Memories, Ports, etc.

• It has main Application Software

Which may perform concurrently the series of tasks or multiple tasks.

• It has Real Time Operating System (RTOS)

RTOS defines the way the system work. Which supervise the application software. It sets the rules during the

execution of the application program. A small scale embedded system may not need an RTOS.

Page 3: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 3

WHAT IS A SYSTEM?

• A system is a way of working, organizing or doing one or many tasks according to a fixed plan, program or set of rules.

• A system is also an arrangement in which all its units assemble and work together according to the plan or program.

Example:- It is a time display SYSTEM

Parts: Hardware, Needles, Battery, Dial, Chassis and Strap

Rules

1. All needles move clockwise only

2. A thin needle rotates every second

3. A long needle rotates every minute

4. A short needle rotates every hour

5. All needles return to the original position after 12 hours

Page 4: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 4

Features of an embedded system

� Constituents of embedded computer: hardware and software

� Timeliness: controller must be able to respond fast enough to keep its operation within a safe region

� System interconnection

� Reliability

Skills required for an embedded system designers

� For small scale embedded system designer –understanding of microcontroller, memory allocation,

� C programming and debugging

� For medium scale ES designers- RTOS, RTOS with application programming interface for the specific microcontroller

� For sophisticated ES designer- co design, RTOS, HDLs (High Level Design Language) programming

SPECIFICATION OF THE SYSTEM

• Product functions and tasks • Delivery Time schedule • Product Life-cycle • Load on System • Human-Machine Interaction • Operating Environment • Sensors • Power Requirement and enviornment • System Cost

Page 5: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 5

A “SHORT LIST” OF EMBEDDED SYSTEMS

Anti-lock brakes

Auto-focus cameras

Automatic teller machines

Automatic toll systems

Automatic transmission

Avionic systems

Battery chargers

Camcorders

Cell phones

Cell-phone base stations

Cordless phones

Cruise control

Curbside check-in systems

Digital cameras

Disk drives

Electronic card readers

Electronic instruments

Electronic toys/games

Factory control

Fax machines

Fingerprint identifiers

Home security systems

Life-support systems

Medical testing systems

Modems

MPEG decoders

Network cards

Network switches/routers

On-board navigation

Pagers

Photocopiers

Point-of-sale systems

Portable video games

Printers

Satellite phones

Scanners

Smart ovens/dishwashers

Speech recognizers

Stereo systems

Teleconferencing systems

Televisions

Temperature controllers

Theft tracking systems

TV set-top boxes

VCR’s, DVD players

Video game consoles

Video phones

Washers and dryers

Page 6: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 6

Some common characteristics of embedded systems

• Single-functioned

– Executes a single program, repeatedly

• Tightly-constrained

– Low cost, low power, small, fast, etc.

• Reactive and real-time

– Continually reacts to changes in the system’s environment

Must compute certain results in real-time without delay

Characteristics of an embedded system

Real-Time Operation

• Reactive: computations must occur in response to external events

• Correctness is partially a function of time

Small Size, Low Weight

• Hand- held electronics and Transportation applications -- weight costs money

Low Power

• Battery power for 8+ hours (laptops often last only 2 hours)

Harsh environment

• Heat, vibration, shock, power fluctuations, RF interference, lightning, corrosion

Safety- critical operation

• Must function correctly and Must not function in correctly

Extreme cost sensitivity

• $. 05 adds up over 1,000, 000 units

Page 7: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 7

Embedding a computer

&386(16256$�'

&219(56,21'�$

&219(56,21$&78$7256

+80$1

,17(5)$&(

',$*1267,&722/6

$8;,/,$5<6<67(06�32:(5�

&22/,1*�

)3*$�

$6,& 62)7:$5(0(025<

0,&52&21752//(5

(/(&7520(&+$1,&$/%$&.83 6$)(7<

(;7(51$/(19,5210(17

An Embedded Control System Designer’s View◆ Measured by: Cost, Time-to-market, Cost, Functionality, Cost & Cost.

Page 8: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 8

Examples of embedded systems

• automatic teller machines (ATMs)

• avionics, such as inertial guidance systems, flight control hardware/software and other integrated systems in aircraft and missiles

• cellular telephones and telephone switches

• engine controllers and antilock brake controllers for automobiles

• home automation products, such as thermostats, air conditioners, sprinklers, and security monitoring systems

• handheld calculators

• household appliances, including microwave ovens, washing machines, television sets, DVD players and recorders

• medical equipment

• Handheld computers

• Videogame consoles

• computer peripherals such as routers and printers

• Industrial controllers for remote machine operation.

History

• The first recognizably modern embedded system was the Apollo Guidance Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory.

• The first mass-produced embedded system was the Autonetics D-17 guidance computer for the Minuteman (missile), released in 1961.

• In 1978 National Engineering Manufacturers Association released the standard for a programmable microcontroller.

By the mid-1980s, widespread use of embedded systems became feasible with microcontroller

Page 9: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 9

Embedded software architectures

• Simple control loop

– software simply has a loop. The loop calls subroutines, each of which manages a part of the hardware or software.

• Interrupt controlled system

– tasks performed by the system are triggered by different kinds of events. (e.g. a timer, or by a serial port controller receiving a byte)

– Usually there is a simple task in a main loop also. The tasks performed in the interrupt handlers should be as short as possibl

– Some times longer tasks are added to a queue structure

• Cooperative multitasking

– A nonpreemptive multitasking system is very similar to the simple control loop scheme, except that the loop is hidden in an API. (usually called "pause", "wait", "yield", etc.).

– The advantages and disadvantages are very similar to the control loop, except that adding new software is easier.

• Preemptive multitasking

– A low-level piece of code (scheduler) switches between tasks based on a timer. It introduces all the complexities of managing multiple tasks running seemingly at the same time.

– Tasks must be precisely separated. Access to shared data must be controlled by some synchronization strategy, such as message queues, semaphores or a non-blocking synchronization scheme.

– It is common for organizations to buy a real-time operating system, allowing the application programmers to concentrate on device functionality rather than operating system services

• Microkernels and exokernels

– A microkernel can allocate memory and CPU time to different threads of execution. User mode processes implement major functions such as file systems, network interfaces, etc.

Page 10: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 10

– Exokernels communicate efficiently by normal subroutine calls. The hardware, and all the software in the system are available to, and extensible by application programmers.

• Monolithic kernels

– A full kernel with sophisticated capabilities is adapted to suit an embedded environment.

– It requires more hardware resources and can be less predictable and reliable.

– Common examples are Embedded Linux and Windows CE.

– This type of embedded system is increasing in popularity. Here are some of the reasons:

• Ports to common embedded chip sets (ARM, x86, PowerPC) are available.

• They permit re-use of publicly available code for Device Drivers, Web Servers, Firewalls, and other code.

• Running application code in user mode is more reliable, easier to debug and that therefore the development process is easier and the code more portable.

• A system such as Embedded Linux has fast enough response for many applications (real-time requirement).

• Features requiring faster response than can be guaranteed can often be placed in hardware.

• Many RTOS systems have a per-unit cost (royalty).

What is an Embedded System?

Embedded System = A computer which is integrated into another system, the embedding system

Page 11: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 11

Page 12: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 12

Page 13: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 13

Page 14: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 14

Essential Components

• Microprocessor / DSP • Sensors • Converters (A-D and D-A) • Actuators • Memory (On-chip and Off chip) • Communication path with the interacting environment

Embedded System Structure

Essential Considerations

• Response Time -- Real Time Systems • Area • Cost • Portability • Low Power (Battery Life) • Fault Tolerance

Design Issues (Hardware-Software Co-design)

• System Specification – Functions, Real Time Constraints, Cost and Power Constraints

• Hardware Software Partitioning • Hardware Synthesis • Software Synthesis and Code Generation • Simulation • Implementation

ES, MS and RTS • All embedded systems are microprocessor based systems, but all microprocessor based

systems may not be amenable to embedding (Area, Power, Cost, Payload parameters). • Most of the embedded systems have real time constraints, but there may be ES which

are not hard RTS (for example off line Palm tops) • There may be RTS which are not embedded (e.g. Separate Process Control Computers

in a network) • Embedded Systems are not GPS; they are designed for dedicated applications with

specific interfaces with the sphere of control

Page 15: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 15

General Characteristics of Embedded Systems

• Perform a single task – Usually not general purpose

• Increasingly high performance and real time constrained • Power, cost and reliability are important considerations • HW-SW systems

– Software is used for more features and flexibility – Hardware (processors, ASICs, memory etc. are used for performance

and security

ASIPs and ASICs form a significant component – Advantage: customization � lower power, cost and enhanced

performance – Disadvantage: higher development effort (debuggers, compilers etc.)

and larger time to market Classification of Embedded Systems

• Distributed and Non distributed • Reactive and Transformational • Control dominated and Data dominated

Application Specific Characteristics

• Application is known before the system is designed • System is however made programmable for

– Feature upgrades – Product differentiation

• Often application development occurs in parallel to system development – Hw-Sw partitioning should be as delayed as possible

• For upgrades design reuse is an important criterion – IP reuse, object oriented development

Page 16: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 16

DSP Characteristics

• Signals are increasingly being represented digitally as a sequence of samples • ADCs are moving closer to signals; RFs are also treated digitally • Typical DSP processing includes:

– Filtering, DFT, DCT etc. – Speech and image: Compression, decompression, encryption, decryption

etc. – Modems: Equalization, noise and echo cancellation, better SNR – Communication channel: encoding, decoding, equalization etc.

Design Metrics

• Unit cost – the $ cost for each unit excluding development cost • NRE cost: $ cost for design and development • Size: The physical space reqd. – determined by bytes of sw, number of gates

and transistors in hw • Performance: execution time or throughput of the system • Power: lifetime of battery, cooling provisions • Flexibility: ability to change functionality without heavy NRE cost

Major Subtasks of Embedded System Design

• Modeling the system to be designed and constraints – Experimenting with different algorithms and their preliminary

evaluation – Factoring the task into smaller subtasks and modeling their interaction

• Refinement • HW-SW partitioning

– Allocating the tasks into hw, sw running on custom hw or general purpose hw

• Scheduling – allocation of time steps for several modules sharing the same resource

• Implementation: Actual hw binding and sw code generation • Simulation and Validation • Iterate if necessary

CAD for Embedded Systems

• Co-design: Joint optimization of hw and sw to optimize design metrics • Co-synthesis: Synthesizes designs from formal specifications • Rapid prototyping and design space exploration • Many of the tasks are interrelated • Intermediate evaluation is not easy as a later decision in one path affects the

other

Page 17: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 17

Importance of Embedded Software and Embedded Processors “... the New York Times has estimated that the average American comes into contact with about 60 micro-processors every day....” [Camposano, 1996] Latest top-level BMWs contain over 100 micro- processors [Personal communication]

Basic Block Diagram of an Embedded Processor

Parallel

I/O ports

Serial

I/O ports

Counter/Timer

Processor

core

Internal

memory

To external

memory

Figure 9.3. A block diagram of an embedded processor.

A-to-D conversion D-to-A conversion

Page 18: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 18

Embedded System Example

Home Network

Home Automation

Page 19: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 19

Microwave Oven

Design Issues

� Cost � I/O capability � Size � Power consumption � On-Chip memory � Performance � Software � Instruction set � Development tools � Testability and reliability

Page 20: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 20

BASIC COMPONENTS OF EMBEDDED SYSTEMS

� Analog components - Sensors, controllers,…

� Digital components - Processor, coprocessors - Memories - Controllers, busses - ASIC: Application-Specific Integrated Circuit, a chip designed for a particular application

� Converters – A/D, D/A, … � Software

- Application programs - Exception handlers

Analog Digital Analog

Memory

Coprocessors

Controllers

Converters

Processor

Interface

Software

ASIC

Page 21: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 21

Processor

Processor is the heart of the embedded system. It consists of two units: Two Essential Units: Operations Control Unit (CU), Fetch Execution Unit (EU) Execute- It includes ALU and executes the program task, say, halt, interrupt and jump or another set of instructions

Processor runs the cycle of fetch and execute. Processor mostly in the form of IC or in the form of Core ASIP [Application Specific Instruction Processor] or Soc [System on Chip], core means a part of functional circuit on VLSI chip. EMBEDDED SYSTEM CONSTRAINTS An embedded system is software designed to keep in view three constraints:

– Available system memory – Available processor speed – The need to limit the power dissipation

When running the system continuously in cycles of wait for events, run, stop and wakeup An embedded system processor chip or core can be one of the following

� General purpose processor [GPP] � Microrpocessor � Microcontroller

Page 22: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 22

� Embedded processor � Digital signal processor � Media processor

� Application Specific System Processor [ASSP] � Multipurpose system using general purpose processor [GPPs] � GPP CORE or ASIP core integrated in to an ASIP or VLSI[Very Large Scale Integrated circuit] or

FPGA[Fast Programmable Gate Array] integrated with processor units in the VLSI chip. Important consideration when selecting a processor

� Instruction set � Maximum bit (8 or 16 or 32) in single ALU operation � Clock frequency in MHZ and processor speed in MIPS � Processor capability to solve the complex algorithms

Microprocessor

Stream MPU family Source CISC or RISC Stream 1

Stream 2

Stream 3

Stream 4

68HC XXX

80x86

SPARC

Power PC 601

Motorola

Intel

SUN

IBM

CISC

CISC

RISC

RISC

Complex Instruction Set Computer (CISC)

� Memory in those days was expensive � Bigger program->more storage->more money � Hence needed to reduce the number of instructions per program � Number of instructions are reduced by having multiple operations within a single instruction � Multiple operations lead to many different kinds of instructions that access memory � In turn making instruction length variable and fetch-decode execute time unpredictable – making it more

complex � Example: x86 ISA

Reduced Instruction Set Computer (RISC)

� Original idea to reduce the ISA � Provide minimal set of instructions that could carry out all essential operations � Instruction complexity is reduced by � Having few simple instructions that are the same length � Allowed memory access only with explicit load and store instructions

Page 23: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 23

� Hence each instruction performs less work but instruction execution time among different instructions is consistent

� The complexity that is removed from ISA is moved into the domain of the assembly programmer/compiler

� Examples: LC3, MIPS, PowerPC (IBM), SPARC (Sun)

RISC VS. CISCRISC VS. CISCRISC VS. CISCRISC VS. CISC

RISC CISC

• Simple instructions, few in number • Fixed length instructions • Complexity in compiler • Only LOAD/STORE instructions access memory • Few addressing modes

• Many complex instructions • Variable length instructions • Complexity in microcode • Many instructions can access memory • Many addressing modes

� A microprocessor is a single chip semi conductor device also which is a computer on chip,

but not a complete computer. � Its CPU contains an ALU, a program counter, a stack pointer, some working register, a clock

timing circuit and interrupt circuit on a single chip. � To make complete micro computer, one must add memory usually ROM and RAM, memory

decoder, an oscillator and a number of serial and parallel ports

HISTORY OF MICROPROCESSOR 1st Generation (4 bit processors) 4004 and 4040 4 bit in early 1970 by Intel (Integrated Electronics) 2nd Generation (8 bit processors) 8008 and 8080 8 bit in 1974 Intel with +5 V Input supply 8080 � 8085 8 bit 3rd Generation (16 bit processors) 8086 16 bit. Same as 8086, the 8088 introduced 8088 has only 8 bit data bus (This made it easier to interface to the common 8 bit peripheral devices available at the time) Followed by: The 80186 & 80286 (16 bit processor), the 80386 & 80486 (a 32 bit processor), leading to the Pentium range of microprocessors (64 bit processors) available today. The 80x86 and Pentium processors have all been designed for use in personal computer type applications and have large memory maps.

Page 24: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 24

Page 25: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 25

Page 26: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 26

MICROCONTROLLERMICROCONTROLLERMICROCONTROLLERMICROCONTROLLER

A microcontroller is a single chip VLSI unit called microcomputer which though having limited computational capabilities processes enhanced i/p-o/p capabilities and a number of on chip functional units.

Stream MPU family Source CISC or RISC Stream 1

Stream 2

Stream 3

Stream 4

Stream 5*

68HC 11XX, 68HC 12XX

8051

80x86$

PIC 16FXX

ARM processor

Motorola

Intel

Intel

Microchip

ARM, Texas

CISC

CISC

CISC

CISC

CISC with RISC core

Page 27: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 27

• A microcontroller is a functional computer system-on-a-chip. It contains a processor, memory, and programmable input/output peripherals.

• Microcontrollers include an integrated CPU, memory (a small amount of RAM, program memory, or both) and peripherals capable of input and output.

• INTEL

8031,8032,8051,8052,8751,8752

• PIC

8-bit PIC16, PIC18,

16-bit DSPIC33 / PIC24,

PIC16C7x

Motorola

MC68HC11

Page 28: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 28

MICROPROCESSOR MICROCONTROLLER

The functional blocks are ALU, registers, timing & control units

It includes functional blocks of microprocessors & in addition has timer, parallel i/o, RAM, EPROM, ADC & DAC

Bit handling instruction is less, One or two type only

Many type of bit handling instruction

Rapid movements of code and data between external memory & MP

Rapid movements of code and data within MC

It is used for designing general purpose digital computers system

They are used for designing application specific dedicated systems

Embedded processor

It designed for fast, precise and intensive calculation and for real time application

Eg: AWACS-advanced control and warning system- Tracking radar, GPS system

Advantages

1.Fast context switching-complex real time application: context switching means saving the context of interrupted routine or task or load the new task is called routine. The time taken for a context switching for a period called latency period.

2.Atomic ALU operations –to solve data share problems-during multitasking operation

E.g.: large scale embedded system i860 or i960 –embedding a VLSI chip including RISC and CISC operational features.-image processing and aerodynamic applications

Examples : ARM 7, INTEL i960, AMD 29050

Page 29: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 29

CLASSIFICATIONS OF EMBEDDED SYSTEM SMALL SCALE EMBEDDED SYSTEM

• Single 8 bit or 16bit Microcontroller. • Little hardware and software complexity. • They May even be battery operated. • Usually “C” is used for developing these system. • The need to limit power dissipation when system is running continuously.

Programming tools: Editor, Assembler and Cross Assembler MEDIUM SCALE EMBEDDED SYSTEM

• Single or few 16 or 32 bit microcontrollers or Digital Signal Processors (DSP) or Reduced Instructions Set Computers (RISC).

• Both hardware and software complexity. Programming tools: RTOS, Source code Engineering Tool, Simulator, Debugger and Integrated Development Environment (IDE).

Page 30: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 30

SOPHISTICATED EMBEDDED SYSTEM

• Enormous hardware and software complexity • This may need scalable processor or configurable processor and

programming logic arrays. • Constrained by the processing speed available in their hardware

units.

Programming Tools: For these systems may not be readily available at a reasonable cost or may not be available at all. A compiler or retarget able compiler might have to be developed for this.

Application Specific Instruction-Set Processor (ASIP) (b) DSP or (c) Media processor or (d) IO processor or (e) Network processor or (f) A domain specific processor

DIGITAL SIGNAL PROCESSOR • DSP as a GPP is a single chip VLSI unit. • It includes the computational capabilities of microprocessor and multiply & accumulates units (MAC). • DSP has large number of applications such as image processing, audio, video & telecommunication

processing systems. • It is used when signal processing functions are to be processed fast. Examples: TMS320Cxx, SHARC, Motorola 5600xx

MEDIA PROCESSOR

TI DSP TMS320DM310 or Trimedia Phillips Media Processor 1x00 series for Processing Streaming and Data Networks and Image, Video and Speech: PNX 1300, PNX 1500 (2002)

Page 31: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 31

3.GPP OR ASIP CORE (S)

GPP or ASIP Integrated into either an Application Specific Integrated Circuit (ASIC), or a Very Large Scale Integrated Circuit (VLSI) circuit or a FPGA core integrated with processor unit(s) in a VLSI (ASIC) chip 4.APPLICATION SPECIFIC SYSTEM PROCESSOR (ASSP)

• ASSP is dedicated to specific tasks and provides a faster solution. • An ASSP is used as an additional processing unit for running the application in place of using embedded

software. Examples: IIM7100, W3100A Typically a set top box processor or mpeg video-processor or network application processor or mobile application processor 5. Single purpose processor or Application Specific Instruction processor • Floating point Coprocessor • CCD Pixel coprocessor and image codec in digital camera

Page 32: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 32

• Graphic processor • Speech processor • Adaptive filtering processor Encryption engine • Decryption engine • Communication protocol stack processor • Java accelerator Use of Accelerator Cores: Examples Java Accelerator Nazonin Communications Java codes run 15 to 60 Times fast, Video Accelerator for fast Video Processing 6. Multi core processors or multiprocessor system using GPPs Examples • Multiprocessor system for Real time performance in a video-conference system, • Embedded firewall cum router, • High-end cell phone.etc. MOORE’S LAW • Moore's law describes a long-term trend in the history of computing hardware. • Since the invention of the integrated circuit in 1958, the number of transistors that can be placed

inexpensively on an integrated circuit has increased exponentially, doubling approximately every two years.

• The trend was first observed by Intel co-founder Gordon E. Moore in 1965. • Almost every measure of the capabilities of digital electronic devices is linked to Moore's law: processing

speed, memory capacity, etc.

Page 33: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 33

Basic Circuit Elements at the System (i) Power Source 1. System own supply with separate supply rails for IOs, clock, basic processor and memory and analog units, or 2. Supply from a system to which the embedded system interfaces, for example in a network card, OR Charge pump concept used in a system of little power needs, for examples, in the mouse or contact-less smart card Power Dissipation Management 1. Clever real-time programming by Wait and Stop instructions 2. Clever reduction of the clock rate during specific set of instructions 3. Optimizing the codes and 4. Clever enabling and disabling of use of caches or cache blocks (ii) Clock Oscillator Circuit and Clocking Units 1. Appropriate clock oscillator circuit 2. Real Time Clock*( System Clock) and Timers driving hardware and software (iii) Reset Circuit 1. Reset on Power-up 2. External and Internal Reset circuit 3. Reset on Timeout of Watchdog timer

MEMORY

Page 34: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 34

a. Functions Assigned to the ROM or EPROM or Flash 1. Storing 'Application' program from where the processor fetches the instruction codes 2. Storing codes for system booting, initializing, Initial input data and Strings. 3. Storing Codes for RTOS. 4. Storing Pointers (addresses) of various service routines. b. Functions Assigned to the Internal, External and Buffer RAM 1. Storing the variables during program run, 2. Storing the stacks, 3. Storing input or output buffers for example, for speech or image . c. Functions Assigned to the EEPROM or Flash Storing non-volatile results of processing

d. Functions Assigned to the Caches 1. Storing copies of the instructions, data and branch-transfer instructions in advance from external memories and 2. Storing temporarily the results in write back caches during fast processing (v) Interrupts Handler Interrupt Handling element for the external port interrupts, IO interrupts, timer and RTC interrupts, software interrupts and Exceptions (vi) Linking Embedded System Hardware • Linking and interfacing circuit for the Buses by using the appropriate multiplexers, and decoders, demultiplexers Interface the various system units 3. IO Communication Unit a. Communication Driver(s) Network Ethernet or serial driver to communicate with host embedded system Expansion • Facility Serial Bus(es): For example, UART (512 kbaud/s), 1-wire CAN (33 kbps), Industrial I2C (100kbps), SM I2C Bus (100 kbps), SPI (100 kbps), Fault tolerant CAN (110 kbps), Serial Port (230 kbps), MicroWire (300 kbps). • SCSI parallel (40 Mbps), Fast SCSI (8M to 80 Mbps) , Ultra SCSI-3 (8M to 160 Mbps), FireWire/IEEE 1394 (400 Mbps, 72 meter), High Speed USB 2.0 (480 Mbps, 25 meter) • Parallel Bus(es): PCI, PCI-X b. Media IO Control Element c. Keypad or Keyboard IO Interface d. LCD Display System Interface e. ADC – Single or Multi channel f. DAC g. GPIB Interface Element h. Pulse Dialing Element i. Modem and j. Bluetooth, 802.11, IrDA.

Page 35: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 35

MEMORY TECHNOLOGIES

Memory is an essential part of all microprocessor based systems. Different memory types are available to suit

different tasks. Some of these memory types will be discussed here.

1.RANDOM ACCESS MEMORY (RAM)

This is memory that can be written to and read from as often as we wish. The 'Random Access' refers

to the fact that we can access any position in the memory equally fast. RAM is used for short term storage, such

as for storing variables that are used by a program. RAM is volatile memory. It will only store contents (at best)

for as long as the power is applied.

1.1 RAM Signals

A typical RAM device will have (at least) the following set of signals:

Data Bus: This is a set of lines which carry the data into the memory or out of it. We refer to

the width of the memory by how many bits can be written or read simultaneously.

Address Bus: This is a set of lines which is used to specify the location of the data to be

read/written.

WR line: This line tells the RAM it is going to be written to or read from.

OE line: This line enables the data bus as output for when we read data from the device.

CS line: This line is used to select the device. This line enables or disables the entire chip.

Typical timing diagrams may be found in the lab sheet.

1.2 Basic RAM Types

i. DRAM

Dynamic RAM uses tiny capacitors to store each bit of information. This is a cheap, high density

technology. The capacitors need to be recharged periodically and so DRAM needs to be refreshed frequently.

DRAM forms the basis for most computer memory. Usually DRAM is used together with a DRAM controller

which handles the refresh cycles.

ii. SRAM

Static RAM uses a flip flop to store each bit in the memory. Because the data is stored in a proper flip

flop there is no need to refresh SRAM. SRAM is more expensive and lower density than DRAM. It has better

access times, which means that generally it is faster to store and retrieve data than the DRAM. SRAM is simpler

to use than DRAM as it does not require any refresh circuitry.

Page 36: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 36

1.3 Special RAM Types

i. SDRAM

Synchronous Dynamic RAM is a DRAM based technology which has been enhanced to improve the

performance of the computing system that it is used in. When a computer program uses memory it often

exhibits a property called spatial locality. When we access one memory location, we often access locations

close to it soon afterwards. SDRAM is modified so that after it incurs full access time for one access and

accessing other data that is close by faster.

ii. DDR

DDR is based around SDRAM. The difference is that the access bus has been enhanced to allow

memory access on both clock edges, hence the name.

iii. RAMBUS™

Rambus™ is a RAM arrangement which makes use of parallelism to achieve extremely high memory

bandwidth.

1.4 Popular RAM form factors

A form factor is the physical size and shape of a device. RAM comes in a number of standard sizes

and shapes. These generally originate in the computer industry. Early desktop computers used individual RAM

chips. The RAM occupied a very large portion of the motherboard.

The SIMM (Single Inline Memory Module) was introduced. This is a small circuit board which had

the RAM chips on it. The SIMM normally stood upright on the motherboard and occupied less real estate. The

SIMM concept was taken further with the 72 pin SIMM. This SIMM had more connection points to allow for

wider busses.72 pin SIMM's had either FPM (slower) RAM chips on them or EDO (faster)RAM chips on them.

When PC's started using SDRAM instead of DRAM the form factor of the memory was changed. The new

devices were called DIMM's (Dual Inline Memory Module). These have even more pins than the SIMMs.

DIMM's had 10ns access time device (called PC100 for the 100MHz bus that connected to them) or

7.5ns access time devices (called PC133) on them. When PC's started using DDR then a new form factor was

introduced. DDR modules come in a variety of speeds, commonly up to 400MHz. Higher speeds are available.

Laptop computers use smaller form factors. These are not as standardized as the desktop PC RAM form factors.

Some manufacturers use this as a business tool.

Page 37: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 37

2. READ ONLY MEMORY (ROM)

Read Only Memory is a memory which is made to store data on a permanent basis. We call this non-volatile

memory. ROM is used in computing systems to store programs, long-term data and it can sometimes be used in

place of combinational logic. When we put data into a ROM it is generally called “programming” the device.

2.1 ROM Signals

ROM devices will have (at least) the following signals:

Data bus: A set of lines which data is normally read out of. During programming data is

normally put in through these lines.

Address Bus: A set of lines used to specify the address to be read or programmed.

OE: Output enable. Allows the data bus to output data.

CS: Chip Select. Enable the device

Programming Signals: These lines are used to signal the memory device that data is to be

programmed. Older devices used high voltage (up to 21V) signals to program the

device. Typical timing diagrams may be found in the lab sheet.

6.2.2 Basic ROM Types

i. Mask ROM

This ROM is manufactured with the data already stored in it. This is only used for very high volume

production when the data (or program) has been thoroughly tested. This is a cheap option as it avoids having to

program the devices yourself. Once the device is manufactured there is no way to change it.

ii. PROM (Programmable Read Only Memory)

This memory type is almost obsolete now. Devices would be programmed by blowing tiny fuses

inside the device. Devices could only be programmed once.

iii. EPROM (Erasable Programmable Read Only Memory)

This memory type is also nearing obsolescence. Device could be programmed and could then be

erased by shining an ultraviolet light through a quartz window in on the top of the chip. The packing was

expensive. Being able to erase the devices was a big step forward from PROM.

Erasing a device requires a UV light source. The device had to be exposed to high levels of UV for 15 minutes.

Some microcontrollers incorporated EPROM. These are fantastic to look at under a microscope. You can see

the silicon die through the window. Under a stereo microscope they are truly spectacular.

Page 38: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 38

EPROM has a fairly limited endurance. Endurance is the number of times that a device can be erased and

reprogrammed. EPROM typically has an endurance of several hundred cycles.

iv. OTP (One Time Programmable)

Because the packaging for normal EPROM is expensive a cheaper option is available. These devices

are EPROM inside, but have no quartz window. Because of the volumes, the programming equipment and the

compatibility these devices are generally preferred to PROM. Once they have been programmed they can not be

changed.

v. EEPROM (Electrically Erasable Programmable Read Only Memory)

These devices can be programmed and then erased by means of an electrical signal. This opens up a

huge range of possibilities. They are cheap and find their way into many devices. A few microcontrollers used

EEPROM for storing their programs. Many modern microcontrollers have a block of EEPROM which can be

used for storing configuration data.

Typical endurance figures for modern EEPROM are around 1000 000 cycles. EEPROM is a fairly low

density technology and this limits its use for bulk storage.

vi. Flash

Flash memory is also electrically erasable. It is based around a different principle of operation to

EEPROM. Flash memory attains much higher density than EEPROM and it has established itself as a popular

bulk storage medium. Flash memory has lower endurance than EEPROM. First generation Flash memory

devices had endurance figures of around 100 cycles, but new devices will withstand several hundred thousand

cycles. Techniques such as wear leveling and delayed writing are used to further improve the endurance of

Flash memories. Flash memory is cheap to produce and is the memory technology of choice for most

microcontrollers.

3. Programmable Logic Technologies

Programmable logic is used to build up complex circuits without the need to connect up many gates.

They consist of chips which contain many logic gates. The way in which these gates are connected is

determined by the way in which the device is configured (programmed).

Programmable logic is commonly used because it is more compact and generally can run faster than a

circuit made out of discrete gates. Programmable logic offers design security.

There has been remarkable progress in the development of programmable logic devices over the last

few years. Because of the vast changes that the industry has seen there are very few standards in terms of

signals and compatibility between devices.

Page 39: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 39

3.1 PAL (Programmable Array Logic) and PLA ( Programmable Array Logic)

These were the earliest form of programmable logic. They had a simple grid type structure which was

programmed by blowing fuses. They were only programmable once. The programming was done in a simple

language, typically PALASM, ABEL or CUPL.

3.2 GAL (Generic Array Logic)

Slightly more complex and flexible structure than PAL. Reprogrammable! They typically had a

JTAG (Joint Test and Access Group) interface for programming. This is an industry standard (IEEE1149.1)

four wire interface that has become one of the dominant programming and debugging interfaces for

programmable logic, microcontrollers and larger processors.

3.3 PEEL (programmable electrically erasable logic)

Very similar to GALs, but made of CMOS rather than bipolar technology.

3.4 CPLD (Complex Programmable Logic Device)

These devices are typically made up of many small PAL's connected together with a programmable

interconnection system. They are much more flexible than any of the previous programmable logic families.

3.5 FPGA (Field Programmable Gate Array)

These are the high end of the market. They consist of lots of programmable logic blocks. These blocks

are each quite complex, typically consisting of PAL type logic as well as devices such as configurable flip flops.

They are available in sizes up to several million gates.

They often have peripherals such as phase locked loop clock multipliers, memory blocks and

communication (LVDS) systems.

There are many FPGA's which are big enough to hold entire microprocessors. These are becoming

more popular. They are called “soft cores”.

Page 40: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 40

SYSTEM-ON-CHIP (SoC) AND USE OF VLSI CIRCUIT DESIGN TECHNOLOGY VLSI CHIP � Integration of high-level components � Possess gate-level sophistication in circuits above that of the counter, register, multiplier, floating point operation unit and ALU. System on chip (SoC) a new design innovation � SoC is a system on a VLSI chip that has all needed analog as well as digital circuits, processors and software, for example, single-chip mobile phone New Innovation

Example –Mobile Phone on a SoC

SYSTEM-ON-CHIP Embeds: � Multiple processors, � memories, � multiple standard source solutions (IP Cores), � Logic and analog units Embedding a Microprocessor � General Purpose Processor (GPP) microprocessor can be embedded on a VSLI chip.

Page 41: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 41

Embedding an ASIP � Processor with instruction set designed for specific application on a VLSI chip for example, microcontroller, DSP, IO, media, network or other domain specific processor Embedding a � Microcontroller core � 68HC11xx, � HC12xx, � HC16xx8051, � 80251 PIC 16F84 or � 16C76, 16F876 and PIC18Microcontroller � Enhancements of ARM9/ARM7 ARM, Cortex M3 from Philips, Samsung and ST Microelectronics Embedding a DSP Core � TMS320Cxx, OMAP1Tiger SHARC 5600xx PNX 1300, 15002 � DSP for mobile phones, for example, OMAP of Texas Instruments use the effective power dissipation methods of dynamic switching both of power supply voltage and operating frequency of the CPU core. � Filtering, noise cancellation, echo elimination, compression and encryption Embedding a Multi-processor or Dual Core using General Purpose Processors (GPP) Speech signal-compression and coding, Signal decoding and decompression Embedding an Accelerator Accelerate the execution of codes, for example, a floating point coprocessor accelerates the mathematical operations and Java accelerator accelerates the Java code execution.

Embedding Single purpose processors � For Dialing, Modulating, Transmitting. Demodulating and Receiving. � Keypad interface and display interface handling. � Touch screen � Message display and creation, SMS (Short Message Service) and MMS � Protocol- stack generation. � Pixel coprocessor and CODEC in a digital camera SoC � Embedded processor GPP or ASIP core, � Single purpose processing cores or multiple processor cores, � A network bus protocol core, � An encryption and decryption functions cores, Cores for FFT and Discrete cosine transforms

for signal processing applications, � Memories Multiple standard source solutions, called IP (Intellectual Property) cores, � Programmable logic device and FPGA (Field Programmable Gate Array) cores. � Other logic and analog units.

Page 42: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 42

IPs in SoC �IP –a standard source solution for synthesizing a higher-level component by configuring a core of VLSI circuit or FPGA core available as an Intellectual Property, called (IP). �High Level Components with gate level sophistication circuit much above level of counters and registers. IPs • Designer or designing company holds the copyright for the synthesized design of a higher-level

component for gate-level implementation of an IP. • One might have to pay royalty for every chip shipped. An embedded system may incorporate several IPs. IP An IP may provide a � Design for adaptive filtering of a signal. � Full design for implementing Hypertext Transfer Protocol (HTTP) or File Transfer Protocol (FTP) to

transmit a web page or file on Internet. � USB port controller, Bluetooth, GPS interface, Wireless 802.11or 802.16 interfaces FPGA Core � An FPGA consists of a large number of programmable gates on a VLSI chip. There is a set of gates in

each FPGA cell, called 'macro cell'. � Embedded system designed with a view of offering enhancing functionalities in future, then FPGA core

can be used in the circuits. FPGA Core � Each cell has several inputs and outputs. All cells interconnect like an array (matrix). � Each interconnection is programmable through the associated memory RAM in a FPGA programming

tool. � A concept is using FPGA (Field Programmable Gate Arrays) core along with single or multiple

processors. Use of Xilinx Spartan-3 �90 nm based FPGAs with Power PCs (2003 ) Use of FPGAs cum Processor Cores FPGA 125136 Logic Cells along with the Four IBM PowerPC processors [Exemplary Application: System with a Data Encryption Engine at 1.5 Gbps] FPGA � An SIMD instruction, Fourier transform and its inverse, DFT or Laplace transform and its inverse,

compression or decompression, encrypting or deciphering, a specific pattern-recognition (for recognizing a signature or finger print or DNA sequence).

� Configure an algorithm into the logic gates of the FPGA.

Page 43: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 43

FPGA CORE WITH A SINGLE PROCESSOR

E.g.Smart Card

Smart Card

� Smart card– a plastic card in ISO standard dimensions, 85.60 mm x 53.98 x 0.80 mm. � Embedded system on a card. � SoC (System-On-Chip). � ISO recommended standards are ISO7816 (1 to 4) for host-machine contact based � cards and ISO14443 (Part A or B) for the contact-less cards. � Silicon chip is just a few mm in size and is concealed in-between the layers. Its very small size protects

the card from bending

Embedded hardware components in a contact less smart card

Page 44: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 44

Embedded hardware components

� Microcontroller or ASIP (Application Specific Instruction Set Processor) � RAM for temporary variables and stack � ROM for application codes and RTOS codes for scheduling the tasks � EEPROM for storing user data, user address, user identification codes, card number and expiry date � Timer and Interrupt controller � A carrier frequency ~16 MHz generating circuit and Amplitude Shifted Key (ASK) � Interfacing circuit for the I/Os � Charge

Embedded Software

� Boot-up, Initialisation and OS programs � Smart card secure file system � Connection establishment and termination � Communication with host � Cryptography � Host authentication � Card authentication � Addition parameters or recent new data sent by the host (for example, present balance left)

Smart Card OS Special features � Protected environment. � Every method, class and run time library should be scalable. � Code-size generated be optimum. � Memory should not exceed 64 kB memory. � Limiting uses of specific data types; multidimensional arrays, long 64-bit integer and floating

pointsSmart Card OS Limiting features _ Limiting uses of the error handlers, exceptions, signals, serialization, debugging and profiling. [Serialization means process of converting an object is converted into a data stream for transferring it to network or from one process to another. At receiver end there is de-serialization.]

Smart Card OS File System and Classes Three-layered file system for the data.

� Master file to store all file headers. � Dedicated file to hold a file grouping and headers of the immediate successor elementary files of the

group. � Elementary file to hold the file header and its file data. � Fixed-length or variable-file length management � Classes for the network, sockets, connections, data grams, character-input output and streams, security

management, digital-certification, symmetric and asymmetric keys-based cryptography and digital signatures.

Page 45: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 45

GENERAL

SOFTWARE FOR EMBEDDING IN A SYSTEM- PART 1 ROM image, Programming Languages and Program models

ROM Image • Final stage software also called ROM image * (Just as an image is a unique sequence and arrangement of pixels, embedded software is also a unique placement and arrangement at each ROM address of bytes for instructions and data. )

System ROM memory embedding the software, RTOS, data, and vector addresses

Final machine software

� Bytes at each address defined for creating the ROM image.

� By changing this image, the same hardware platform work differently and can be used for entirely

different applications or for new upgrades of the same system.

Page 46: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 46

Distinct ROM image in a distinct Embedded System Hardware elements between the distinct systems can be identical but it is the software that makes a system unique and distinct from the other. Compressed Codes and Data ROM image may alternatively be compressed software (for example, the zip format) and data (for example, the pictures in jpg or gif format) along with the software required for decompression algorithm

OUTLINE

� ROM image � Programming Languages � Program models

1. Machine Language Coding

• Programmer defines the addresses and the corresponding bytes or bits at each address.

• Used in configuring some specific physical device or subsystem like transceiver, the machine code-

based coding is used

2. Assembly Language Coding

• Needed for Invoking Processor Specific Instructions

• Requires understanding of the processor and instruction set.

• A program or a small specific part coded in the assembly language using an Assembler (software used

for developing codes in assembly).

Three steps when using assembly language

� 'Assembler', � 'Linker' and � 'Locator'

Before finally burned at the ROM

Page 47: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 47

Programming language C or C++ or Visual C++ or Java

Application Software - Different Program Layers

Page 48: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 48

Program various layers

� Processor commands, � Main function, � Task functions and � Library functions, � Interrupt service routines and � Kernel (scheduler).

Compiler

� Generates an object file .Using linker and locator, the file for ROM image is created for the targeted hardware.

� C++ and Java are other languages used for software coding.

Program Models

� Sequential Programming Model � Object Oriented Programming Model � Control and Data flow graphs or � Synchronous Data Flow (SDF) Graph or Multi Thread Graph (MTG) Model � Finite State Machine for data path � Multithreaded Model � Concurrent Processing of processes or thread or tasks

Page 49: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 49

DEVICE DRIVERS, DEVICE MANAGER, OS, RTOS AND SOFTWA RE TOOLS

• drivers � Device

� Device manager

� Multitasking using an operating system (OS) and Real time operating system (RTOS)

� Software tools

DEVICE drivers

In an embedded system, there are number of physical devices. Physical devices – keypad, LCD display or touch screen, memory stick (flash memory), wireless networking device, parallel port and network card In an embedded system, there are number of virtual devices. Virtual devices – pipe, file, RAM disk, Socket, Device Driver A device driver is software for controlling (configuring), receiving and sending a byte or a stream of bytes from or to a device.

� A set of generic functions, such as create ( ), open ( ), connect ( ), listen ( ), accept ( ), read ( ), write ( ), close ( ), delete ( ) for use by high level programmers

� Each generic function calls a specific software (interrupt service routine), which controls a device function or device input or output

Device controls and functions by: 1. Calling an ISR (also called Interrupt Handler Routine) on hardware or software interrupt

2. Placing appropriate bits at the control register or word.

3. Setting status flag(s) in the status register for interrupting, therefore running (driving) the ISR, Resetting the

status flag after interrupt service

DEVICE MANAGER

� Device Manager for the devices and drivers

� Device Management software (usually a part of the OS) provide codes for detecting the presence of

devices, for initializing (configuring) these and for testing the Concurrent Processes, tasks or threads

� A System is composed of two or more concurrent processes that execute

Operating System

� Multitasking (multiprocessing or multithreaded) software � Scheduling multiple tasks, � Processes, memory, device, ports, network, file system, timers, event functions, inter-processor

Communication, shared memory, security, GUIs, .etc. management devices

Page 50: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 50

Real Time Operating System (RTOS)

� Embedded software is most often designed for deterministic performance and task and

� ISR latencies in addition to the OS functions

� Performing multiple actions and controlling multiple devices and their ISRs with defined real time

constraints and with deadlines for these Task and ISRs priority allocations, their preemptive scheduling

RTOS and concurrent processes OS for providing deterministic performance during concurrent processing and execution with hard (stringent) or soft timing requirements with priority allocation and preemption RTOS is needed when the tasks for the system have real time constraints and deadlines for finishing the tasks Important RTOSes

� OS µCOS-II � VxWorks � Windows CE � OSEK � Linux 2.6.24 or RTLinux � QNX

DEVELOPMENT TOOLS 1.Editor, 2. Interpreter, 3. Compiler, 4. Assembler and Cross Assembler,IDE, 5. Prototyper Application Software Development Tools

� Source Code Engineering Tools

� Stethoscope (tracks the switching from one task to another as a function of time, stores beats)

� Trace Scope (traces changes in a parameter(s) as a function of time)

A Simulator ... To simulate the target processor and hardware elements on a host PC and to run and test the executable module.

Project Manager To manage the files that associates with a design stage project and keep several versions of the source file(s) in an orderly fashion.

Page 51: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 51

SOFTWARE DESIGN CYCLE

Activities for Software Design during Software-Development Process

Five levels of abstraction from top level to bottom level in the design process

� Requirements � Specifications � Architecture � Components � System Integration

Page 52: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 52

Requirements Complete clarity of

� required purpose, � inputs, � outputs, � functioning, � design metrics and � Validation requirements for finally developed systems specifications. � Consistency in the requirements

Specifications

� Clear specifications of Customer expectations from the product. � Needs specifications for hardware, for example, peripherals, devices processor and memory

specifications data types and processing

Specifications

Needed specifications • Expected system behavior specifications,

• constraints of design, • expected life cycle specifications of the product.

• Process specifications analysed by making lists of inputs on events list, outputs on events, processes activated on each event.

Architecture

� data flow graphs � program models � software architecture layers and � hardware architecture � interfaces design � system integration

Hardware Components

� Processor, ASIP and single purpose processors in the system � Memory RAM, ROM or internal and external flash or secondary memory in the system � Peripherals and devices internal and external to the system � Ports and buses in the system � Power source or battery in the system

Page 53: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 53

Challenges in Embedded System Design: Optimizing the Design Metrics and Formalism of System Design

Formalism of Steps

� Requirements and Specifications of hardware and software � Define architectures of hardware and software � Coding and implementation as per architecture � Testing, validation and verification of System

Amount and type of hardware needed

� Optimizing the microprocessors, ASIPs and single purpose processors in the system

� Optimizing according to the performance, power dissipation, cost and other design metrics the system

� Optimizing hardware (memory RAM, ROM or internal and external flash or secondary memory in the

system, peripherals and devices internal and external to the system, ports and buses in the system and

power source or battery in the system).

Taking into account the design metrics Design metrics examples –power dissipation, physical size, number of gates and engineering, prototype development and manufacturing costs. Optimizing the Power Dissipation

� Clock Rate Reduction

� Operating Voltage Reduction

� Wait, Stop and Cache Disable Instructions

� Clever real- time programming. It is by using of 'Wait' and 'Stop' instructions and disabling or

controlling certain units when not needed is one method of saving power during program execution

Disable use of certain structural units of the processor to reduce power dissipation

� Caches—when not necessary and

� Keep in disconnected state those structure units that are not needed during a particular software-portion

execution, for example, display screen, timers or IO units

� Control of power requirement, for example, by screen auto-brightness control

Process Deadlines Meeting the deadline of all processes in the system while keeping the memory, power dissipation, processor clock rate and cost at minimum is a challenge

Page 54: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 54

Coding language ����UML (Universal Modeling Language)

� Conceptual design modeling

� Classes and Objects to describe identity, attributes, components and behaviour

� Inheritances in classes and objects

� Interfaces with the objects and their implementation in the objects,

� Structural description of the design Components

� Behavioral description in terms of states, state machine and signals

� Events description

Testing, Verification and Validation

� Testing – to find errors and to validate that the implemented software is as per the specifications and requirements to get a reliable product.

� Verification – refers to an activity to ensure that specific functions are correctly implemented.

� Validation – refers to an activity to ensure that the system that has been created is as per the

requirements agreed upon at the analysis phase, and to ensure its quality

Example : SET OF ROBOTS

Hardware components in the set of robots

Page 55: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 55

Master Robot Functions � It receives from a remote controller commands to start the music, stop the music and the code for the

specific orchestra to be played.

� It sends the PWM signals to the ports for the moving the sticks in both hands as per the program.

� It establishes and binds the sockets (the virtual devices) connection with the slaves.

� It sends the signals through sockets using IrDA protocols. The byte streams responses to the clients are

as per the music file being played

Slave Robot Functions

� It establishes and binds the sockets (the virtual devices) connection with the master.

� It receives from a master socket the commands accept ( ) and write ( ) from the master. It receives

commands from master to start the music, stop the music and the code for the specific orchestra to be

played.

� It receives the signals through sockets using IrDA protocols. The byte streams from the server re as per

the music file being played.

� Slave robots speaker outputs for playing the music.

Robot Hardware units

� Microcontroller or ASIP (Application Specific Instruction Set Processor) � Music file processor � RAM for storing temporary variables and stack � ROM for application codes and RTOS codes for scheduling the robot actions and tasks � Timer, Flash memory for storing user preferences and music files. � IrDA controller � Direct Memory Access controller � Power supply source or battery

Microcontrollers � Each robot has a microcontroller with expansion ports, P0,., P8.

� A single ASIC can perform the multiple port functions of a microcontroller. When the engineering cost

of ASIC development is high, a general purpose microcontroller 68HC12 or 8051 is used.

Control Funtions � Master robot signals the commands and slave robots play according to the signals from the master.

� Each robot is assumed to have five degrees of freedom. At each degree of freedom, there is a servomotor.

� A servomotor controls by PWM method.

� Each motor is controlled in a sequence to let the robot perform the desired action.

Page 56: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 56

Ports and Flash Memory

� The port outputs from the port(s) connect the motors and PWM outputs drive the motors in each robot.

� Each robot has a serial input/output through IrDA protocol.

� Internal memory flash to store the OS, embedded software and limited number of music.

Robot Software Components

� Socket functions

� Music coding

� Music decoding

� Memory and file systems

� Light, flash and display device drivers

� IrDA and socket Port device drivers

� Motor drivers

� IO Interrupt Service routines

Software components in the set of robots in which a master robots signals the commands and slave robots play according to the signals from the master

Page 57: Unit 1-embedded system

Introduction to Embedded system [UNIT-I] V.V.C.E.T

Department of EEE Page 57

Introduction to Embedded Systems

Part – A (2 MARKS) 1. Define a System.

2. What is an embedded system?

3. What are the main components of an embedded system?

4. Define embedded microcontroller.

5. What are the various classifications of embedded systems?

6. What are the two essential units of a processor on a embedded system?

7. What does the execution unit of a processor in a embedded system do?

8. Give examples for general purpose processor.

9. Define microprocessor.

10. When is Application Specific System processors (ASSPs) used in an embedded system?

11. What is the need for LCD and LED displays?

12. Define ROM image.

13. Define device driver.

14. Name some of the software’s used for the detailed designing of an embedded system.

15. What are the various models used in the design of a embedded system?

16. Give some examples for small scale embedded systems.

17. Give some examples for medium scale embedded systems

18. Give some examples for sophisticated embedded systems

Part – B (16 MARKS) 1. List the hardware units that must be present in the embedded systems.

2. i) Explain the Exemplary applications of each type of embedded system. (8)

ii) Explain the different program layers in the embedded software and also the process of

converting a “C” program into the file for ROM image with suitable block diagrams. (8)

3. Explain the Embedded System on Chip (SoC) & in VLSI circuit.

4. i) Explain the various form of memories present in a system (8)

ii)Explain the software tools in designing of an embedded system. (8)