Sunteți pe pagina 1din 72

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

T 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. H HHHHO OOOOD DDDD/ ////E EEEEE EEEEE EEEEP PPPPR RRRRI IIIIN NNNNC CCCCI IIIIP PPPPA AAAAL LLLL Department of EEE Page 1

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 large r system. Embedded system is a single purpose computer built in to larger system for proce ssing 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. Department of EEE Page 2

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

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 togethe r 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 Department of EEE Page 3

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 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 Department of EEE Page 4 understanding of microcontroller, memory

Introduction to Embedded system [UNIT-I] V.V.C.E.T A SHORT LIST OF EMBEDDED SYSTEMS

Anti-lock brakes Modems Auto-focus cameras MPEG decoders Automatic teller machin Network cards Automatic toll systems Network switches/routers Automatic transmission On-board navigation Avionic systems Pagers Battery chargers Photocopiers Camcorders Point-of-sale systems Cell phones Portable video games Cell-phone base stations Printers Cordless phones Satellite phones Cruise control Scanners Curbside check-in system Smart ovens/dishwashers Digital cameras Speech recognizers Disk drives Stereo systems Electronic card readers Teleconferencing systems Electronic instruments Televisions Electronic toys/games Temperature controllers Factory control Theft tracking systems Fax machines TV set-top boxes Fingerprint identifiers VCR s, DVD players Home security systems Video game consoles Life-support systems Video phones Medical testing systems Washers and dryers Department of EEE Page 5

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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, corrosio n Safety-critical operation Must function correctly and Must not function in correctly Extreme cost sensitivity $. 05 adds up over 1,000, 000 units Department of EEE Page 6

Introduction to Embedded system [UNIT-I] V.V.C.E.T Embedding a computer An Embedded Control System Designer s View u Measured by: Cost, Time-to-market, Cost, Functionality, Cost & Cost. &386(16256$'&219(56,21'$&219(56,21$&78$7256+80$1,17(5)$&(',$*1267,&722/6$8;,/,$5<6 <67(0632:(5&22/,1*

)3*$$6,&62)7:$5(0(025<0,&52&21752//(5(/(&7520(&+$1,&$/%$&.83 9,5210(17 Department of EEE Page 7

6$)(7<(;7(51$/(1

Introduction to Embedded system [UNIT-I] V.V.C.E.T Examples of embedded systems automatic teller machines (ATMs) avionics, such as inertial guidance systems, flight control hardware/software an d 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 se ts, 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 microc ontroller Department of EEE Page 8

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 i nterrupt 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 s cheme, except that the loop is hidden in an API. (usually called "pause", "wait", "yiel d", etc.). The advantages and disadvantages are very similar to the control loop, except th at adding new software is easier. Preemptive multitasking A low-level piece of code (scheduler) switches between tasks based on a timer. I t 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 s ome 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 opera ting 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 interface s, etc. Department of EEE Page 9

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

Exokernels communicate efficiently by normal subroutine calls. The hardware, and all the software in the system are available to, and extensible by application programme rs. Monolithic kernels A full kernel with sophisticated capabilities is adapted to suit an embedded env ironment. 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 r easons: Ports to common embedded chip sets (ARM, x86, PowerPC) are available. They permit re-use of publicly available code for Device Drivers, Web Servers, F irewalls, 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 ( realtime 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 Department of EEE Page 10

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

Department of EEE Page 11

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

Department of EEE Page 12

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

Department of EEE Page 13

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 ba sed 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 whi ch 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

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

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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. and transistors in hw determined by bytes of sw, number of gates

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 resource allocation of time steps for several modules sharing the same

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 Department of EEE Page 16

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 microprocessors [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

Introduction to Embedded system [UNIT-I] V.V.C.E.T Department of EEE Page 18 Embedded System Example Home Network Home Automation

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

Introduction to Embedded system [UNIT-I] V.V.C.E.T BASIC COMPONENTS OF EMBEDDED SYSTEMS Memory Coprocessors Controllers Converters Processor Interface Software ASIC Analog Digital Analog 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 Department of EEE Page 20

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

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 I C 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 Department of EEE Page 21

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

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 Integrat ed circuit] or FPGA[Fast Programmable Gate Array] integrated with processor units in the VLSI c hip. 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 Stream Stream Stream Stream MPU family Source CISC or RISC 1 68HC XXX Motorola CISC 2 80x86 Intel CISC 3 SPARC SUN RISC 4 Power PC 601 IBM 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 mem ory In turn making instruction length variable and fetch-decode execute time unpredi ctable 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 operation s Instruction complexity is reduced by Having few simple instructions that are the same length Allowed memory access only with explicit load and store instructions Department of EEE Page 22

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

Hence each instruction performs less work but instruction execution time among d ifferent 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) R RRRRI IIIIS SSSSC CCCCV VVVVS SSSS. ....C CCCCI IIIIS SSSSC CCCC 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 regist er, 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 availab le at the time) Followed by: The 80186 & 80286 (16 bit processor), the 80386 & 80486 (a 32 bit processor), le ading to the Pentium range of microprocessors (64 bit processors) available today. The 80x86 and Pent ium processors have all been designed for use in personal computer type applications and have large memo ry maps. Department of EEE Page 23

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

Department of EEE Page 24

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

Department of EEE Page 25

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

M MMMMI IIIIC CCCCR RRRRO OOOOC CCCCO OOOON NNNNT TTTTR RRRRO OOOOL LLLLL LLLLE EEEER RRRR A microcontroller is a single chip VLSI unit called microcomputer which though h aving limited computational capabilities processes enhanced i/p-o/p capabilities and a number of on chip fun ctional 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 Department of EEE Page 26

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

A microcontroller is a functional computer system-on-a-chip. It contains a proce ssor, memory, and programmable input/output peripherals. Microcontrollers include an integrated CPU, memory (a small amount of RAM, progr am 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 Department of EEE Page 27

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 applic ation 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 tak en for a context switching for a period called latency period. 2.Atomic ALU operations n to solve data share problems-during multitasking operatio

E.g.: large scale embedded system i860 or i960 embedding a VLSI chip including RI SC and CISC operational features.-image processing and aerodynamic applications Examples : ARM 7, INTEL i960, AMD 29050 Department of EEE Page 28

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

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 Developme nt Environment (IDE). Department of EEE Page 29

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 b e available at all. A compiler or retarget able compiler might have to be develope d 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 & accu mulates units (MAC). DSP has large number of applications such as image processing, audio, video & te lecommunication 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 Processi ng Streaming and Data Networks and Image, Video and Speech: PNX 1300, PNX 1500 (200 2) Department of EEE Page 30

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

3.GPP OR ASIP CORE (S) GPP or ASIP Integrated into either an Application Specific Integrated Circuit (A SIC), 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 Department of EEE Page 31

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 app roximately 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. Department of EEE Page 32

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 contactless 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

Department of EEE Page 33

Introduction to Embedded system [UNIT-I] V.V.C.E.T a. Functions Assigned to the ROM or EPROM or Flash 1. Storing 'Application' program from where the processor fetches the instructio n codes 2. Storing codes for system booting, initializing, Initial input data and String s. 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, time r and RTC interrupts, software interrupts and Exceptions (vi) Linking Embedded System Hardware Linking and interfacing circuit for the Buses by using the appropriate multiplex ers, 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 Mbp s), 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. Department of EEE Page 34

Introduction to Embedded system [UNIT-I] V.V.C.E.T MEMORY TECHNOLOGIES Memory is an essential part of all microprocessor based systems. Different memor y 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 'Ra ndom Access' refers to the fact that we can access any position in the memory equally fast. RAM is u sed 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 t he 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 che ap, high density technology. The capacitors need to be recharged periodically and so DRAM needs t o be refreshed frequently. DRAM forms the basis for most computer memory. Usually DRAM is used together wit h 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. Department of EEE Page 35

Introduction to Embedded system [UNIT-I] V.V.C.E.T 1.3 Special RAM Types i. SDRAM Synchronous Dynamic RAM is a DRAM based technology which has been enhanced to im prove 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 acce ss 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 enhanc ed 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 h igh 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 co mputers 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 b oard which had the RAM chips on it. The SIMM normally stood upright on the motherboard and occu pied less real estate. The SIMM concept was taken further with the 72 pin SIMM. This SIMM had more connecti on points to allow for wider busses.72 pin SIMM's had either FPM (slower) RAM chips on them or EDO (fas ter)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 pin s than the SIMMs. DIMM's had 10ns access time device (called PC100 for the 100MHz bus that connect ed to them) or 7.5ns access time devices (called PC133) on them. When PC's started using DDR th en a new form factor was introduced. DDR modules come in a variety of speeds, commonly up to 400MHz. High er 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. Department of EEE Page 36

Introduction to Embedded system [UNIT-I] V.V.C.E.T 2. READ ONLY MEMORY (ROM) Read Only Memory is a memory which is made to store data on a permanent basis. W e call this non-volatile memory. ROM is used in computing systems to store programs, long-term data and i t 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 f or very high volume production when the data (or program) has been thoroughly tested. This is a chea p 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 co uld 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 hig h 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 spe ctacular. Department of EEE Page 37

Introduction to Embedded system [UNIT-I] V.V.C.E.T EPROM has a fairly limited endurance. Endurance is the number of times that a de vice 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 availabl e. These devices are EPROM inside, but have no quartz window. Because of the volumes, the program ming 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 i s 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 princ iple of operation to EEPROM. Flash memory attains much higher density than EEPROM and it has establis hed itself as a popular bulk storage medium. Flash memory has lower endurance than EEPROM. First generat ion Flash memory devices had endurance figures of around 100 cycles, but new devices will withsta nd 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 Programmable logic is ect up many gates. They consist of chips es are connected is determined by the way Technologies used to build up complex circuits without the need to conn which contain many logic gates. The way in which these gat 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 devi ces 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. Department of EEE Page 38

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 w as 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 typi cally had a JTAG (Joint Test and Access Group) interface for programming. This is an industr y standard (IEEE1149.1) four wire interface that has become one of the dominant programming and debuggin g 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 pro grammable 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 device s 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 . Department of EEE Page 39

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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, registe r, 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 cir cuits, 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. Department of EEE Page 40

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 Embe dding 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 Microelect ronics 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 operat ing 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 acc elerates 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) c ores, Programmable logic device and FPGA (Field Programmable Gate Array) cores. Other logic and analog units. Department of EEE Page 41

Introduction to Embedded system [UNIT-I] V.V.C.E.T IPs in SoC IP a standard source solution for synthesizing a higher-level component by configu ring 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 inc orporate 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 interfac es FPGA Core An FPGA consists of a large number of programmable gates on a VLSI chip. There i s a set of gates in each FPGA cell, called 'macro cell'. Embedded system designed with a view of offering enhancing functionalities in fu ture, 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-reco gnition (for recognizing a signature or finger print or DNA sequence). Configure an algorithm into the logic gates of the FPGA. Department of EEE Page 42

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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. It s very small size protects the card from bending Embedded hardware components in a contact less smart card Department of EEE Page 43

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 numb er 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 ba lance 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 integ er and floating pointsSmart Card OS Limiting features _ Limiting uses of the error handlers, exc eptions, signals, serialization, debugging and profiling. [Serialization means process of converti ng 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 el ementary 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 outpu t and streams, security management, digital-certification, symmetric and asymmetric keys-based cryptogra phy and digital signatures. Department of EEE Page 44

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 sof tware 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 u sed for entirely different applications or for new upgrades of the same system. Department of EEE Page 45

Introduction to Embedded system [UNIT-I] V.V.C.E.T Distinct ROM image in a distinct Embedded System Hardware elements between the distinct systems can be identical but it is the so ftware 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 decompre ssion algorithm OUTLINE ROM image Programming Languages Program models 1. Machine Language Coding Programmer defines the addresses and the corresponding bytes or bits at each add ress. Used in configuring some specific physical device or subsystem like transceiver, the machine codebased 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 Assem bler (software used for developing codes in assembly). Three steps when using assembly language 'Assembler', 'Linker' and 'Locator' Before finally burned at the ROM Department of EEE Page 46

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

Programming language C or C++ or Visual C++ or Java Application Software -Different Program Layers Department of EEE Page 47

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 cr eated 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 Department of EEE Page 48

Introduction to Embedded system [UNIT-I] V.V.C.E.T DEVICE DRIVERS, DEVICE MANAGER, OS, RTOS AND SOFTWARE TOOLS Device Device manager Multitasking using an operating system (OS) and Real time operating system (RTOS ) Software tools DEVICE 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), whi ch 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 softwar e interrupt 2. Placing appropriate bits at the control register or word. 3. Setting status flag(s) in the status register for interrupting, therefore run ning (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 detectin g the presence of devices, for initializing (configuring) these and for testing the Concurrent Pro cesses, 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 Department of EEE Page 49

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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, the ir preemptive scheduling RTOS and concurrent processes OS for providing deterministic performance during concurrent processing and exec ution 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. Department of EEE Page 50

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 Department of EEE Page 51

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 a nd 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, output s 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 Department of EEE Page 52

Introduction to Embedded system [UNIT-I] V.V.C.E.T Challenges in Embedded System Design: Optimizing the Design Metrics and Formalis m 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 syste m Optimizing according to the performance, power dissipation, cost and other desig n 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 b uses 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 eng ineering, 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 a nd disabling or controlling certain units when not needed is one method of saving power during p rogram execution Disable use of certain structural units of the processor to reduce power dissipa tion Caches when not necessary and Keep in disconnected state those structure units that are not needed during a pa rticular 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, po wer dissipation, processor clock rate and cost at minimum is a challenge Department of EEE Page 53

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 t he specifications and requirements to get a reliable product. Verification refers to an activity to ensure that specific functions are correct ly 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 Department of EEE Page 54

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 s laves. It sends the signals through sockets using IrDA protocols. The byte streams resp onses 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 m aster. 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 spe cific orchestra to be played. It receives the signals through sockets using IrDA protocols. The byte streams f rom 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 ta sks 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 acti on. Department of EEE Page 55

Introduction to Embedded system [UNIT-I] V.V.C.E.T Ports and Flash Memory The port outputs from the port(s) connect the motors and PWM outputs drive the m otors 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 m usic. 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 co mmands and slave robots play according to the signals from the master Department of EEE Page 56

Introduction to Embedded system [UNIT-I] V.V.C.E.T 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 s ystem? 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 sys tem. 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 p rocess 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) Department of EEE Page 57