Introduction to
EMBEDDED
SYSTEMS
. NE: "
le :
i. ane.
SHIBU KVE=— Tata McGraw Hill
Published by the Tata McGraw Hill Education Private Limited,
7 West Patel Nagar, New Delhi 110 008.
Copyright © 2009 by Tata McGraw Hill Education Private Limited.
No part of this publication may be reproduced or distributed in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise or stored in a database or retrieval system without the prior written permission
of the publishers. The program listings (if any) may be entered, stored and executed in a computer system, but they
may not be reproduced for publication.
This edition can be exported from India only by the publishers,
‘Tata McGraw Hill Education Private Limited
ISBN (13): 978-0-07-014589-4
Managing Director: Ajay Shukla
General Manager: Publishing—SEM & Tech Ed: Vibha Mahajan
Manager—Sponsoring: Shalini Jha
Associate Sponsoring Editor: Nilanjan Chakravarty
Development Editor: Surbhi Suman
Jr Executive—Editorial Services: Dipita Dey
Jt Manager—Production: Anjali Razdan
General Manager: Marketing —Higher Education: Michael J Cruz
Senior Product Manager: SEM & Tech Ed: Biju Ganesan
General Manager—Production: Rajender P Ghansela
Asst General Manager—Production: BL Dogra
Information contained in this work has beon obtained by Tata McGraw Hill, from sources believed to be reliable.
However, neither Tata McGraw-Hill nor its authors guarantee the accuracy or completeness of any information
published herein, and neither Tata McGraw-Hill nor its authors shall be responsible for any errors, omissions, or
damages arising out of use of this information. This work is published with the understanding that Tata McGraw Hill
and its authors are supplying information but are not attempting to render engineering or other professional services.
Ifsuch services are required, the assistance of an appropriate professional should be sought.
‘Typeset at The Composers, 260, C.A. Apt., Paschim Vihar, New Delhi 110 063 and printed at
Lalit Offset Printer 219, FIE, Patper Ganj, Industrial Area, Delhi-10092
Cover: SDR PrintersCTR
Preface xiii
Acknowledgements xvii
Part 1
Embedded Systes nderstanding the Basic Concepts
1.__ Introduction to Embedded Systems 3
1.1 What is an Embedded System? 4
12 Eml d Systems vs. General Computing Systems 4
1.3 History of Embedded Systems _5
1.4 Classification of Embedded Systems 6
1.5__ Major Application Areas of Embedded Systems 7
1.6 Purpose of Embedded Systems 8
1,7__ ‘Smart’ Running Shoes from Adidas—The Innovative Bonding of
Lifestyle with Embedded Technology //
Summary 13
Keywords 13
Objective Questions _14
Review Questions 14
2.__ The Typical Embedded System 15
2.1 Core of the Embedded System 17
2.2 Memory 28
2.3__Sensors and Actuators 35
2.4 Communication Interface 45
2.5 Embedded Firmware 59
2.6 Other System Components 60
2.7__ PCB and Passive Components 64
‘Summary 64
Keywords 65a one
Objective Questions _67
Review Questions 69
Lab Assignments 71
Characteristics and Quality Attributes of Embedded Systems
n
3.1 Characteristics of an Embedded System 72
3.2 Quality Attributes of Embedded Systems _74
Summary 79
Keywords 79
Objective Questions _80
Review Questions 81
Embedded Systems—Application- and Domain-Specific
83
4.1 Washing Machine—Application-Specific Embedded System 83
4.2 Automotive — Domain-Specific Examples of Embedded System 85
‘Summary 89
Keywords 90
Objective Questions 90
Review Questions 91
Designing Embedded Systems with 8bit Microcontrollers—805/
92
5.1 Factors to be Considered in Selecting a Controller _ 93
5.2__ Why 8051 Microcontroller 94
5.3 Designing with 805794
5.4 The 8052 Microcontroller 155
5.5 8051/52 Variants 155
Summary 156
Keywords 157
Objective Questions 158
Review Questions 161
Lab Assignments 162
Programming the 805/ Microcontroller
6.1 Different Addressing Modes Supported by 8051 165
6.2 The 805/ Instruction Set. 171
Summary 196
Keywords 197
Objective Questions 197
Review Questions 202
Lab Assignments 203
Hardware Software Co-Design and Program Modelling
7.1 Fundamenial Issues in Hardware Software Co-Design 205
7.2. Computational Models in Embedded Design 207
7.3 Introduction to Unified Modelling Language (UML) 2/4
7.4 Hardware Software Trade-off 2/9
Summary 220
20410.
Contents
Keywords 221
Objective Questions 222
Review Questions 223
Lab Assignments 224
Part 2
Design and Development of Embedded Product
Embedded Hardware Design and Development
Analog Electronic Components 229
Digital Electronic Components 230
VLSI and Integrated Circuit Design 243
Electronic Design Automation (EDA) Tools 248
How to use the OrCAD EDA Tool? 249
Schematic Design using Orcad Capture CIS 249
‘The PCB Layout Design 267
Printed Circuit Board (PCB) Fabrication 288
Summary 294
Keywords 294
Objective Questions 296
Review Questions 298
Lab Assignments 299
Embedded Firmware Design and Development
9.1
9.2
93
Embedded Firmware Design Approaches 303
Embedded Firmware Development Languages 306
Programming in EmbeddedC 318
Summary 371
Keywords 372
Objective Questions 373
Review Questions 378
Lab Assignments 380
Real-Time Operating System (RTOS) based Embedded System Design
10.1
10.2
10.3
10.4
10.5
10.6
10.7
10.8
10.9
10.10
Operating System Basics 382
Types of Operating Systems 386
Tasks, Process and Threads 390
Multiprocessing and Multitasking 402
Task Scheduling 404
Threads, Processes and Scheduling; Putting them Altogether 422
Task Communication 426
Task Synchronisation 442
Device Drivers 476
How to Choose an RTOS 478
Summary 480
Keywords 481
Objective Questions 483
228
302
381a ne
Review Questions 492
Lab Assignments 496
‘An Introduction to Embedded System Design with
VxWorks and MicroCiOS-II RTOS
11.1 VxWorks 499
11.2 MicroC/OS-Il 5/4
Summary 541
Keywords 542
Objective Questions 543
Review Questions 544
Lab Assignments 546
Integration and Testing of Embedded Hardware and Firmware
12.1 Integration of Hardware and Firmware 549
12.2. BoardPowerUp 553
Summary 554
Keywords 554
Review Questions 555
‘The Embedded System Development Environment
13.1. The Integrated Development Environment (IDE) 557
13.2. Types of Files Generated on Cross-compilation 588
13.3 Disassembler/Decompiler 597
13.4 Simulators, Emulators and Debugging 598
13.5 Target Hardware Debugging 606
13.6 Boundary Scan 608
Summary 610
Keywords 611
Objective Questions 612
Review Questions 612
Lab Assignments 613
Product Enclosure Design and Development
14.1 Product Enclosure Design Tools 616
14.2 Product Enclosure Development Techniques 616
143 Summary 6/8
Summary 618
Keywords 619
Objective Questions 620
Review Questions 620
‘The Embedded Product Development Life Cycle (EDLC)
15.1 Whatis EDLC? 622
15.2 Why EDLC 622
15.3. Objectives of EDLC 622
15.4 Different Phases of EDLC 625
498
548
556
615
621Contents
15.5 EDLC Approaches (Modeling the EDLC) 636
Summary 641
Keywords 642
Objective Questions 643
Review Questions 644
16. Trends in the Embedded Industry
16.1 Processor Trends in Embedded System 645
162 Embedded OS Trends 648
163 Development Language Trends 648
164 Open Standards, Frameworks and Alliances 651
16.5 Bottlenecks 652
Appendix I: Overview of PIC and AVR Family of Microcontrollers and ARM Processors
Introduction to PIC® Family of Microcontrollers 653
Introduction to AVR® Family of Microcontrollers 657
Introduction to ARM® Family of Processors 664
Appendix It: Design Case Studies
1. Digital Clock 669
2. Battery-Operated Smartcard Reader 699
3. Automated Meter Reading System (AMR) 701
4, Digital Camera 703
Bibliography
Index
645
653
669
706aeciiela:)
There exists a common misconception amongst students and young practising engineers that embed-
ded system design is ‘writing ‘C’ code’. This belief is absolutely wrong and I strongly emphasise that
embedded system design refers to the design of embedded hardware, embedded firmware in ‘C’ or other
supporting languages, integrating the hardware and firmware, and testing the functionalities of both.
Embedded system design is a highly specialised branch of Electronics Engineering where the techno-
logical advances of electronics and the design expertise of mechanical engineering work hand-in-hand
to deliver cutting edge technologies and high-end products to a variety of diverse domains including
consumer electronics, telecommunications, automobile, retail and banking applications. Embedded sys-
tems represent an integration of computer hardware, software along with programming concepts for
developing special-purpose computer systems, designed to perform one or a few dedicated functions.
The embedded domain offers tremendous job opportunities worldwide. Design of embedded system
is an art, and it demands talented people to take up the design challenges keeping the time frames in
mind. The biggest challenge faced by the embedded industry today is the lack of skilled manpower
in the domain. Though most of our fresh electronics and computer science engineering graduates are
highly talented, they lack proper training and knowledge in the embedded domain. Lack of suitable
books on the subject is one of the major reasons for this crisis. Although various books on embedded
technology are available, almost none of them are capable of delivering the basic lessons in a simple
and structured way. They are written from a high-end perspective, which are appropriate only for the
practising engineers.
This book ‘Introduction to Embedded Systems’ is the first-of-its-kind, which will appeal as a com-
prehensive introduction to students, and as a guide to practising engineers and project managers. It has
been specially designed for undergraduate courses in Computer Science & Engineering, Information
Technology, Electrical Engineering, Electronics & Communication Engineering and Instrumentation
& Control Engineering. Also, it will be a valuable reference for the students of BSc / MSc / MTech
(CS/IT/Electronics), MCA and DOEACC ‘B’ level courses.
‘The book has been organised in such a way to provide the fundamentals of embedded systems;
the steps involved in the design and development of embedded hardware and firmware, and their inte-
gration; and the life cycle management of embedded system development. Chapters 1 to 4 have beenot me
structured to give the readers a basic idea of an embedded system. Chapters 5 to 13 have been organised
to give an in-depth knowledge on designing the embedded hardware and firmware. They would be very
Helpful to practising embedded system engineers:Chapter-15 dealing with the design life cycle of an
embedded system would be beneficial to both practising engineers as well as project managers. Each
chapter begins with learning objectives, presenting the concepis in simple language supplemented with
ample tables, figures and solved examples. An important part of this book comes at the end of each
chapter where you will find a brief summary, list of keywords, objective questions (in multiple-choice
format) and review questions. To aid students commence experimentation in the laboratory, lab assign-
ments have been provided in relevant chapters. An extremely beneficial segment at the end of the book
is the overview of PIC & AVR Family of Microcontrollers & ARM Processors as well as innovative
design case studies presenting real-world situations
‘The major highlights of this book are as follows.
Brings an entirely different approach in the learning of embedded system. It looks at embedded
systems as a whole, specifies what it is, what it comprises of, what is to be done with it and how
to go about the whole process of designing an embedded system.
« Follows a design- and development-oriented approach through detailed explanations for Keil Mi-
cro Vision (i.e., embedded system/integrated development environment), ORCAD (PCB design
software tool) and PCB Fabrication techniques.
Practical implementation such as washing machines, automotives, and stepper motor and other
V/O device interfacing circuits.
«- Programming concepts: deals in embedded C, delving into basics to unravelling advance level
concepts.
© Complete coverage of the 805] microcontroller architecture and assembly language program:
ming.
« Detailed coverage of RTOS internals, multitasking, task management, task scheduling, task com-
munication and synchronisation. Ample examples on the various task scheduling policies.
* Comprehensive coverage on the internals of MicroC/OS-II and VxWorks RTOS kernels.
¢ Written in lucid, easy-to-understand language with strong emphasis on examples, tables and fig-
ures.
© Useful reference for practicing engineers not well conversant with embedded systems and their
applications.
« Rich Pedagogy includes objective questions, lab assignments, solved examples and review
questions.
The comprehensive online learning centre—http://www.mbhe.comy/shibw/esle— accompanying
this book offers valuable resources for students, instructors and professionals.
For Instructors
‘¢ PowerPoint slides (chapter-wise)
Abrief chapter on Embedded Programming Language C++/ Java
Case studies that are given in the book and one new case study on heart best monitoring system
Solution manual (chapter-wise)
Short questions, quizzes in the category of fill in the blanks, true/false and multiple choice ques-
tions (25); programming questions with solution (5). (Level of difficulty: hard)
Chapter-wise links to important websites and important text materialsPreface fe
For Students
‘© Chapter-wise tutorials
© A brief chapter on Embedded Programming Language C++/ Java
# Case studies that are given in the book and one new case study on heart beat monitoring system
Answers for objective questions/selected review questions and hints for lab assignments provided
in the book.
‘© Short questions, self-test quizzes in the category of fill in the blanks, true/false and multiple choice
questions (25); programming questions with solutions (5). (Level of difficulty: easy/medium)
© List of project ideas
© Chapter-wise links to important websites and important text materials.
‘This book is written purely on the basis of my working knowledge in the ficld of embedded hardware
and firmware design, and expertise in dealing with the life cycle management of embedded systems.
‘A few descriptions and images used in this book are taken from websites with prior written copyright
permissions from the owner of the site/author of the articles.
‘The design references and data sheets of devices including the parametric reference used in the il-
lustrative part of this book are taken from the following websites. Readers are requested to visit these
sites for getting updates and more information on design articles. Also, you can order some free samples
from some of the sites for your design.
www.intel.com Intel Corporation
www.maxim-ic.com Maxim/Dallas Semiconductor
www.atmel.com Atmel Corporation
yowwaanalog.com Analog Devices
www.microchip.com Microchip Technology
www.ti.com Texas Instruments
‘wWwW.nxp.com NXP Semiconductors
www.national.com National Semiconductor
irchildsemi.com Fairchild Semiconductor
aww. intersil,com Intersil Corporation
www.freescale.com Freescale Semiconductor
www.xilinx.com Xilinx (Programmable Devices)
ci Cadence Systems (Orcad Too!)
Keil (MicroVision 3 IDE)
Online Embedded Magazine
Electronic Design Magazine
T would be looking forward to suggestions for further improvement of the book. You may contact me
at the following email id—
[email protected] . Kindly mention the title and author name in
the subject line. Wish you luck as you embark on an exhilarating career path!
Shibu KVCopyrighted materialAcknowledgements
I take this opportunity to thank Mr Mohammed Rijas (Group Project Manager, Mobility and Embedded
Systems Practice, Infosys Technologies Ltd Thiruvananthapuram) and Mr Shafeer Badharudeen
(Senior Project Manager, Mobility and Embedded Systems Practice, Infosys Technologies Ltd
‘Thiruvananthapuram) for their valuable suggestions and guidance in writing this book. | am also grateful
tomy team and all other members of the Embedded Systems Group, Infosys Technologies for inspiring
me to write this book. I acknowledge my senior management team at the Embedded Systems and
Mobility practice, Infosys Technologies—Rohit P, Srinivasa Rao M, Tadimeti Srinivasan, Darshan
Shankavaram and Ramesh Adig—tor their constant encouragement and appreciation of my efforts. 1
am immensely grateful to Mr R Ravindra Kumar (Senior Director, CDAC Thiruvananthapuram) for
giving me an opportunity to work with the Hardware Design Group of CDAC (Erstwhile ER&DCI),
Mrs K G Sulochana (Joint Director CDAC Thiruvananthapuram) for giving me the first embedded
project to kick start my professional career and also for all the support provided to me during my tenure
with CDAC. I convey my appreciation to Mr Biju C Oommen (Addl. Director, Hardware Design Group,
CDAC Thiruvananthapuram), who is my great source of inspiration, for giving me the basic lessons of
embedded technology, Mr S Krishna Kumar Rao, Mr Sanju Gopal, Ms Deepa R S, Mr Shaji N M and
Mr Suresh R Pillai for their helping hand during my research activities at CDAC, and Mr Praveen VL
whose contribution in designing the graphics of this book is noteworthy. I extend my heartfelt gratitude
to all my friends and ex-colleagues of Hardware Design Group CDAC Thiruvananthapuram—without
their prayers and support, this book would not have been a reality. Last but not the least, I acknowledge
my beloved friend Dr Sreeja for all the moral support provided to me during this endeavor, and my
family members for their understanding and support during the writing of this book.
A token of special appreciation to Mr S Krishnakumar Rao (Deputy Director, Hardware Design
Group, CDAC Thiruvananthapuram) for helping me in compiling the section on VLSI Design and Mr
‘Shameerudheen P T for his help in compiling the section on PCB Layout Design using Orcad Layout
Tool.=x Actnonedgement
I would like to extend my special thanks to the following persons for coordinating and providing
timely feedback onal requests to the concerned product development/service companies, semiconductor
manufacturers and informative web pages.
Angela Williams of Keil Software
Natasha Wan, Jessen Wehrwein and Scott Wayne of Analog Devices
Derek Chan of Atmel Asia
Moe Rubenzahl of Maxim Dallas Semiconductor
Mark Aaldering and Theresa Warren of Xilinx
Anders Edholm of Electrolux
Vijayeta Karol of Honda Siel Cars India Ltd
Mark David of Electronic Design Magazine
Vidur Naik of Adidas India Division
Steven Kamin of Cadence Design Systems
Deepak Pingle and Pralhad Joshi of Advanced Micronic Devices Limited (AMDL)
Regina Kim of WiZnet Inc.
Taranbir Singh Kochar of Siemens Audiology India Division
Crystal Whitcomb of Linksys—A Division of Cisco Systems
Kulbhushan Seth of Casio India Co. Pvt. Ltd
Jitesh Mathur and Meggy Chan of Philips Medical Systems
John Symonds of Burn Technology Limited
Citron Chang of Advantech Equipment Corp
Michael Barr of Netrino Consultants Networks
Peggy Vezina of GM Media Archive
David Mindell of MIT
Frank Miller of pulsar.gs
Gautam Awasthi of Agilent Technologies India Pvt. Ltd
A note of acknowledgement is due to the following reviewers for their valuable suggestions for the
book.
Bimal Raj Dutta
Shri Ram Murti Smarak College of Engineering & Technology, Bareilly
Nilima Fulmare
Hindustan College of Science & Technology, Agra
PK Mukherjee
Institute of Technology, Banaras Hindu University, Varanasi
Kalyan Mahato
Government College of Engineering & Leather Technology, Kolkata
P Kabisatpathy
College of Engineering & Technology, Bhubaneswar
PK Dutta
North Eastern Regional Institute of Science and Technology College, ItanagarAcknowledgements psx
Prabhat Ranjan
Dhirubhai Ambani Institute of Information and Communication Technology (DAIICT), Gandhinagar
Lyla B Das
National Institute of Technology Calicut (NITC), Calicut
Finally, I thank the publishing team at McGraw-Hill Education India, more specifically Vibha Mahajan,
Shalini Jha, Nilanjan Chakravarty, Surbhi Suman, Dipika Dey, Anjali Razdan and Baldev Raj for their
praiseworthy initiatives and efficient management of the book.
Susu KVVisual Preview
+++( earning Objectives
Each chapter begins with Leaming igh
Objectives which provides readers
with specific outcomes they should
beable to achieve after mastering the
chapter content.
Sect
ms and Sub-sections
Each chapter has been neatly divided
into Sections and Sub-sections so
that the subject matter is studied in
4a logical progression of ideas and
ne Opens nt eens ain be ee
Provided at appropriate locations,
Solved Examples aid in a
understanding of the fundamentals
of embedded hardzvare and firmioare
design.Photographs of important
concepts, designs and architectural
descriptions bring the subject to
life.
EffectiveandaccurateIlustrations =
demonstrate the concepts, design
problems and steps involved in the
design of embedded systems.
=D
4.3.2 The Memory Orpaniation
4321 Te Pogram (Ca) Morey Te ai ee i oct ey
‘Speman orcip taney fan ag ean nae eaChapter Summary and Keywords
Se ees esa of
the various topics illustrated in the
chapter and Keywords highlight
the important chapter terminology.
1 amnion nc)
(0 Meena
Readers can assess their knowledge a
by answering the Objective
Questions in multiple-choice
format. Review Questions spur
students to apply and integrate
chapter content.Lab Assignment: ove
eM Toad students conduct experiments
inthe laboratory, Lab Assignments
have been provided at the end of
relevant chapters.
A comprehensive sct of five Case wi
Studies, at the end of the book
demonstrate the applications of
theoretical concepts.
Perot pe a ery
Sperm ny tee thre) ewe ine as hap
Revak mil atealtaeriaceomee ims
Seen ahs
Oa CELE
Microcontrollers and ARM Processors
Appendix on different family of
Microprocessors and Controllers
The Appendix section is intended
to give an overview of PIC & AVR
family of microcontrollers & ARM
processor.Copyrighted materialPART 1
EMBEDDED SYSTEM:
UNDERSTANDING THE BASIC CONCEPTS‘Understanding the basic concepts is essential in the learning of any subject. Designing an Embedded
System is not a herculean task if you know the fundamentals, Like any general computing systems,
Embedded Systems also possess a set of characteristics which are unique to the embedded system under
consideration. In contrast to the general computing systems, Embedded Systems are highly domain and
application specific in nature, meaning; they are specifically designed for certain set of applications in
certain domains like consumer electronics, telecom, automotive, industrial control, measurement sys-
tems etc. Unlike general computing systems it is not possible to replace an embedded system which is
specifically designed for an application catering to a specific domain with another embedded system
catering to another domain. The designer of the embedded system should be aware of its characteristics,
and its domain and application specific nature.
‘An embedded system is an electrica/electro mechanical system which is specifically designed for an
application cetering to a specific domain, Itis a combination of specislised hardware and firmware (soft-
ware), which is tailored to meet the requirements of the application under consideration. An embedded
system contains a processing unit which can be a microprocessor or a microcontroller or a System on
Chip (SoC) or an Application Specific Integrated Circuit (ASIC)/Application Specific Standard Product
(ASSP) or a Programmable Logic Device (PLD) like FPGA or CPLD, an V/O subsystem which faci
tates the interfacing of sensors and actuators which acts as the messengers from and iv the ‘Real world?
to which the embedded system is interacting, on-board and external communication interfaces for com-
municating between the various on-board subsystems and chips which builds the embedded system and
external systems to which the embedded system interacts, and other supervisory systems and support
units like watchdog timers, reset circuits, brown-out protection circuits, regulated power supply unit,
clock generation circuit etc. which empower and monitor the functioning of the embedded system. The
design of embedded system has two aspecis: The hardware design which takes care of the selection of
the processing unit, the various I/O sub systems and communication interface and the inter connec-
tion among them, and the design of the embedded firmware which deals with configuring the various
sub systems, implementing data communication and processing/controlling algorithm requirements.
Depending on the response requirements and the type of applications for which the embedded system
is designed, the embedded system can be a Real-time or a Non-real time system. The response require-
ments fora real-time system like Flight Control System, Airbag Deployment System for Automotive ete,
are time critical and the hardware and firmware design aspects for such systems should take these into
account, whereas the response requirements for non-real time systems like Aufomatic Teller Machines
(ATM), Media Playback Systems ete, need not be time critical and missing deadlines may be acceptable
in such systems.
Like any other systems, embedded systems also possess a set of quality attributes, which are the
non-functional requirements like security, scalability, availability, maintainability, safety, portability etc,
The non-functional requirements for the embedded system should be identified and should be addressed
properly in the system design. The designer of the embedded system should be aware of the different
non-functional requirement for the embedded system and should handle this properly to ensure high
quality.
This section of the book is dedicated for describing the basic concepts of Embedded Systems. The
chapters in this section are organised in a way to give the readers a comprehensive introduction to *Em-
bedded Systems, their application areas and their role in real life’, ‘The different elements of a typical
Embedded System’, the basic lessons on ‘The characteristics and quality attributes of Embedded Sys-
tems’, ‘Domain and Application specific usage examples for Embedded Systems’ and the ‘Hardware and
Software Co-design approach for Embedded System Design’, and a detailed introduction to ‘The archi-
tecture and programming concepts for 8051 Microcontrolier ~ The 8bit Microcontroller selected for our
design examples’. We will start the section with the chapter on “Introduction to Embedded Systems”Introduction to Embedded Systems
Q LEARNING OBJECTIVES
Learn what an Embedded System is
Learn the difference between Embedded Systems and General Computing Systems
Know the history of Embedded Systems
Learn the classification of Embedtled Systems based on performance, complexity and the era in which they evolved
Know the domains and areas of opplications of Embedded Systems
Understand the different purposes of Embedded Systems
Analysis of a real life example on the bonding of embedded technology with human life
a4 one
Our day-to-day life is becoming more and more dependent on “embedded systems” and digital
techniques. Embedded technologies are bonding into our daily activities even without our knowledge.
Do you know the fact that the refrigerator, washing machine, microwave oven, air conditioner, televi-
sion, DVD players, and music systems that we use in our home are built around an embedded system?
You may be traveling by a ‘Honda’ or « “Toyota’ or a ‘Ford’ vehicle, but have you ever thought of the
genius players working behind the special features and security systems offered by the vehicle to you? It
is nothing but an intelligent embedded system. In your vehicle itself the presence of specialised embed-
ded systems vary from intelligent head lamp controllers, engine controllers and ignition control systems
to complex air bag control systems to protect you in case of a severe accident. People experience the
power of embedded systems and enjoy the features and comfort provided by them. Most of us are to-
tally unaware or ignorant of the intelligent embedded systems giving us so much comfort and security.
Embedded systems are like reliable servants-they don’t like to reveal their identity and neither they
complain about their workloads to their owners or bosses. They are always sitting in a hidden place and
are dedicated to their assigned task till their last breath. This book gives you an overview of embedded
systems, the various steps involved in their design and development and the major domains where they
are deployed.=z Introduction to Embedded Systems
1.1 WHAT IS AN EMBEDDED SYSTEM?
An embedded system is an electronic/electro-mechanical system designed to perform a specific function
and is a combination of both hardware and firmware (software).
Every embedded system is unique, and the hardware as well as the firmware is highly specialised to
the application domain. Embedded systems are becoming an inevitable part of any product or equip-
ment in all fields including household appliances, telecommunications, medical equipment, industrial
control, consumer products, etc,
1.2 EMBEDDED SYSTEMS vs. GENERAL COMPUTING SYSTEMS
The computing revolution began with the general purpose computing requirements, Later it was realised
that the general computing requirements are not sufficient for the embedded computing requirements.
‘The embedded computing requirements demand ‘something special’ in terms of respunse to stimuli,
meeting the computational deadlines, power efficiency, limited memory availability, etc. Let's take the
case of your personal computer, which may be either a desktop PC or a laptop PC or a palmtop PC. It
is built around a general purpose processor like an Intel® Centrino or a Duo/Quad! core or an AMD
Turion™ processor and is designed to support a set of multiple peripherals like multiple USB 2.0
ports, Wi-Fi, ethernet, video port, IEEE1394, SD/CF/MMC external interfaces, Bluetooth, ete and with
additional interfaces like a CD read/writer, on-board Hard Disk Drive (HDD), gigabytes of RAM, etc.
You can load any supported operating system (like Windows® XP/Vista/7, or Red Hat Linux/Ubuntu
Linux, UNIX etc) into the hard disk of your PC. You can write or purchase a multitude of applications
for your PC and can use your PC for running a large number of applications (like printing your dear’s
photo using a printer device connected to the PC and printer software, creating a document using Micro-
soft® Office Word tool, etc.) Now let us think about the DVD player you use for playing DVD movies.
Is it possible for you to change the operating system of your DVD? Is it possible for you to write an ap-
plication and download it to your DVD player for executing? Is it possible for you to add a printer soft-
ware to your DVD player and connect a printer to your DVD player to take a printout? Is it possible for
you to change the functioning of your DVD player to a television by changing the embedded software?
The enswers to all these questions are ‘NO’. Can yousee any general purpose interface like Bluetooth or
Wi-Fi on your DVD player? Of course ‘NO’. The only interface you can find out on the DVD player
is the interface for connecting the DVD player with the display screen and one for controlling the
DVD player through a remote (May be an IR or any other specific wireless interface). Indeed your
DVD player is an embedded system designed specifically for decoding digital video and generat-
ing a video signal as output to your TV or any other display screen which supports the display inter-
face supported by the DVD Player. Let us summarise our findings from the comparison of embedded
system and general purpose computing system with the help of a table:
General Purpose Computing System Embedded System
A system which is a combination of generic hardware A system which is a combination of special purpose
and a General Purpose Operating System for executing a hardware and embedded OS for executing a specific set
variety of applications of applications
Contains a General Purpose Operating Sysiem (GPOS) May or may not contain an operating system ior
functioning
‘The illustration given here is based on the processor details availabe til Des 2008. Since processor technology is undergoing rapid
changes, the processor names mentioned here may not be relevant in future,Introduction to Embedded Systems
Applications are alterable (programmable) by the user
(it is possible for the end user to re-install the operating
system, and also add or remove user applications)
Performance is the key deciding factor in the selection of
the system. Always, ‘Faster is Better’
Lesv/not at all tailored towards reduced operating power
requirements, options for different levels of power
‘management,
Response requirements are not time-critical
The firmware of the embedded system is pre-programmed
and it is non-alterable by the end-wser (There may be
exceptions for systems supporting OS kemel image
flashing through special hardware settings)
Application-specific requirements (like performance,
power requirements, memory usage, ete.) are the key
deciding factors
Highly tailored t0 take advantage of the power saving
modes supported by the hardware and the operating
system
For certain category of embedded systems like mission
critical systems, the response time requirement is highly
critical
Need not be deterministic in execution behaviour
Execution behaviour is detemministic for certain types of
embedded systems like ‘Hard Real Time’ systems
However, the demarcation between desktop systems and embedded systems in certain areas of
embedded applications are shrinking in certain contexts. Smart phones are typical examples of this.
Nowadays smart phones are available with RAM up to 256 MB and users can extend most of their
desktop applications to the smart phones and it waives the clause “Embedded systems are designed for
a specific application” from the characteristics of the embedded system for the mobile embedded device
category. However, smart phones come with a built-in operating system and it is not modifiable by the
end user. It makes the clause: “The firmware of the embedded system is unalterable by the end user”,
still a valid clause in the mobile embedded device category.
1.3
[STORY OF EMBEDDED SYSTEMS
Embedded systems were in existence even before the IT revolution. In the olden days embedded systems
were built around the old vacuum tube and transistor technologies and the embedded algorithm was
developed in low level languages. Advances in semiconductor and nano-technology and IT revolution
gave way to the development of miniature embedded systems. The first recognised modern embedded
system is the Apollo Guidance Computer (AGC) developed by the MIT Instrumentation Laboratory for
the lunar expedition. They ran the inertial guidance systems of both the Command Module (CM) and
the Lunar Excursion Module (LEM). The Command Module was designed to encircle the moon while
the Lunar Module and its crew were designed to go down to the moon surface and land there safely. The
Lunar Module featured in total 18 engines. There were 16 reaction control thrusters, a descent engine
and an ascent engine. The descent engine was ‘designed to” provide thrust to the lunar module out of
the lunar orbit and land it safely on the moon. MIT's original design was based on 4K words of fixed
memory (Read Only Memory) and 256 words of erasable memory (Random Access Memory). By June
1963, the figures reached 10K of fixed and 1K of erasable memory. The final configuration was 36K
words of fixed memory and 2K. words of erasable memory. The clock frequency of the first microchip
proto model used in AGC was 1.024 MHz and it was derived from a 2.048 MHz crystal clock. The
computing unit of AGC consisted of approximately 11 instructions and 16 bit word logic. Around 5000
ICs (G-input NOR gates, RTL logic) supplied by Fairchild Semiconductor were used in this design. The
user interface unit of AGC is known as DSKY (display/keyboard). DSKY looked like a calculator type
keypad with an array of numerals, It was used for inputting the commands to the module numerically.Ao 4 Introduction to Embedded Systems
‘The first mass-produced embedded system was the guidance computer for the Minuteman-I mis-
sile in 1961. It was the “Aufoneticys D-17” guidance computer, built using discrete transistor logic and a
hard-disk for main memory. The first integrated circuit was produced in September 1958 but comput-
ers using them didn’t begin to appear until 1963. Some of their early uses were in embedded systems,
notably used by NASA for the Apollo Guidance Computer and by the US military in the Minuteman-II
intercontinental ballistic missile.
1.4 CLASSIFICATION OF EMBEDDED SYSTEMS
It is possible to have a multitude of classifications for embedded systems, based on different criteria,
Some of the criteria used in the classification of embedded systems are:
1. Based on generation
2. Complexity and performance requirements
3. Based on deterministic behaviour
4, Based on triggering.
The classification based on deterministic system behaviour is applicable for ‘Real Time’ systems.
The application/task execution behaviour for an embedded system can be either deterministic or non-
deterministic, Based on the execution behaviour, Real Time embedded systems are classified into Hard
and Soft. We will discuss about hard and soft real time systems in 2 later chapter, Embedded Systems
which are ‘Reactive’ in nature (Like process control systems in industrial control applications) can be
classified based on the trigger. Reactive systems can be either event triggered o time triggered.
1.4.1 Classification Based on Generation
This classification is based on the order in which the embedded processing systems evolved from the
first version to where they are today. As per this criterion, embedded systems can be classified into:
1.4.1.1 First Generation The early embedded systems were built around 8bit microprocessors
like 8085 and Z80, and 4bit microcontrollers. Simple in hardware circuits with firmware developed in
Assembly code. Digital telephone keypads, stepper motor control units etc. are examples of this.
1.4.1.2 Second Generation These are embedded systems built around | 6bit microprocessors and
8 or 16 bit microcontrollers, following the first generation embedded systems. The instruction set for
the second generation processors/controllers were much more complex and powerful than the first gen-
eration processors/controllers. Some of the second generation embedded systems contained embedded
operating systems for their operation. Data Acquisition Systems, SCADA systems, etc. are examples of
second generation embedded systems.
1.4.1.3 Third Generation With advances in processor technology, embedded system developers
started making use of powerful 32bit processors and 16bit microcontrollers for their design. A new con-
cept of application and domain specific processors/controllers like Digital Signal Processors (DSP) and
Application Specific Integrated Circuits (ASICs) came into the picture. The instruction set of processors
became more complex and powerful and the concept of instruction pipelining also evolved, The proces-
sot market was flooded with different types of processors from different vendors. Processors like Intel
Pentium, Motorola 68K, etc. gained attention in high performance embedded requirements. Dedicated
embedded real time and general purpose operating systems entered into the embedded market. Embed-
ded systems spread its ground to areas like robotics, media, industrial process control, networking, etc.Introduction to Embedded Systems
1.4.1.4 Fourth Generation The advent of System on Chips (SoC), reconfigurable processors and
multicore processors are bringing high performance, tight integration and miniaturisation into the em-
bedded device market. The SoC technique implements a total system on a chip by integrating different
functionalities with a processor core on an integrated circuit. We will discuss about SoCs ina later chap-
ter. The fourth generation embedded systems are making use of high performance real time embedded
operating systems for their functioning. Smart phone devices, mobile internet devices (MIDs), ete. are
examples of fourth generation embedded systems.
1.4.1.5 What Next? The processor and embedded market is highly dynamic and demanding. So
‘what will be the next smart move in the next embedded generation?’ Let’s wait and see.
1.4.2 Classification Based on Complexity and Performance
This classification is based on the complexity and system performance requirements. According to this
classification, embedded systems can be grouped into:
1.4.2.1 Small-Scale Embedded Systems Embedded systems which are simple in application
needs and where the performance requirements are not time critical fall under this category. An elec-
tronic toy is a typical example of a small-scale embedded system. Small-scale embedded systems are
usually built around low performance and low cost 8 or 16 bit microprocessorsimicrocontrollers. A
small-scale embedded system may or may not contain an operating system for its functioning.
1.4.2.2 Medium-Scale Embedded Systems Embedded systems which are slightly complex
in hardware and firmware (software) requirements fall under this category. Medium-scale embedded
_ systems are usually built around medium performance, low cost 16 or 32 bit microprocessors/microcon-
trollers or digital signal processors. They usually contain an embedded operating system (either general
Purpose or real time operating system) for functioning.
1.4.2.3 Large-Scale Embedded Systems/Complex Systems Embedded systems which
involve highly complex hardware and firmware requirements fall under this category. They ate em-
ployed in mission critical applications demanding high performance. Such systems are commonly built
around high performance 32 or 64 bit RISC processors/controllers or Reconfigurable System on Chip
(RSC) or multi-core processors and programmable logic devices. They may contain multiple proces-
sors/controllers and co-units/hardware accelerators for offloading the processing requirements from the
main processor of the system, Decoding/encoding of media, cryptographic function implementation,
etc, are examples for processing requirements which can be implemented using 2 co-processor/hard-
ware accelerator. Complex embedded systems usually contain a high performance Real Time Operating
‘System (RTOS) for task scheduling, prioritization and management.
1.5 MAJOR APPLICATION AREAS OF EMBEDDED SYSTEMS
We are living in a world where embedded systems play a vital role in our day-to-day life, starting from
home to the computer industry, where most of the people find their job for a livelihood, Embedded
technology has acquired a new dimension from its first generation model, the Apollo guidance computer,
to the latest radio navigation system combined with in-car entertainment technology and the micropro-
cessor based “Smart” running shocs launched by Adidas in April 2005, The application areas and the
products in the embedded domain are countless. A few of the important domains and products are listed
below:<= Introduction to Embedded Systems
Consumer electronics: Camcorders, cameras, etc.
2. Household appliances: Television, DVD players, washing machine, fridge, microwave oven, etc.
3, Home automation and security systems: Air conditioners, sprinklers, intruder detection alarms,
closed circuit television cameras, fire alarms, etc.
4, Automotive industry: Anti-lock breaking systems (ABS), engine control, ignition systems,
automatic navigation systems, etc.
5. Telecom: Cellular telephones, telephone switches, handsct multimedia applications, ctc.
6. Computer peripherals: Printers, scanners, fax machines, etc.
7. Computer networking systems: Network routers, switches, hubs, firewalls, etc.
8. Healthcare: Different kinds of scanners, EEG, ECG machines etc.
9. Measurement & Instrumentation: Digital multi meters, digital CROs, logic analyzers PLC
systems, etc.
10. Banking & Retail: Automatic tellet machines (ATM) and currency counters, point of sales (POS)
11. Card Readers: Barcode, smart card readers, hand held devices, etc.
PURPOSE OF EMB!
As mentioned in the previous section, embedded systems are used in various domains like consumer
electronics, home automation, telecommunications, automotive industry, healthcare, control & instru-
mentation, retail and banking applications, etc. Within the domain itself, according to the application
usage context, they may have different functionalities. Each embedded system is designed to serve the
purpose of any one or a combination of the following tasks:
1, Data collection/Storage/Representation
2. Data communication
3, Data (signal) processing
4, Monitoring
5. Control
6. Application specific user interface
1.6.1 Data Collection/Storage/Representation
Embedded systems designed for the purpose of data collection performs acquisition of data from the
extemal world. Data collection is usually done for storage, analysis, manipulation and transmission.
The term “data” refers all kinds of information, viz. text, voice, image, video, electrical signals and any
other measurable quantities. Data can be either analog (continuous) or digital (discrete). Embedded sys-
tems with analog data capturing techniques collect data directly in the form of analog signals whereas
embedded systems with digital data collection mechanism conver's the analog signal to corresponding
digital signal using analog to digital (A/D) converters and then collects the binary equivalent of the
analog data. If the data is digital, it can be directly captured without any additional interface by digital
embedded systems.
The collected data may be stored directly in the system or may be transmitted to some other systems
or it may be processed by the system or it may be deleted instantly after giving a meaningful representa-
tion, These actions are purely dependent on the purpose for which the embedded system is designed.
Embedded systems designed for pure measurement applications without storage, used in control andIntroduction to Embedded Systems i,
instrumentation domain, collects data and gives a meaningful representation of the collected data by
means of graphical representation or quantity value and deletes the collected data when new data arrives
at the data collection terminal. Analog and digital CROs without storage memory are typical examples
of this. Any measuring equipment used in the medical domain for monitoring without storage function
ality also comes under this category.
‘Some embedded systems store the collected data for processing and analysis. Such systems incor
porate a built-in/plug-in storage memory for storing the captured data. Some of them give the user a
meaningful representation of the collected data
by visual (graphical/quantitative) or audible
means using display units [Liquid Crystal Dis-
play (LCD), Light Emitting Diode (LED), etc.]
buzzers, alarms, etc, Examples are: measuring
instruments with storage memory and monitor
ing instruments with storage memory used in
medical applications. Certain embedded systems
store the data and will not give a representation
of the same to the user, whereas the data is used
for internal processing.
‘A digital camera is a typical example of an
embedded system with data collection/storage/
representation of data. Images are captured and ‘A digital camera for image capturing/
the captured image may be stored within the
memory of the camera. The captured image can
also be presented to the user through a graphic
LCD unit.
1.6.2 Data Communication
Embedded data communication systems are deployed in
applications ranging from compiex satellite communi-
cation systems to simple home networking systems. As
mentioned earlier in this chapter, the data collected by an
embedded terminal may require transferring of the same
to some other system located remotely. The transmission
is achieved either by a wire-line medium or by a wire-
Jess medium, Wire-line medium was the most common
choice in all olden days embedded systems. As technolo-
gyis changing, wireless medium is becoming the de-facto
standard for data communication in embedded systems.
Awireless medium offers cheaper connectivity solutions
and make the communication link free from the hassle of
wire bundles. Data can either be transmitted by analog
means or by digital means. Modem industry trends are
settling towards digital communication.
The data collecting embedded terminal itself can
incorporate data communication units like wireless
storage/dicplay
(Photo courtesy of Casio-Model EXILIM ex-2850
(wnnw.casio.com))
wireless network router for data
comeaetice
(Photo courtesy of Linksys
ion ne
ton)fio Fl Introduction to Embedded Systems
modules (Bluetooth, ZigBee, Wi-Fi, EDGE, GPRS, ete.) or wire-line modules (RS-232C, USB, TCP/IP,
PS2, etc.). Certain embedded systems act as a dedicated transmission unit between the sending and
receiving terminals, offering sophisticated functionalities like data packetizing, enerypting and decrypt-
ing. Network hubs, routers, switches, etc. are typical examples of dedicated data transmission embedded
systems. They act as mediators in data communication and provide various features like data security,
monitoring etc.
1.6.3 Data (Signal) Processing
‘As mentioned earlier, the data (voice, image, video, elec-
trical signals and other measurable quantities) collected
by embedded systems may be used for various kinds of
data processing. Embedded systems with signal process-
ing funetionalities are employed in applications demand-
ing signal processing like speech coding, synthesis, audio
video codec, transmission applications, ete.
‘A digital hearing aid is a typical example of an embed-
ded system employing data processing, Digital hearing aid
improves the hearing capacity of hearing impaired persons.
1.6.4 Monitoring Saige thewioneld moricriy:
Embedded systems falling under this category are spe- (Giemens TRANO 3 Digital hearing aid;
cifically designed for monitoring purpose. Almost all See toy Cree 00)
embedded products coming under the medical domain are
with monitoring functions only. They are used for determining the state of some variables using input
sensors. They cannot impose control over variables. A very good example is the electro cardiogram
(ECG) machine for monitoring the heartbeat of a patient. The machine is intended to do the monitoring
of the heartbeat. It cannot impose control over the
heartbeat. The sensors used in ECG are the different
electrodes connected to the patient’s body.
Some other examples of embedded systems with
monitoring function are measuring instruments like
digital CRO, digital multimeters, logic analyzers,
etc. used in Control & Instrumentation applications.
They are used for knowing (monitoring) the status
of some variables like current, voltage, etc. They
cannot control the variables in turn.
woe ee wm
Eee o)
PHIUPS
1.6.5 Control
Embedded systems with control functionalities
impose control over some variables according to the A patient monitoring system for
ent : itoring heartbeat
changes in input variables. A system with control ane ar Pulies nadia Sais
functionality contains both sensors and actuators. (sem medical phiipscom/)
Sensors are connected to the input port for capturingIntroduction to Embedded Systems a
the changes in environmental variable or measuring variable. The actuators connected to the output port
are controlled according to the changes in input variable to put an impact on the controlling variable to
bring the controlled variable to the specified range.
Air conditioner system used in our home to control the room temperature to a specified limit isa typi-
cal example for embedded system for control purpose. An airconditioner contains a room temperature
sensing element (sensor) which may be a therm-
istor and a handheld unit for setting up (feeding)
the desired temperature, The handheld unit may
be connected to the central embedded unit resid-
ing inside the airconditioner through a wireless link
or through a wired link. The air compressor unit FSG21HRIA
acts asthe actuator, The compressor is controlled 573)
according to the current room temperature and the
desired temperature set by the end user.
Here the input variable is the current room tem-
perature and the controlled variable is also the room
“An Airconditioner for controlling room
temperature. Embedded System with
Control functionality”
(Photo courtesy of Electrolux Corporation
(wwsrelectrolux.com/au))
temperature. The controlling variable is cool air flow by the compressor unit. If the controlled variable
and input variable are not at the same value, the controlling variable tries to equalise them through
taking actions on the cool air flow.
1.6.6 Application Specific User Interface
‘These are embedded systems with application-specifie user
interfaces like buttons, switches, keypad, lights, bells, display
units, etc. Mobile phone is an example for this. In mobile phone
the user interface is provided through the keypad, graphic LCD
module, system speaker, vibration alert, etc.
1.7. ‘SMART’ RUNNING SHOES FROM
ADIDAS—THE INNOVATIVE BOND-
ING OF LIFESTYLE WITH EMBEDDED
TECHNOLOGY
After three years of extensive research work, Adidas launched
the “Smart” running shoes in the market in April 2005. The term
“Smart Shoe” may sound gimmicky. But adaptive cushioning
provided by the shoe makes sense, and the design engineer-
ing behind the shoes is very impressive. The shoe constantly
adapts its shock-absorbing characteristics to customize its value
to the individual runner, depending on the running style, pace,
body weight, and running surface. The shoe uses a magnetic
sensing system to measure cushioning level, which is adjusted
via a digital signal processing unit that controls a motor-driven
cable system.
An erbodded system with
an application-specific user
interface
(hts orto Moin
Nobile Hunde Grnezoiacom)Ek Introduction to Embedded Systems
A hall effect sensor is positioned at the top of the “cushioning element”, and the magnet is placed at
the bottom of the element. As the cushioning compresses on each impact, the sensor measures the dis-
tance from top to bottom of mid-sole (accurate to 0.1 mm). About 1000 readings per second are taken
and relayed to the shoe’s microprocessor. The Microprocessor (MPU) is positioned under the arch of
the shoe, It runs an algorithm that compares the compression messages received from the sensor to a
preset range of proper cushioning levels, so it understands if the shoe is too soft or too firm. Then the
MPU sends a command to a micro motor, housed in the mid-foot. The micro motor turns a lead screw
to lengthen or shorten a cable secured to the walls of a plastic-cushioning element. When the cable is
shortened, the cushioning element is pulled taut and compresses very little. A longer cable allows for
a more cushioned feel. A replaceable 3-V battery powers the motor and lasts for about 100 hours of
running.
The Portland, Ore-based Adidas Innovation Team that developed the shoe was led by Christian
DiBenedetto. It also included electromechanical engineer Mark Oleson, as well as a footwear developer
and two industrial designers. Oleson explains that the team chose a magnetic sensor because it could
measure the amount of compression in addition to the time it took to reach full compression. Gather-
ing sensor data, he says, meant little without building a comparative “running context”. So one of the
first steps in developing the MPU algorithms was building this database. Runners wore test shoes that
gathered information about various compression levels during a run. Then the runners were interviewed
to learn their thoughts about the different cushion
levels. “When the two matched up, that helped
validate our sensor,” says Oleson.
‘Adaptations in the cushioning element account
for the change of running surface and pace of the
runner, and they’re made gradually over an aver-
age of four running steps. The goal is for the run-
ner not to fecl any sudden changes. Adaptations
are made during the “swing” phase rather than the
“stance” phase of the stride (i.e. when the foot is
off the ground). Ifthe shoe’s owner prefers a more
cushioned or a firmer “ride,” adjustments can be
made via “+” and “—” buttons that also activate the
intelligent functions of the shoe.
LED indicators confirm when the electronics
are turned on (The lights do not remain on when
the shoes are in usc). If the shoes aren’t turned on,
they operate like old-fashioned “manual” running
shoes. The shoes tur off if their owner is either
inactive or at a walking pace for 10 minutes.
Source Electronic Design
www. electronicdesign.com/Articles/Index. Electronics-enabled “Smart” running
efm?AD=1 ticleID=10113 shoes from Adidas
Re-printed with permission (Photo courtesy ofa Salomon AG
(onmadidas.com))Introduction to Embedded Systems Eh
Q
Summary
¥ An embedded system is an Electronic/Electro-mechanical system designed to perform a specific function and is.
a combination of both hardware and firmware (Software).
Y A general purpose computing system is a combination of generic hardware and general purpose operating
system for executing a variety of applications, whereas an embedded system is a combination of special purpose
hardware and embedded OS/firmware for executing a specific set of applications.
¥ Apollo Guidance Computer (AGC) is the first recognised modern embedded system and ‘Autonetics D-17°, the
guidance computer for the Minuteman-1 missile, was the first mass-produced embedded system.
Y Based on the complexity and performance requirements, embedded systems are classified into small-scale,
‘medium-scale and large-scale/complex.
¥ The presence of embedded systems vary from simple electronic toys to complex flight and missile control
systems.
¥ Embedded systems are designed to serve the purpose of any one or s combination of data collection/storage/
representation, data communication, data (signal) processing, monitoring, control or application specific user
interface.
Keywords
Embedded system : An clectionic/electro-mechanical system which is designed to perform a specific function and
is a combination of both hardware and firmware
Microprocessor + A silicon chip representing a Central Processing Unit (CPU)
Microcontroller: A highly integrated chip that contains a CPU, scratchpad RAM, special and general purpose
register arrays and integrated peripherals
DSP + Digital Signal Processor is a powerful special purpose 8/16/32 bit microprocessor designed
specifically to mect the computational demands and power constraints
ASIC + Application Specific Integrated Circuitis a microchip designed to performa specific or unique
application
Sensor + A transducer device that converts energy from one form to another for any measurement or
control purpose
Actuator + A form of transducer device (mechanical or electrical) which converss signals to correspond
ing physical action (motion)
LED + Light Emitting Diode, An output device producing visual indication in the form of light in
accordance with current flow
Buzzer + Apiczo-clectric device for generating audio indication. It contains a piezo-electric diaphragm
which produces audible sound in response to the voltage applied to it
Operating system —: A piece of software designed to manage and allocate system resources and execute other
pieces of software
Electro Cardiogram : An embedded device for heartbeat monitoring
(ECG)
SCADA +: Supervisory Control and Data Acquisition System. A data acquisition system used in indus
trial control applications
RAM : Random Access memory. Volatile memory
ADC + Analog to Digital Converter. An integrated circuit which converts analog signals to digital
form1137 Introduction to Embedded Systems
Bluetooth
Wi
+ Alow cost, low power, short range witeless technology for data and voice communication
Wireless Fidelity is the popular wireless communication technique for networked communi~
tion of devices
1, Embedded systems are
(a) General parpose (®) Special purpose
2. Embedded system is
(a) An electronic system (b) A pure mechanical system
(©) An electto-mechanical system @ @or@
3. Which of the following is not true about embedded systems?
(a) Built around specialised hardware (b) Always contain an operating system
(©) Execution behaviour may be deterministic (@) Allof these
(©) None of thes
4, Which of the following is not an example of a “Small-scale Embedded System"?
(a) Electronic Barbie doll (b) Simple calculator
(©) Cell phone (d) Electronic toy car
5. The fist recognised modern embedded system is
(a) Apple Computer (b)_ Apotlo Guidance Computer (AGC)
(©) Calculator (@) Radio Navigation System
6. The first mass produced embedded system is
(a) Minuteman-1 (b) Minuteman-I1
(©) Autonetics D-17 (@) Apollo Guidance Computer (AGC)
7. Which of the following is (are) an intended purpose(s) of embedded systems?
(@) Data collection (b) Data processing (¢). Data communication
(@) All ofthese (©) None of these
8. Which of the following is an (are) example(s) of embedded system for data communication’
(a) USB Mass storage device (b) Network router
(©) Digital camera (@) Music player
© All ofthese (®) None of these
9. A digital multi meter is an example of an embedded system for
(@) Data communication (b) Monitoring (©) Control (@) Allof these
(©) None of these
10. Which of the following is an (are) example(s) of an embedded system for signal processing?
(@) Apple iPOD (media player device) (b) SanDisk USB mass storage device
(©) Both (a) and (b) (A) None of these
1, What is an embedded system? Explain the different applications of embedded systems.
2. Explain the various purposes of embedded systems in detail with illustrative examples
3. Explain the different classifications of embedded systems. Give an example for each.The Typical Embedded System
S)
LEARNING OBJECTIVES
¥ Lear the building blocks of a typical Embedded System
¥ Lear about General Purpose Processors (GPPs), Application Specific Instruction Set Processors (ASIPs), Micropro-
cessors, Microcontrollers, Digital Signal Processors, RISC & CISC processors, Harvard and Von-Neumann Processor
Architecture, Big-endian v/s Little endian processors, Load Store operation and Instruction pipelining
Y Learn about different PLDs like Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays
(FPGAs), etc.
¥ Lear about the different memory technologies and memory types used in embedded system development
Learn about Masked ROM (MROM), PROM, OTP, EPROM, EEPROM and FLASH memory for embedded firmware storage
Learn about Serial Access Memory (SAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory
(DRAM) and Nonvolatile SRAM (NVRAM)
Understand the different factors to be considered in the selection of memory for embedded systems
Understand the role of sensors, actuators and their interfacing with the 1/0 subsystems of an embedded system
¥ Learn about the interfacing of LEDs, 7-segment LED Displays, Piezo Buzzer, Stepper Motor, Relays, Optecouplers,
Matrix keyboard, Push button switches, Programmable Peripheral Interface Device (e.g. 8255 PPI), etc. with the
1/0 subsystem of the embedded system
Y- Learn about the different communication interfaces of an embedded system
Understand the various chip level communication interfaces like I2C, SPI, UART, 1-wire, parallel tus, etc.
Understand the different wired ond wireless external communication interfaces lke RS-232C, RS-485, Parallel Port,
USB, IEEE1394, Infrared (110A), Bluetooth, Wi-Fi, ZigBee, GPRS, etc.
¥ Know what embedded firmware is and its role in embedded systems
¥ Understand the difjerent system components like Reset Circuit, Brown-out protection circuit, Oscillator Unit, Real-
Time Clock (RTC) and Watchdog Timer unit
Y Understand the role of PCB in erbedded systems
A typical embedded system (Fig. 2.1) contains a single chip controller, which acts as the master brain
of the system. The controller can be a Microprocessor (e.g. Inte! 8085) or a microcontroller (c.g. Atmel
ATR9C51) ora Field Programmable Gate Array (FPGA) device (e.g. Xilinx Spartan) or a Digital Signal
Processor (DSP) (e.g. Blackfin® Processors from Analog Devices) or an Application Specific IntegratedBc & Introduction to Embedded Systems
FPGA/ASIC/DSP/SoC
Microprocessor/controller
@ 4 ‘Communication ntertace
Up ports Gp aatie
—p p ports
(Sensors): (Actuators)
+
Otter ‘supporting
weprated circuits &
subsystems
Embedded
Firmware
Embedded System
Real World
Elements ofan embedded system
Cireuit (ASIC)/Application Specific Standard Product (ASSP) (e.g. ADE7760 Single Phase Energy
Meireing IC from) Analog Devices for energy metering applications).
Embedded hardware/software systems are basically designed to regulate a physical variable or toma
nipulate the state of some devices by sending some control signals to the Actuators or devices connected
to the O/p ports of the system, in response to the input signals provided by the end users or Sensors
which are connected to the input ports. Hence an embedded system can be viewed as a reactive system.
The control is achieved by processing the information coming from the sensors and user interfaces, and
controlling some actuators that regulate the physical variable.
Key boards, push button switches, etc. are examples for common user interface input devices where-
as LEDs, liquid crystal displays, piezoelectric buzzers, etc. are examples for common user interface
output devices for a typical embedded system. It should be noted that it is not necessary that all embed-
ded systems should incorporate these I/O user interfaces. It solely depends on the type of the application
for which the embedded system is designed. For example, if the embedded system is designed for any
handheld application, such as a mobile handset application, then the system should contain user inter-
faces like a keyboard for performing input operations and display unit for providing users the status of
various activities in progress.
Some embedded systems do not require any manual intervention for their operation. They automati-
cally sense the variations in the input parameters in accordance with the changes in the real world, to
which they are interacting through the sensors which are connected to the input port of the system. TheThe Typical Embedded System p77
sensor information is passed to the processor after signal conditioning and digitisation, Upon receiving
the sensor data the processor or brain of the embedded system performs some pre-defined operations
with the help of the firmware embedded in the system and sends some actuating signals to the actua-
tor connected to the output port of the embedded system, which in tum acts on the controlling variable
to bring the controlled variable to the desired level to make the embedded system work in the desired
manner.
The Memory of the system is responsible for holding the control algorithm and other important con-
figuration details. For most of embedded systems, the memory for storing the algorithm or configuration
data is of fixed type, which is a kind of Read Only Memory (ROM) and it is not available for the end
user for modifications, which means the memory is protected from unwanted user interaction by imple-
menting some kind of memory protection mechanism. The most common types of memories used in
embedded systems for control algorithm storage are OTP, PROM, UVEPROM, EEPROM and FLASH.
Depending on the control application, the memory size may vary from a few bytes to megabytes, We
will discuss them in detail in the coming sections. Sometimes the system requires temporary memory
for performing arithmetic operations or control algorithm execution and this type of memory is known
as “working memory”. Random Access Memory (RAM) is used in most of the systems as the working
memory. Various types of RAM like SRAM, DRAM and NVRAM are used for this purpose. The size
of the RAM also varies from a few bytes to kilobytes or megabytes depending on the application. The
details given under the section “Memory” will give you a more detailed description of the working
memory.
‘An embedded system without a control algorithm implemented memory is just like anew born baby.
Itis having all the peripherals but is not capable of making any decision depending on the situational as
well as real world changes. The only difference is that the memory of a new bom baby is self-adaptive,
meaning that the baby will try to learn from the surroundings and from the mistakes committed. For
embedded systems it is the responsibility of the designer to impart intelligence to the system.
In a controller-based embedded system, the controller may contain internal memory for storing the
control algorithm and it may be an EEPROM or FLASH memory varying from a few kilobytes to mege-
bytes. Such controllers are called controllers with on-chip ROM, e.g. Atmel AT89C51. Some controllers
may not contain on-chip memory and they require an extemal (off-chip) memory for holding the control
algorithm, e.g, Intel 8031AH.
2.1 CORE OF THE EMBEDDED SYSTEM
Embedded systems are domain and application specific and are built around a central core. The core of
the embedded system falls into any one of the following categories:
1. General Purpose and Domain Specific Processors
1.1 Microprocessors
1.2 Microcontrollers
1.3 Digital Signal Processors
2. Application Specific Integrated Circuits (ASICs)
3. Programmable Logic Devices (PLDs)
4. Commercial off-the-shelf Components (COTS)
If you examine any embedded system you will find that it is built around any of the core units men-
tioned above.1, Introduction o Embecked Systems
2.1.1 General Purpose and Domain Specific Processors
Almost 80% of the embedded systems are processor/controller based. The processor may be a micro-
processor or a microcontroller or a digital signal processor, depending on the domain and application.
Most of the embedded systems in the industrial control and monitoring applications make use of the
commonly available microprocessors or microcontrollers whereas domains which require signal
ing such as speech coding, speech recognition, ete. make use of special kind of digital signal
sors supplied by manufacturers like, Analog Devices, Texas Instruments, etc.
2.1.1.1 Microprocessors A Microprocessor is a silicon chip representing a central processing unit
(CPU), which is capable of performing arithmetic as well as logical operations according to a pre-de-
fined set of instructions, which is specific to the manufacturer. In general the CPU contains the Arith-
metic and Logic Unit (ALU), control unit and working registers. A microprocessor is a dependent unit
and it requires the combination of other hardware like memory, timer unit, and interrupt controller, etc.
for proper functioning. Intel claims the credit for developing the first microprocessor unit /ntel 4004,
a Abit processor which was released in November 1971. It featured IK data memory, a 12bit program
counter and 4K program memory, sixteen 4bit general purpose registers and 46 instructions. It ran at a
clock speed of 740 kHz. It was designed for olden day’s calculators. In 1972, 14 more instructions were
added to the 4004 instruction set and the program space is upgraded to 8K. Also interrupt capabilities
were added to it and it is renamed as Intel 4040. It was quickly replaced in April 1972 by Iniel 8008
Which was similar to /nte! 4040, the only difference was that its program counter was 14 bits wide and
the 8008 served as a terminal controller. In April 1974 Intel launched the first 8 bit processor, the Intel
8080, with 16bit address bus and program counter and seven 8bit registers (A-E,H,L: BC, DE, and HL.
pairs formed the 16bit register for this processor). Inte! 8080 was the most commonly used processors
for industrial control and other embedded applications in the 1975s. Since the processor required other
hardware components as mentioned earlier for its proper functioning, the systems made out of it were
bulky and were lacking compactness.
Immediately after the release of Inte! 8080, Motorola also entered the market with their processor,
Motorola 6800 with a different architecture and instruction set compared to 8080.
In 1976 Intel came up with the upgraded version of 8080 — intel 8085, with two newly added instruc-
tions, three interrupt pins and serial I/O. Clock generator and bus controller circuits were built-in and
the power supply part was modified to a single +5 V supply.
In July 1976 Zilog entered the microprocessor market with its Z80 processor as competitor to Intel.
‘Actually it was designed by an ex-Intel designer, Frederico Faggin and it was an improved version of
Intel's 8089 processor, maintaining the original 8080 architecture and instruction set with an Sbit data
bus and a 16bit address bus and was capable of executing all instructions of 8080. It included 80 more
new instructions and it brought out the concept of register banking by doubling the register set. Z80 also
included two sets of index registers for flexible design.
Technical advances in the field of semiconductor industry brought a new dimension to the micro-
processor market and twentieth century witnessed a fast growth in processor technology. 16, 32 and
64 bit processors came into the place of conventional 8bit processors. The initial 2 MHz clock is now
an old story. Today processors with clock speeds up to 2.4 GHz are available in the market, More and
more competitors entered into the processor market offering high speed, high performance and low cost
processors for customer design needs.
Intel, AMD, Freescale, IBM, TI, Cyrix, Hitachi, NEC, LSI Logic, ete. are the key players in the
processor market. Intel still leads the market with cutting edge technologies in the processor industry.The Typical Embedded System EL
Different instruction set and system architecture are available for the design of a microprocessor.
Harvard and Von-Neumann are the two common system architectures for processor design. Processors
based on Harvard architecture contains separate buses for program memory and data memory, whereas
processors based on Von-Neumann architecture shares a single system bus for program and data memo-
ry. We will discuss more about these architectures later, under a separate topic. Reduced Instruction Set
Computing (RISC) and Complex Instruction Set Computing (CISC) are the two common Instruction
Set Architectures (ISA) available for processor design. We will discuss the same under a separate topic
in this section.
2.1.1.2 General Purpose Processor (GPP) vs. Application-Specific Instruction Set Processor
(ASIP) AGeneral Purpose Processor or GPP is a processor designed for general computational tasks.
The processor running inside your laptop or desktop (Pentium 4/AMD Athlon, ete.) is a typical ex-
ample for general purpose processor. They are produced in large volumes and targeting the general
market. Due te the high volume production, the per unit cost for a chip is low compared to ASIC or
other specific ICs. A typical general purpose processor contains an Arithmetic and Logic Unit (ALU)
and Control Unit (CU). On the other hand, Application Specific Instruction Set Processors (ASIPs)
are processors with architecture and instruction set optimised to specific-domain/application require-
ments like network processing, automotive, telecom, media applications, digital signal processing, con-
trol applications, etc. ASIPs fill the architectural spectrum between general purpose processors and
Application Specific Integrated Circuits (ASICs). The need for an ASIP arises when the traditional
general purpose processor are unable to meet the increasing application needs. Most of the embedded
systems are built around application specific instruction set processors, Some microcontrollers (like
automotive AVR, USB AVR from Atmel), system on chips, digital signal processors, etc. are examples
for application specific instruction set processors (ASIPs). ASIPs incorporate a processor and on-chip
peripherals, demanded by the application requirement, program and data memory.
2.1.1.3 Microcontrollers A Microcontroller isa highly integrated chip that contains a CPU, scratch
pad RAM, special and general purpose register arrays, on chip ROM/FLASH memory for program stor-
age, timer and interrupt control units and dedicated 1/0 ports. Microcontrollers can be considered as a
super set of microprocessors. Since a microcontroller contains all the necessary functional blocks for
independent working, they found greater place in the embedded domain in place of microprocessors.
Apart from this, they are cheap, cost effective and are readily available in the market.
Texas Instrument's TMS /000 is considered as the world's first microcontroller. We cannot say itas 2
fully functional microcontroller when we compare it with modern microcontrollers. TI followed Intel's
4904/4040, 4 bit processor design and added some amount of RAM, program storage memory (ROM)
and I/O support on a single chip, there by climinated the requirement of multiple hardware chips for
self-functioning, Provision to add custom instructions to the CPU was another innovative feature of
TMS 1000. TMS 1000 was released in 1974,
In 1977 Intel entered the microcontroller market with a family of controllers coming under one
umbrella named MCS-48™ family. The processors came under this family were 8038HL, SO39HL,
S040AHL, 8048H, 8049H and 8050AH. Intel 8048 is recognised as Intel's first microcontroller and it
was the most prominent member in the MCS-48'" family. It was used in the original IBM PC key-
board. The inspiration behind 8048 was Fairchild’s F8 microprocessor and Intel's goal of developing a
low cost and small size processor. The design of 8048 adopted a true Harvard architecture where pro-
gram and data memory shared the same address bus and is differentiated by the related control signals.
TMCS-48™ isa trade mark owned by IntelB20 Introduction to Embedded Systems
Eventually Intel came out with its most fruitful design in the 8bit microcontroller domain-the 8051
family axd its derivatives. It is the most popular and powerful 8bit microcontroller ever built. It was
developed in the 1980s and was put under the family MCS-51. Almost 75% of the microcontrollers
used in the embedded domain were 805/ family based controllers during the 1980-90s. 8051 proces-
sor cores are used in more than 100 devices by more than 20 independent manufacturers like Maxim,
Philips, Atmel, etc. under the license from Intel. Due to the low cost, wide availability, memory efficient
instruction set, mature development tools and Boolean processing (bit manipulation operation) capabil-
ity, 8051 family derivative microcontrollers are much used in high-volume consumer electronic devices,
entertainment industry and other gadgets where cost-cutting is essential,
‘Another important family of microcontrollers used in industrial control and embedded applications is
the PIC family micro controllers from Microchip Technologies (It will be discussed in detail in a later
section of this book). It is a high performance RISC microcontroller complementing the CISC (complex
instruction set computing) features of 8051. The terms RISC and CISC will be explained in detail in a
separate heading.
‘Some embedded system applications require only 8bit controllers whereas some embedded applica-
tions requiring superior performance and computational needs demand 16/32bit microcontrollers. Infi-
neon, Freescale, Philips, Atmel, Maxim, Microchip ete. are the key suppliers of 16bit microcontrollers.
Philips tried to extend the 805/ family microcontrollers to use for 16bit applications by developing the
Philips XA (eXtended Architecture) microcontroller series.
8bit microcontrollers are commonly used in embedded systems where the processing power is not
a big constraint. As mentioned earlier, more than 20 companies are producing different flavours of the
8051 family microcontroller. They try to add more and more functionalities like built in SPI, I2C serial
buses, USB controller, ADC, Networking capability, etc. So the competitive market is driving towards
a. one-stop solution chip in microcontroller domain. High processing speed microcontroller families
like ARMI1 series are also available in the market, which provides solution to applications requiring
hardware acceleration and high processing capability.
Freescale, NEC, Zilog, Hitachi, Mitsubishi, Infineon, ST Micro Electronics, National, Texas Instru-
ments, Toshiba, Philips, Microchip, Analog Devices, Daewoo, Intel, Maxim, Sharp, Silicon Laborato-
ries, TDK, Triscend, Winbond, Atmel, etc. are the key players in the microcontroller market, Of these
Atmel has got special significance. They are the manufacturers of a variety of Flash memory based
microcontrollers. They also provide In-System Programmability (which will be discussed in detail in a
later section of this book) for the controller, The Flash memory technique helps in fast reprogramming
ofthe chip and thereby reduces the product development time. Atmel also provides another special fam-
ily of microcontroller called AVR (it will be discussed in detail in a later chapter), an 8bit RISC Flash
microcontroller, fast enough to execute powerful instructions in a single clock cycle and provide the
latitude you need to optimise power consumption.
The instruction set architecture of a microcontroller can be either RISC or CISC. Microcontrollers
are designed for either general purpose application requirement (general purpose controller) or domain-
specific application requirement (application specific instruction set processor). The Inte! 8051 micro-
controller is a typical example for a general purpose microcontroller, whereas the automotive AVR
microcontroller family from Atmel Corporation is a typical example for ASIP specifically designed for
the automotive domain,
2.1.1.4 Microprocessor vs Microcontroller The following table summarises the differences
between a microcontroller and microprocessor.The Typical Embedded System
Microprocessor
A silicon chip representing a central processing
unit (CPU), which is capable of performing arith-
metic as well as logical operations according to a
pre-defined set of instructions
It is a dependent unit. It requires the combina-
tion of other chips like timers, program and data
memory chips, interrupt controllers, etc, for fune-
tioning
Most of the time general purpose in design and
operation
Doesn't contain a built in 1/0 port. The /O port
functionality needs to be implemented with the
help of external programmable peripheral inter-
face chips like 8255
Targeted for high end market where performance
is important
Limited powersaving options compared to micto-
controllers:
Microcontroller
A microcontroller is.a highly integrated chip that
contains a CPU, scratchpad RAM, special and
general purpose register arrays, on chip ROM:
FLASH memory for program storage, timer and
interrupt control units and dedicated I/O ports
It is a self-contained unit and it doesn’t require
external interrupt controller, timer, UART, et. for
its functioning
Mostly application-oriented or domain-specific
Most of the processors contain multiple built-in
V/O ports which can be operated as a single 8 or 16
or 32 bit port or as individual port pins
Targeted for embedded market where perfor-
mance is not so critical (At present this demarca-
tion is invalid)
Inchides lot of power saving features
2.1.1.8 Digital Signal Processors Digital Signal Processors (DSPs) are powerful special purpose
8/16/32 bit microprocessors designed specifically to meet the computational demands and power con-
siraints of today’s embedded audio, video, and communications applications. Digital signal processors
are 2 to 3 times faster than the general purpose microprocessors in signal processing applications. This
is because of the architectural difference between the two. DSPs implement algorithms in hardware
which speeds up the execution whereas general purpose processors implement the algorithm in firm-
ware and the speed of execution depends primarily on the clock for the processors. In general, DSP can
be viewed as a microchip designed for performing high speed computational operations for ‘addition’,
‘subtraction’, ‘multiplication’ and ‘division’. A typical digital signal processor incorporates the follow-
ing key units:
Program Memory Memory for storing the program required by DSP to process the data
Data Memory Working memory for storing temporary variables and data/signal to be processed.
Computational Engine Performs the signal processing in accordance with the stored program
memory. Computational Engine incomporates many specialised arithmetic units and each of them oper-
ates simultaneously to increase the execution speed. It also incorporates multiple hardware shifters for
shifting operands and thereby saves execution time.
1/0 Unit Acts as an interface between the outside world and DSP. It is responsible for capturing sig-
nals to be processed and delivering the processed signalsAudio video signal processing, telecommunication and multimedia applications are typical examples
where DSP is employed. Digital signal processing employs a large amount of real-time calculations.
Sum of products (SOP) calculation, convolution, fast fourier transform (FFT), discrete fourier transform
(DFT), et, are some of the operations periormed by digital signal processors.
Blackfin®" processors from Analog Devices is an example of DSP which delivers breakthrough
signal-processing performance and power efficiency while also offering a full 32-bit RISC MCU pro-
gramming model. Blackfin processors present high-performance, homogeneous software targets, which
allows flexible resource allocation between hard real-time signal processing tasks and non real-time
control tasks. System control tasks can often run in the shadow of demanding signal processing and
multimedia tasks.
2.1.1.6 RISC vs. CISC Processors/Controllers The term RISC stands for Reduced Instruction
Set Computing. As the name implies, all RISC processors/controllers possess lesser number of instruc-
tions, typically in the range of 30 to 40. CISC stands for Complex Instruction Set Computing. From
the definition itself it is clear that the instruction set is complex and instructions are high in number.
From a programmers point of view RISC processors are comfortable since s/he needs to learn only a
few instructions, whereas for 2 CISC processor s/he needs to learn more number of instructions and
should understand the context of usage of each instruction (This scenario is explained on the basis of
a programmer following Assembly Language coding. For a programmer following C coding it doesn’t
matter since the cross-compiler is responsible for the conversion of the high level language instructions
to machine dependent code). Atmel AVR microcontroller is an example for a RISC processor and its in-
struction set contains only 32 instructions. The original version of 805/ microcontroller (e.g. AT89C51),
is. a CISC controller and its instruction set contains 255 instructions, Remember it is not the number of
instructions that determines whether a processor/controller is CISC or RISC. There are some other fac-
tors like pipelining features, instruction set type, etc. for determining the RISC/CISC criteria. Some of
the important criteria are listed below:
Introduction to Embedded Systems
ig 2 si RISC CISC
Lesser number of instructions Greater number of Instructions
Instruction pipelining and increased execution speed Generaliy no instruction pipelining feature
Orthogonal instruction se: (Allows exch instuction t Non-orthogonal instruction set (All instructions are not
‘operate on any register and nse any addressing mode)
Operitions are performed on registers only, the only
memory operations are lovd and store
A large number of registers are available
Programmer needs to write more code to execute a task
since the instructions are simpler ones
Single, fixed length instructions
Less silicon usage and pin count
With Harvard Architecture
allowed to operate on any register and use any addressing
mode, Its instruction-specific)
‘Operations are performed on registers or memory
depending on the instruction
Limited number of general purpose registers
Instructions are like macros in C language. A programmer
can achisve the desired functionality with a single
instruction which in tum provides the effect of using more
simpler single instcuctions in RISC
Variable length instructions
More silicon usage since more additional decoder logic is
required to implement the complex instruction decoding,
Can be Harvard or Von-Neumann Architecture
Thope now you are clear about the terms RISC and CiSC in the processor technology. Isnt it?
‘Blackfin is a Registered trademark of Analog Devices Inc.The Typical Embedded System A,
2.1.1.7 Harvard vs. Von-Neumann Processor/Controller Architecture The terms Harvard
and Von-Neumann refers to the processor architecture design.
Microprocessors/controtlers based on the Von-Neumann architecture shares a single common bus
for fetching both instructions and data, Program instructions and data are stored in a common main
memory. Von-Neumann architecture based processors/controllers first fetch an instruction and then
fetch the data to support the instruction from code memory. The two separate fetches slows down the
controller's operation, Von-Neumann architecture is also referred as Princeton architecture, since it was
developed by the Princeton University
Microprocessors/controllers based on the Harvard architecture will have separate data bus and in-
struction bus. This allows the data transfer and program fetching to ovcur simultaneously on both buses.
With Harvard architecture, the data memory can be read and written while the program memory is being
accessed. These separated data memory and code memory buses allow one instruction to execute while
the next instruction is fetched (“pre-fetching™). The pre-fetch theoretically allows much faster execution
than Von-Neumann architecture. Since some additional hardware logic is required for the generation of
control signals for this type of operation it adds silicon complexity to the system, Figure 2.2 explains the
Harvard and Von-Neumann architecture concept
Memory
[Prism Dats]
Sa +S]
Single shared bus
Harvard vs Von-Neumann architecture
The following table highlights the differences between Harvard and Von-Neumann architecture.
Harvard Architecture ‘Von-Neumann Architecture
Separate buses for instruction and data fetching Single shared bus for instruction and data fetching
Easier to pipeline so high pédformance Gan be achieved "Low perfortnanée compared to Harvard architecture
Comparatively high cost Cheaper
No méitiocy signin problenis Allows Self modifying code!
Since data memory and progiam memory are stored Since data memory and program memory are stored
physically in different k
Corruption of program memory corruption of program memory
tioris, no chances for accidental physically in the same chip, chances for’ accidental
2.1.1.8 Big-Endian vs, Little-Endian Processors/Controllers Endianness specifies the order
in which the data is stored in the memory by processor operations in a multi byte system (Processors
whose word size is greater than one byte). Suppose the word length is two byte then data ean be stored
in memory in two different ways:
1. Higher order of data byte at the higher memory and lower order of data byte at location just below
the higher memory.
2. Lower order of data byte at the higher memory and higher order of data byte at location just below
the higher memory.
'Self-modi
ing code is a code/instruction which modifies itself while executionEh Introduction to Embedded Systems
Little-endian (Fig. 2.3) means the lower-order byte of the data is stored in memory at the lowest ad-
dress, and the higher-order byte at the highest address. (The little end comes first For example, a4 byte
long integer Byte3 Byte? Bytel Byte0 will be stored in the memory as shown below:
ee
Base Address+0 Byte 0 Byteo 020000 (Base Address )
BascAddress+1 Byte 1 Byte 1 020001 (Base Address +1)
Base Address+2 Byte 2 Byte? 0x20002 (Base Address +2)
Base Address+3 Byte 3 Byte 3 020003 (Base Address +3)
Fig.2.8) Little-Endian operation
Big-endian (Fig. 2.4) means the higher-order byte of the data is stored in memory at the lowest address,
and the lower-order byte at the highest address. (The big end comes first.) For example, a 4 byte long,
integer Byte3 Byte2 Bytel Byte0 will be stored in the memory as follows":
Base Address “0 Byte3_ | Byte3— | 0420000 (Base Address )
Base Address+ 1 Byte2_ | Byte2 020001 (Base Address + 1)
Base Address+2 Byte 1 | Byte 1 0420002 (Base Address + 2)
Base Address~ 3 ByteO | ByteO | 020003 (Base Address + 3)
Big-Endian operation
2.1.1.9 Load Store Operation and Instruction Pipelining As mentioned earlier, the RISC pro-
cessor instruction set is orthogonal, meaning it operates on registers. The memory access related opera-
tions are performed by the special instructions /oad and store. If the operand is specified as memory
location, the content of it is loaded to a register using the /oad instruction. The instruction store stores
data from a specified register to a specified memory location. The concept of Load Store Architecture
is illustrated with the following example:
‘Suppose x, y and z are memory locations and we want to add the contents of x and y and store the
result in location z. Under the load store architecture the same is achieved with 4 instructions as shown
in Fig. 2.5.
The first instruction Joad RI, x loads the register RI with the content of memory location x, the sec-
ond instruction /oad R2,y loads the register R2 with the content of memory location y. The instruction
Note that the base address is chosen arbitrarily as 020000The Typical Embedded System Ey
— —S—
1
I> RI R2 3 aa
it
i Ls. 3. { are ——s
tt I ad R2,y ——> @)
ey 00 | 8d R3, RI, RZ—+
“y TF ALU. 3 | storeR3,¢ ——_+
: 23 I
t I
| 1
Dieters oe ee percrceartl
add R3, RI, R2 adds the content of registers R1 and R2 and stores the result in register R3. The next
instruction store R3,z stores the content of register R3 in memory location z.
The conventional instruction execution by the processor follows the fetch-decode-execute sequence.
Where the ‘fetch’ part fetches the instruction from program memory or code memory and the decode
part decodes the instruction to generate the necessary control signals. The execute stage reads the oper-
ands, perform ALU operations and stores the result. In conventional program execution, the fetch and
decode operations are performed in sequence. For simplicity let's consider decode and execution togeth-
cr. During the decode operation the memory address bus is available and if it is possible to effectively
utilise it for an instruction fetch, the processing speed can be increased. In its simplest form instruction
pipelining refers to the overlapped execution of instructions. Under normal program execution flow it
is meaningfil to fetch the next instruction to execute, while the decoding and execution of the current
instruction is in progress. If the current instruction in progress is a program control flow transfer instruc
tion like jump or call instruction, there is no meaning in fetching the instruction following the current
instruction. In such cases the instruction fetched is flushed and a new instruction fetch is performed to
fetch the instruction. Whenever the current instruction is executing the program counter will be loaded
with the address of the next instruction, In case of jump or branch instruction, the new location is known
only after completion of the jump or branch instruction. Depending on the stages involved in an instruc-
tion (fetch, read register and decode, execute instruction, access an operand in data memory, write back
the result to register, etc.), there can be multiple levels of instruction pipelining, Figure 2.6 illustrates the
concept of Instruction pipelining for single stage pipelining.
Clock pulses Clock pulses Clock pulses
fl
Fetch (PO)
Execute (PC— 1) Fetch (PC +1)
Execute (PC) Feich (PC+2)
PC : Program Counter Execute (PC + 1)
‘The single-stage pipelining concepta Introduction to Embedded Systems
2.1.2 Application Specific Integrated Circuits (ASICs)
Application Specific Integrated Circuit (ASIC) is a microchip designed to perform a specific or unique
application. It is used as replacement to conventional general purpose logic chips. It integrates several
functions into a single chip and there by reduces the system development cost. Most of the ASICs are
proprictary products. Asa single chip, ASIC consumes a very small arca in the total system and thereby
helps in the design of smaller systems with high capabilities/functionalities.
ASICs can be pre-fabricated for a special application or it can be custom fabricated by using the com-
ponents from a re-usable ‘building block’ library of components for a particular customer application.
ASIC based systems are profitable only for large volume commercial productions. Fabrication of ASICs
requires a non-refundable initial investment for the process technology and configuration expenses. This
investment is known as Non-Recurring Engineering Charge (NRE) and it is a one time investment.
If the Non-Recurring Engineering Charges (NRE) is bore by a third party and the Application
Specific Integrated Circuit (ASIC) is made openly available in the market, the ASIC is referred as
Application Specific Standard Product (ASSP). The ASSP is marketed to multiple customers just as a
general-purpose product is, but to a smaller number of customers since it is for a specific application.
“The ADE7760 Energy Metre ASIC developed by Analog Devices for Energy metreing applications is
a typical example for ASSP”.
Since Application Specific Integrated Circuits (ASICs) are proprietary products, the developers of
such chips may not be interested in revealing the internal details of it and hence it is very difficult to
point out an example of it. Moreover it will create legal disputes if an illustration of such an ASIC prod-
uct is given without getting prior permission from the manufacturer of the ASIC. For the time being,
et us forget about it, We will come back to it in another part of this book series (Namely, Designing
Advanced Embedded Systems).
2.1.3 Programmable Logic Devices
Logic devices provide specific functions, including device-to-device interfacing, data communication,
signal processing, data display, timing and control operations, and almost every other function a system
must perform. Logic devices can be classified into two broad categories-fixed and programmable. As
the name indicates, the circuits in a fixed logic device are permanent, they perform one function or set
of functions-once manufactured, they cannot be changed, On the other hand, Programmable Logic
Devices (PLDs) offer customers a wide range of logic capacity, features, speed, and voltage characteris-
tics-and these devices can be re-configured to perform any number of functions at any time.
With programmable logic devices, designers use inexpensive software tools to quickly develop, sim-
ulate, and test their designs. Then, a design can be quickly programmed into a device, and immediately
tested in a live circuit. The PLD that is used for this prototyping is the exact same PLD that will be used
in the final production of a piece of end equipment, such as a network router, a DSL modem, a DVD
player, or an automotive navigation system. There are no NRE costs and the final design is completed
much faster than that of a custom, fixed logic device. Another key benefit of using PLDs is that dur-
ing the design phase customers can change the circuitry as often as they want until the design operates
to their satisfaction. That’s because PLDs are based on re-writable memory technology-to change the
design, the device is simply reprogrammed. Once the design is final, customers can go into immediate
production by simply programming as many PLDs as they need with the final software design file.
2.1.3.1 CPLDsand FPGAs The two major types of programmable logic devices are Field Program-
mable Gate Arrays (FPGAs) and Complex Programmable Logic Devices (CPLDs). Of the two, FPGAs.The Typical Embedded System Ea
offer the highest amount of logic density, the most features, and the highest performance. The largest
FPGA now shipping, part of the Xilinx Virtex™' line of devices, provides eight million “system gates”
(the relative density of logic). These advanced devices also offer features such as built-in hardwired
processors (such as the IBM power PC), substantial amounts of memory, clock management systems.
and support for many of the latest, very fast device-to-device signaling technologies. FPGAs are used
in a wide variety of applications ranging from data processing and storage, to instrumentation, telecom-
munications, and digital signal processing.
CPLDs, by contrast, offer much smaller amounts of logic—up to about 10,000 gates. But CPLDs offer
very predictable timing characteristics and are therefore ideal for critical control applications. CPLDs
such as the Xilinx CoolRunner™" series also require extremely low amounts of power and are very in-
expensive, making them ideal for cost-sensitive, battery-operated, portable applications such as mobile
phones and digital handheld assistants
Advantages of PLD Programmable logic devices offer a number of important advantages over fixed
logic devices, including:
‘© PLDs offer customers much more flexibility during the design cycle because design iterations are
simply a matter of changing the programming file, and the results of design changes can be seen
immediately in working parts.
‘© PLDs do not require long lead times for prototypes or production parts-the PLDs are already on a
distributor's shelf and ready for shipment.
PLDsdo not require customers to pay for large NRE costs and purchase expensive mask sets-PLD
suppliers incur those costs when they design their programmable devices and are able to amortize
those costs over the multi-year lifespan of given line of PLDs,
‘* PLDs allow customers to order just the number of parts they need, when they need them, allowing
them to control inventory. Customers who use fixed logic devices often end up with excess inven-
tory which must be scrapped, or if demand for their product surges, they may be caught short of
parts and face production delays.
© PLDs can be reprogrammed even after a piece of equipment is shipped to a customer. In fact,
thanks to programmable logic devices, a number of equipment manufacturers now tout the ability
toadd new features or upgrade products that already are in the field. To do this, they simply upload
a new programming file to the PLD, via the Internet, creating new hardware logic in the system.
Over the last few years programmable logic suppliers have made such phenomenal technical ad-
vances that PLDs are now seen as the logic solution of choice from many designers. One reason for
this is that PLD suppliers such as Xilinx are “fabless” companies; instead of owning chip manufactur-
ing foundries, Xilinx outsource that job to partners like Toshiba and UMC, whose chief occupation is
making chips. This strategy allows Xilinx to focus on designing new produet architectures, software
tools, and intellectual property cores while having access to the most advanced semiconductor process
technologies. Advanced process technologies help PLDs in a number of key areas: faster performance,
integration of more features, reduced power consumption, and lower cost.
FPGAS are especially popular for prototyping ASIC designs where the designer can test his design by
downloading the design file into an FPGA device. Once the design is set, hardwired chips are produced
for faster performance.
Just a few years ago, for example, the largest FPGA was measured in tens of thousands of system
gates and operated at 40 MHz. Older FPGAs also were relatively expensive, costing often more than
$150 for the most advanced parts at the time. Today, however, FPGAs with advanced features offer
+ Virtex™ and CoolRuaner™ are the registered trademarks of Xilinx Inc.ih Introduction to Embedded Systems
lions of gates of logic capacity, operate at 300 MHz, can cost less than $10, and offer a new level of
integrated functions such as processors and memory.
2.1.4 Commercial Off-the-Shelf Components (COTS)
A Commercial Off-the-Shelf (COTS) product is one which is used ‘as-is’. COTS products are designed
in such a way to provide easy integration and interoperability with existing system components. The
COTS component itself may be developed around a general purpose or domain specific processor or
an Application Specific Integrated circuit or a programmable logic device. Typical examples of COTS
hardware unit are remote controlled toy car control units including the RF circuitry part, high perfor-
mance, high frequency microwave electronics (2-200 GHz), high bandwidth analog-to-digital convert
ers, devices and components for operation at very high temperatures, electro-optic IR imaging arrays,
UVAIR detectors, etc. The major advantage of using COTS is that they are readily available in the
market, are cheap and a developer can cut down his/her development time to a great extent. This in turn
reduces the time to market your embedded systems.
The TCP/IP plug-in module available from various
manufactures like ‘WIZnet’, ‘Freescale’, ‘Dynalog’, etc. . ee
are very good examples of COTS product (Fig. 2.7). This 7
network plug-in module gives the TCP/IP connectivity to o
the system you are developing. There is no need to design
this module yourself and write the firmware for the TCP/
IP protocol and data transfer. Everything will be read-
ily supplied by the COTS manufacturer. What you need
to do is identify the COTS for your system and give the
plug-in option on your board according to the hardware
plug-in connections given in the specifications of the SSan eee
COTS. Though multiple vendors supply COTS for the Pee eepaprdo tie
same application, the major problem faced by the end- of Widnet hith://wmw.wimet.co.kx/en/)
user is that there are no operational and manufacturing
standards. A Commercial off-the-shelf (COTS) component manufactured by a vendor need not have
hardware plug-in and firmware interface compatibility with one manufactured by a second vendor for
the same application. This restricts the end-user to stick to a particular vendor for a particular COTS.
This greatly affects the product design.
The major drawback of using COTS components in embedded design is that the manufacturer of the
COTS component may withdraw the product or discontinue the production of the COTS at any time if
a rapid change in technology occurs, and this will adversely affect a commercial manufacturer of the
embedded system which makes use of the specific COTS product.
2.2 MEMORY
Memory is an important part of a processor/controller based embedded systems. Some of the proces-
sors/controllers contain built in memory and this memory is referred as on-chip memory. Others do
not contain any memory inside the chip and requires external memory to be connected with the control-
ler/processor to store the control algorithm, It is called off-chip memory. Also some working memory
is required for holding data temporarily during certain operations. This section deals with the different
types of memory used in embedded system applications.The Typical Embedded System 22
2.2.1 Program Storage Memory (ROM)
The program memory or code storage memory of an embedded system stores the program instructions
and it can be classified into different types as per the block diagram representation given in Fig, 2.8.
Code memory NVRAM
PROM Masked ROM
(OTP) (MROM)
Fig.2.8) Classification of Program Memory (ROM)
The code memory retains its contents even afier the power to it is turned off. It is generally known as
non-volatile storage memory. Depending on the fabrication, erasing and programming techniques they
are classified into the following types.
2.2.1.1 Masked ROM (MROM) Masked ROM is a one-time programmable device. Masked ROM
makes use of the hardwired technology for storing data. The device is factory programmed by masking
and metallisation process at the time of production itself, according to the data provided by the end user.
The primary advantage of this is low cost for high volume production. They are the least expensive type
of solid state memory. Different mechanisms are used for the masking process of the ROM, like
1. Creation of an enhancement or depletion mode transistor through channel implant.
2. By creating the memory cell either using a standard transistor ora high threshold transistor. In the
high threshold mode, the supply voltage required to turn ON the transistor is above the normal
ROM IC operating voltage. This ensures that the transistor is always off and the memory cell
stores always logic 0.
Masked ROM is a good candidate for storing the embedded firmware for low cost embedded devices.
Once the design is proven and the firmware requirements are tested and frozen, the binary data (The
firmware cross compiled/assembled to target processor specific machine code) corresponding to it can
be given tothe MROM fabricator. The limitation with MROM based firmware storage is the inability to
modify the device firmware against firmware upgrades. Since the MROM is permanent in bit storage, it
1s not possible to alter the bit information
2.2.1.2 Programmable Read Only Memory (PROM) / (OTP) Unlike Masked ROM Memory,
One Time Programmable Memory (OTP) or PROM is not pre-programmed by the manufacturer. The
end user is responsible for programming these devices. This memory has nichrome or polysilicon wires
arranged ina matrix. These wires can be functionally viewed as fuses. It is programmed by a PROM
programmer which selectively burns the fuses according to the bit pattern to be stored. Fuses which a
not blown/burned represents a logic “|” whereas fuses which are blown/burmed represents a logic
The default state is logic “1". OTP is widely used for commercial production of embedded systems
whose proto-typed versions are proven and the code is finalised. Itis a low cost solution for commercial
production. OTPs cannot be reprogrammed.ia Introduction to Embedded Systems
2.2.1.3 Erasable Programmable Read Only Memory (EPROM) OTPs are not useful and
worth for development purpose. During the development phase the code is subject to continuous chang-
es and using an OTP each time to load the code is not economical. Erasable Programmable Read Only
Memory (EPROM) gives the flexibility to re-program the same chip. EPROM stores the bit information
by charging the floating gate of an FET. Bit information is stored by using an EPROM programmer,
which applies high voltage to charge the floating gate, EPROM contains a quartz crystal window for
erasing the stored information. If the window is exposed to ultraviolet rays for a fixed duration, the
entire memory will be erased. Even though the EPROM chip is flexible in terms of re-programmability,
it needs to be taken out of the circuit board and put in a UV eraser device for 20 to 30 minutes. So it is
a tedious and time-consuming process.
2.2.1.4 Electrically Erasable Programmable Read Only Memory (EEPROM) As the name
indicates, the information contained in the EEPROM memory can be altered by using electrical signals
at the register/Byte level. They can be erased and reprogrammed in-circuit. These chips include a chip
erase mode and in this mode they can be erased in a few milliseconds. It provides greater flexibility for
system design. The only limitation is their capacity is limited when compared with the standard ROM
(A few kilobytes).
2.2.1.5 FLASH FLASH is the latest ROM technology and is the most popular ROM technology used
in today’s embedded designs. FLASH memory is a variation of EEPROM technology. It combines the
re-programmubility of EEPROM and the high capacity of standard ROMs. FLASH memory is organ-
ised as sectors (blocks) or pages. FLASH memory stores information in an array of floating gate MOS-
FET transistors. The erasing of memory can be done at sector level or page level without affecting the
other sectors or pages. Each sector/page should be erased before re-programming. The typical erasable
capacity of FLASH is 1000 cycles. W27C512 from WINBOND (www.winbond.com) is an example of
64KB FLASH memory.
2.2.1.6 NVRAM Non-volatile RAM is a random access memory with battery backup. It contains
static RAM based memory and a minute battery for providing supply to the memory in the absence of
external power supply. The memory and battery are packed together in a single package. The life span
of NVRAM is expected to be around 10 years. DS/644 from Maxim/Dallas is an example of 32KB
NVRAM.
2.2.2 Read-Write Memory/Random Access Memory (RAM)
RAM is the data memory or working memory of the controller/processor. Controller/processor can
read from it and write to it. RAM is volatile, meaning when the power is tumed off, all the contents
are destroyed. RAM is a direct access memory, meaning we can access the desired memory location
directly without the need for traversing through the entire memory locetions to reach the desired
memory position (i.e. random access of memory location), This is in contrast to the Sequential Access
Memory (SAM), where the desired memory location is accessed by either traversing through the entire
memory or through a ‘seek’ method. Magnetic tapes, CD ROMs, ete. are examples of sequential access
memories, RAM generally falls into three categories: Static RAM (SRAM), dynamic RAM (DRAM)
and non-volatile RAM (NVRAM) (Fig, 2.9).
2.2.2.1 Static RAM (SRAM) Static RAM stores data in the form of voltage. They are made up of
flip-flops. Static RAM is the fastest form of RAM available. In typical implementation, an SRAM cell
(bit) is realised using six transistors (or 6 MOSFETs). Four of the transistors are used for building theThe Typical Embedded System
Read/Write
Memory (RAM)
SRAM
(EGBH) ciassincation of Working Memory (RAM)
NVRAM
latch (flip-flop) part of the memory cell and two for controlling the access. SRAM is fast in operation
due to its resistive networking and switching capabilities. In its simplest representation an SRAM cell
can be visualised as shown in Fig. 2.10:
BitLine B\
Bit Line B
This implementation in its simpler form can be
visualised as two-cross coupled inverters with read!
write control through transistors. The four transis-
tors in the middle form the cross-coupled inverters.
This can be visualised as shown in Fig. 2.11.
From the SRAM implementation diagram, it is
clear that access to the memory cell is controlled
by the line Word Linc, which controls the access
transistors (MOSFETs) QS and Q6. The access tran-
sistors control the connection to bit lines B & B\. In
Write control Read control
>
LK
>
| a PBO....PB7
Higher onder , Pon B
Address bus |
Address bus aes
(A8...A15) =
If Por C je
RD\Pin 5
WR) Pin 36
RESET Pin 35
Interfacing of 8255 with an & bit microcontroller
The ports of 8255 can be configured for different modes of operation by the processor/controller.The Typical Embedded System gE
2.4 COMMUNICATION INTERFACE
Communication interface is essential for communicating with various subsystems of the embedded
system and with the external world. For an embedded product, the communication interface can be
viewed in two different perspectives; namely; Device/board level communication interface (Onboard
Communication Interface) and Product level communication interface (External Communication Inter-
face). Embedded product is a combination of different types of components (chips/devices) arranged on
a printed cireuit board (PCB). The communication channel which intereonnects the various components
within an embedded product is referred as device*board level communication interface (onboard com-
munication interface). Seria! interfaces like 12C, SPI, UART, 1-Wire, etc and parallel bus interface are
examples of ‘Onboard Communication Interface’.
Some embedded systems are self-cuntained units and they don’t require any interaction and data
transfer with other sub-systems or external world, On the other hand, certain embedded systems may be
a part of a large distributed system and they require interaction and dats transfer between various devie~
es and sub-modules. The ‘Product level communication interface’ (Extemal Communication Interface)
is responsible for data transfer between the embedded system and other devices or modules. The exter
nal communication interface can be either a wired media or a wireless media and it can be a ser
parallel interface. Infrared (IR), Bluetooth (BT), Wireless LAN (Wi-Fi), Radio Frequency waves (RF),
GPRS, ete. are examples for wireless communication interface. RS-232C/RS-422/RS-485, USB, Eth-
emet IEEE 1394 port, Parallel port, CF-II interface, SDIO, PCMCIA, ete, are examples for wired inter-
faces. It is not mandatory that an embedded system should contain an extemal communication interface.
Mobile communication equipment is an example for embedded system with extemal communication
interface.
The following section gives you an overview of the various ‘Onboard’ and ‘External’ communica-
tion interfaces for an embedded product. We will discuss about the various physical interface, firmware
requirements and initialisation and communication sequence for these interfaces in a dedicated book
titled ‘Device Interfacing’, which is planned under this series.
2.4.1 Onboard Communication Interfaces
Onboard Communication Interface refers to the different communication channels/buses for intercon-
necting the various integrated circuits and other peripherals within the embedded system. The following
section gives an overview of the various interfaces for onboard communication.
2.4.1.1 Inter Integrated Circuit (12C) Bus The Inter Integrated Circuit Bus (I2C-Pronounced
“I square C*) is a synchronous bi-directional half duplex (one-directional communication at a given
point of time) two wire serial interface bus. The concept of I2C bus was developed by “Philips semi-
conductors’ in the early 1980s. The original intention of I2C was to provide an easy way of connection
between a microprocessor/microcontroller system and the peripheral chips in television sets. The 2C
bus comprise of two bus lines, namely; Serial Clock-SCL and Serial Data-SDA. SCL line is respon-
sible for generating synchronisation clock pulses and SDA is responsible for transmitting the serial data
across devices. 12C bus is a shared bus system to which many number of I2C devices can be connected.
Devices connected to the 12C bus can act as either ‘Master’ device or ‘Slave’ device. The “Master?
device is responsible for controlling the communication by initiating/terminating data transfer, sending
data and generating necessary synchronisation clock pulses. ‘Slave’ devices wait for the commandsBas Introduction to Embedded Systems
from the master and respond upon receiving the commands. ‘Master’ and ‘Slave’ devices can act as
either transmitter or receiver. Regardless whether a master is acting as transmitter or receiver, the syn-
chronisation clock signal is generated by the ‘Master’ device only. I2C supports multi masters on the
same bus. The following bus interface diagram shown in Fig. 2.26 illustrates the connection of master
and slave devices on the I2C bus.
SCL SDA Nee
2.2K
NWN
2.2K
Port pins {|
Slave 1
RC Device
Mate Ge Seal
(Microprocessor! EEPROM)
Controller)
Slave 2
RC Device
LY
12€ bus
12C Bus Interfacing
The I2C bus interface is built around an input buffer and an open drain or collector transistor. When
the bus is in the idle state, the open drain/collector transistor will be in the floating state and the output
lines (SDA and SCL) switch to the ‘High Impedance’ state. For proper operation of the bus, both the bus
lines should be pulled to the supply voltage (+5V for TTL family and +3.3V for CMOS family devices)
using pull-up resistors. The typical value of resistors used in pull-up is 2.2K. With pull-up resistors, the
output lines of the bus in the idle state will be ‘HIGH’
The address of a 12C device is assigned by hardwiring the address lines of the device to the desired
logic level. The address to various I2C devices in an embedded device is assigned and hardwired at the
time of designing the embedded hardware. The sequence of operations for communicating with an 12C
slave device is listed below:
1. The master device pulls the clock line (SCL) of the bus to ‘HIGH?
2. The master device pulls the data line (SDA) ‘LOW’, when the SCL line is at logic ‘HIGH’ (This
is the ‘Start’ condition for data transfer) 5
3. The master device sends the address (7 bit or 10 bit wide) of the ‘slave’ device to which it wants
to communicate, over the SDA line. Clock pulses are generated at the SCL line for synchronising
the bit reception by the slave device. The MSB of the data is always transmitted first. The data in
the bus is valid during the ‘HIGH’ period of the clock signal‘The Typical Embedded System bar 4
4. ‘The master device sends the Read or Write bit (Bit value = | Read operation; Bit value = 0 Write
operation) according to the requirement
5. The master device waits for the acknowledgement bit from the slave device whose address is sent
on the bus along with the Read/Write operation command, Slave devices connected to the bus
‘compares the address received with the address assigned to them
6. The slave device with the address requested by the master device responds by sending an ac-
knowledge bit (Bit value ~ 1) over the SDA line
7. Upon receiving the acknowledge bit, the Master device sends the 8bit data to the slave device over
SDA line, if the requested operation is ‘Write to device’. If the requested operation is “Read from
device’, the slave device sends data to the master over the SDA line
8 The master device waits for the acknowledgement bit from the device upon byte wansfer complete
for a write operation and sends an acknowledge bit to the Slave device for a read operation
9. The master device terminates the transfer by pulling the SDA line “HIGH’ when the clock line
SCL is at logic ‘HIGH (Indicating the ‘STOP’ condition)
12C bus supports three different data rates. They are: Standard mode (Data rate up to 100kbits/see
(100 kbps)), Fast mode (Data rate up to 400kbits/scc (400 kbps)) and High speed mode (Data rate up to
3.4Mbits/sec (3.4 Mbps)). The first generation 12C devices were designed to support data rates only 1p
to 100kbps. The new generation 12C devices are designed to operate at data rates up to 3.4Mbits/sec.
2.4.1.2 Serial Peripheral Interface (SPI) Bus The Serial Peripheral Interface Bus (SPI) is a syn-
chronous bi-directional full duplex four-wire serial interface bus. The concept of SPI was introduced by
Motorola. SPI is a single master multi-slave system. It is possible to havea system where more than one
SPI device can be master, provided the condition only one master device is active at any given point of
time, is satisfied. SPI requires four signal lines for communication. They are:
Master Out Slave In (MOSD: Signal line carrying the data from master to slave device. It is
also known as Slave Input/Slave Data In (SSDP)
Signal line carrying the data from slave to master device. It is
also known as Slave Output (SO/SDO)
Serial Clock (SCLK): Signal line carrying the clock signals
Slave Select (SS): Signal line for slave device select. It is an active low signal
Master In Slave Out (MISO)
The bus interface diagram shown in Fig. 2.27 illustrates the connection of master and slave devices
on the SPT bus
The master device is responsible for generating the clock signal. It selects the required slave device
by asserting the corresponding slave device's slave select signal ‘LOW’. The data out line (MISO) of all
the slave devices when not selecied floats at high impedance state.
The serial data transmission through SPI bus is fully configurable. SPI devices contain a certain set
of registers for holding these configurations. The serial peripheral control register holds the various con-
figuration parameters like master/slave selection for the device, baudrate selection for communication,
clock signal control, etc. The status register holds the status of various conditions for transmission and
reception.
SPI works on the principle of “Shift Register’. The master and slave devices contain a special shift
register for the data to transmit or receive. The size or the shift register is device dependent. Normally
it is a multiple of 8. During transmission from the master to slave, the data in the master’s shift register
is shifted out to the MOSI pin and it enters the shift register of the slave device through the MOSI pin
of the slave device. At the same time the shifted out data bit from the slave device’s shift register entersIntroduction to Embedded Systems
MOSI SCL MISO
MISO.
MOSI Slave 1
SPI device
Master
(Microprocessor!
Controtier)
ssi\
$82\ Saal
Stave 2
SPI device
(egs LCD)
SPI bus
SPE bus interfacing
the shift register of the master device through MISO pin. In summary, the shift registers of ‘master’ and
‘slave’ devices form a circular buffer. For some devices, the decision on whether the LS/MS bit of data
needs to be sent out first is configurable through configuration register (e.g. LSBF bit of the SPI control
register for Motorola’s 68HC12 controller).
‘When compated to 12C, SP! bus is most suitable for applications requiring transfer of data in ‘streams’
The only limitation is SPI doesn’t support an acknowledgement mechanism,
2.4.1.3 Universal Asynchronous Receiver Transmitter (UART) Universal Asynchronous Re-
ceiver Transmitter (UART) based data transmission is an asynchronous form of scrial data transmission.
UART based serial data transmission doesn’t require a clock signal to synchronise the transmitting end
and receiving end for transmission. Instead it relies upon the pre-defined agreement between the trans-
mitting device and receiving device. The serial communication settings (Baudrate, number of bits per
byte, parity, number of start bits and stop bit and flow control) for both transmitter and receiver should
be set as identical. The start and stop of communication is indicated through inserting special bits in the
data stream, While sending a byte of data, a start bit is added first and a stop bit is added at the end of
the bit stream. The least significant bit of the data byte follows the ‘start’ bit.
The ‘start’ bit informs the receiver that a data byte is about to arrive. The receiver device starts polling
its ‘receive line’ as per the baudrate settings. If the baudrate is ‘x’ bits per second, the time slot available
for one bit is 1/x seconds. The receiver unit polls the receiver line at exactly half of the time slot avail-
able for the bit. If parity is enabled for communication, the UART of the transmitting device adds a par-
ity bit (bit value is | for odd number of 1s in the transmitted bit stream and 0 for even number of 1s). The
UART of the receiving device calculates the parity of the bits received and compares it with the received
parity bit for error checking. The UART of the receiving device discards the ‘Start’, ‘Stop’ and ‘Parity’The Typical Embedded System B39
bit from the received bit stream and converts
the received serial bit data to a word (In the i UART T™XD
case of 8 bits/byte. the byte is formed with the | |“
received 8 bits with the first received bit as the RXD
LSB and last received data bit as MSB). |
For proper communication, the “Transmit |
line’ of the sending device should be con- |
nected to the ‘Receive line’ of the receiving x)
device. Figure 2.28 illustrates the same.
In addition to the serial data transmission TXD: Transmit line
function, UART provides hardware handshak- RXD: Receiver line
ing signal support for controlling the serial nated
data flow. UART chips are available from dif-
ferent semiconductor manufacturers. National
Semiconductor’s 8250 UART chip is considered as the standard setting UART. It was used in the origi-
nal IBM PC.
Nowadays most of the microprocessors/controllers are available with integrated UART functionality
and they provide built-in instruction support for serial data transmission and reception.
2.4.1.4 1-Wire Interface _|-wire interface is an asynchronous half-duplex communication protocol
developed by Maxim Dallas Semiconductor (http://www.maxim-ie.com). It is also known as Dallas
1-Wire® protocol. It makes use of only a single signal line (wire) called DQ for communication and
follows the master-slave communication model. One of the key feature of 1-wire bus is that it allows
power to be sent along the signal wire as well. The 12C slave devices incorporate intemal capacitor
(typically of the order of 800 pF) to power the device from the signal line. The |-wire interface supports
asingle master and one or more slave devices on the bus. The bus interface diagram shown in Fig. 2.29
illustrates the connection of master and slave devices on the 1-wire bus.
Vee
47K
Slave 1
Port pin
: L-wire device
Master
(Microprocessor!
Controller)
1 -wire device
GND wp | (@## S2431 1024
1 Jt Bit EEPROM )
1-Wire Interface bas:504 Introduction to Embedded Systems
Every -wire device contains a globally unique 64bit identification number stored within it, This
unique identification number can be used for addressing individual devices present on the bus in case
there are multiple slave devices connected to the I -wire bus. The identifier has three parts: an 8bit family
code, a 48bit serial number and an bit CRC computed from the first 56 bits. The sequence of operation
for communicating with a 1-wire slave device is listed below.
1, The master device sends a ‘Reset’ pulse on the 1-wire bus.
2. The slave device(s) present on the bus respond with a ‘Presence’ pulse.
3. The master device sends a ROM command (Net Address Command followed by the 64bit address.
of the device). This addresses the slave device(s) to which it wants to initiate a communication.
4. The master device sends a read/write function command to read/write the internal memory or
register of the slave device.
5. The master initiates a Read data/Write data from the device or to the device
All communication over the |-wire bus is master initiated. The communication over the |-wire bus is
divided into timeslots of 60 microseconds. The ‘Reset’ pulse occupies & time slots. For starting a com-
munication, the master asserts the reset pulse by pulling the 1-wire bus ‘LOW’ for at least 8 time slots
(480s). Ifa ‘slave’ device is present on the bus and is teady for communication it should respond to the
master with a ‘Presence’ pulse, within 60s of the release of the ‘Reset’ pulse by the master. The slave
device(s) responds with a ‘Presence’ pulse by pulling the 1-wire bus ‘LOW’ for a minimum of | time
slot (60ps). For writing a bit value of | on the 1-wire bus, the bus master pulls the bus for I to 15s and
then releases the bus for the rest of the time slot. A bit value of ‘0’ is written on the bus by master pulling
the bus for a minimum of | time slot (6018) and a maximum of 2 time slots (120p1s). To Read a bit from
the slave device, the master pulls the bus ‘LOW’ for 1 to Sus. If the slave wants to send a bit value ‘1’
in response to the read request from the master, it simply releases the bus for the rest of the time slot. If
the slave wants to send a bit value *0’, it pulls the bus ‘LOW’ for the rest of the time slot.
2.4.1.5 Parallel Interface The on-board parallel interface is normally used for communicating with
peripheral devices which are memory mapped to the host of the system. The host processor/controller
of the embedded system contains a parallel bus and the device which supports parallel bus can directly
connect to this bus system. The communication through the parallel bus is controlled by the control sig-
nal interface between the device and the host. The “Control Signals’ for communication includes ‘Read/
Write’ signal and device select signal. The device normally contains a device select line and the device
becomes active only when this line is asserted by the host processor. The direction of data transfer (Host
to Device or Device to Host) can be controlled through the control signal lines for “Read” and ‘Write’.
Only the host processor has control aver the ‘Read’ and *Write’ control signals. The device is normally
memory mapped to the host processor and a range of address is assigned to it. An address decoder circuit
is used for generating the chip select signal for the device. When the address selected by the processor
is within the range assigned for the device, the decoder circuit activates the chip select line and thereby
the device becomes active. The processor then can read or write from or to the device by asserting the
corresponding control line (RD\ and WR\ respectively). Strict timing characteristics are followed for
parallel communication. As mentioned earlier, parallel communication is host processor initiated. If a
device wants to initiate the communication, it can inform the same to the processor through interrupts.
For this, the interrupt line of the device is connected to the interrupt line of the processor and the cor-
responding interrupt is enabled in the host processor. The width of the parallel interface is determined
by the data bus width of the host processor. It can be 4bit, 8bit, 16bit, 32bit or 64bit etc. The bus width
supported by the device should be same as that of the host processor. The bus interface diagram shown
in Fig. 2.30 illustrates the interfacing of devices through parallel interface.The Typical Embedded System Ei,
Peripheral device
RD\ (e.g: ADC)
WE
ata bus
Host Control signals
(Microprocessor/ |
Controller)
‘A0 tol Address bus Address de-coder
Ay- circuit
x: Data bus width
yy Address bus width
Parallel Interface Bus
Parallel data communication offers the highest speed for data transfer.
2.4.2 External Communication Interfaces
The External Communication Interface refers to the different communication channels/buses used by
the embedded system to communicate with the external world. The following section gives an overview
of the various interfaces for external communication.
2.4.2.1 RS-232 C & RS-485RS-232 C (Recommended Standard number 232, revision C from the
Electronic Industry Association) is a legacy, full duplex, wired, asynchronous serial communication
interface. The RS-232 interface is developed by the Electronics Industries Association (ELA) during the
early 1960s. RS-232 extends the UART communication signals for external data communication.
UART uses the standard TTL/CMOS logic (Logic ‘High’ corresponds to bit value | and Logic ‘Low’
corresponds to bit value 0) for bit transmission whereas RS-232 follows the EIA standard for bit trans-
mission, As per the EIA standard, a logic ‘0’ is represented with voltage between +3 and +25V and a
logic “I” is represented with voltage between -3 and -25V. In EIA standard, logic ‘0” is known as ‘Space’
and logic ‘I’ as ‘Mark’, The RS-232 interface defines various handshoking and control signals for com-
munication apart from the ‘Transmit’ and ‘Receive’ signal lines for data communication. RS-232 sup-
ports two different types of connectors, namely; DB-9: 9-Pin connector and DB-25; 25-Pin connector.
Figure 2.31 illustrates the connector details for DB-9 and DB-25.
rE
T
GO000000000000
oO O\ccoc000000000/0
is =
DB-25Ez Introduction to Embedded Systems
‘The pin details for the two connectors are explained in the following table:
Pin Name Pin no: (For DB-9 Pin no: (For DB-25 Description
Connector) Connector)
TXD 3 2 Transmit Pin for Transmitting Serial Data
RXD 2 3 Receive Pin for Receiving Serial Data
RTS 7 4 Request to send.
crs 8 3 (Clear To Send
DSR 6 6 Data Set Ready
GND 3 7 Signal Ground
peo 1 8 Data Carrier Detect
DIR 4 20 Data Terminal Ready
RI 9 2 Ring Indicator
FG 1 Frame Ground
spep 2 Secondary DCD
sets 1B Secondary CTS
STXD 4 Secondary TXD
Te 5 Transmission Signal Element Timing
SRXD 16 Secondary RXD
RC 7 Receiver Signal Element Timing
SRIS 9 Secondary RTS
sq 2 Signal Quality detecior
NC 9 No Connection
NC 10 No Connection
NC u No Connection
NOMS ‘No Connection
NC ‘No Connection
NC 4 No Connection
NC 25 No Connection
RS-232 is a point-to-point communication interface and the devices involved in RS-232 communica-
tion are called ‘Data Terminal Equipment (DTE)’ and ‘Data Communication Equipment (DCE)’. If no.
data flow control is required, only TXD and RXD signal lines and ground line (GND) are required for
data transmission and reception. The RXD pin of DCE should be connected to the TXD pin of DTE and
vice versa for proper data transmission.
If hardware data flow control is required for serial transmission, various control signal lines of the
RS-232 connection are used appropriately. The control signals are implemented mainly for modem
communication and some of them may not be irrelevant for other type of devices. The Request To Send
(RTS) and Cleat To Send (CTS) signals co-ordinate the communication between DTE and DCE. When-
ever the DTE has a data to send, it activates the RTS line and if the DCE is ready to accept the data, it
activates the CTS line.The Typicai Embedded System El,
The Data Terminal Ready (DTR) signal is activated by DTE when itis ready to accept data, The Data
Set Ready (DSR) is activated by DCE when it is ready for establishing a communication link. DTR
should be in the activated state before the activation of DSR.
The Data Carrier Detect (DCD) control signal is used by the DCE to indicate the DTE that a good
signal is being received.
Ring Indicator (RI) is a modem specific signal line for indicating an incoming call on the telephone
line.
The 25 pin DB connector contains two sets of signal lines for transmit, receive and control lines,
1 owadays DB-25 connector is obsolete and most of the desktop systems are available with DB-9 con-
nectors only.
Asperthe EIA standard RS-232 C supports baudrates up to 20K bps (Upper limit 19.2 Kbps) The com-
monly used baudrates by devices are 300bps, 1200bps, 2400bps, 9600bps, 11.52Kbps and 19.2Kbps.
9600 is the popular baudrate setting used for PC communication. The maximum operating distance sup-
ported by RS-232 is 50 feet at the highest supported baudrate.
Embedded devices contain a UART for serial communication and they generate signal levels con-
forming to TTL/CMOS logic. A level translator IC like MAX 232 from Maxim Dallas semiconductor
is used for converting the signal lines from the UART to RS-232 signal lines for communication. On.
the receiving side the received data is converted back to digital logic level by a converter IC. Converter
chips contain converters for both transmitter and receiver.
Though RS-232 was the most popular communication interface during the olden days, the advent of
other communication techniques like Bluetooth, USB, Firewire, ete are pushing down RS-232 from the
scenes. Still RS-232 is popular in certain legacy industrial applications.
RS.232 supports only point-to-point communication and not suitable for multi-drop communication
It uses single ended data transfer technique for signal transmission and thereby more susceptible to
noise and it greatly reduces the operating distance.
RS-422 is another serial interface standard from EIA for differential data communication. It supports
data rates up to 100Kbps and distance up to 400 ft. The same RS-232 connector is used at the device
end and an RS-232 to RS-422 converter is plugged in the transmission line. At the receiver end the
conversion from RS-42? to RS-232 is performed. RS-422 supports multi-drop communication with one
transmitter device and receiver devices up to 10.
RS-485 is the enhanced version of RS-422 and it supports multi-drop communication with up to 32
transmitting devices (drivers) and 32 receiving devices on the bus. The communication between devices
in the bus uses the ‘addressing’ mechanism to identify slave devices.
2.4.2.2 Universal Serial Bus (USB) Universal Serial Bus (USB) is a wired high speed serial bus
for data communication. The first version of USB (USBI.0) was released in 1995 and was created by
the USB core group members consisting of Intel, Microsoft, [BM, Compag, Digital and Northern Tele-
com. The USB communication system follows a star topology with a USB host at the centre and one
or more USB peripheral devices/USB hosts connected to it. A USB host can support connections up to
127, including slave peripheral devices and other USB hosts. Figure 2.32 illustrates the star topology
for USB device connection,
USB transmits data in packet format, Each data packet has a standard format. The USB communica
tion is a host initiated one. The USB host contains a host controller which is responsible for controlling
the data communication, including establishing connectivity with USB slave devices, packetizing and
formatting the data, There are different standards for implementing the USB Host Control interface;
namely Open Host Control Interface (OHC1) and Universal Host Control Interface (UHCI).pss Introduction to Embedded Systems
The physical connection between a USB peripheral de-
vice and master device is established with a USB cable. O
The USB cable supports communication distance of up to Peripheral
5 metres. The USB standard uses two different types of doce
connector at the ends of the USB cable for connecting the
USB peripheral device and host device. “Type 4’ connector
is used for upstream connection (connection with host) and
‘Type B connector is used for downstream connection (con-
nection with slave device). The USB connector present in Pewpheral USB host Peripheral
desktop PCs or laptops are examples for “Type A’ USB. “*¥i¢e! (ub) device 3
connector, Both Type A and Type B connectors contain 4
pins for communication. The Pin details for the connectors
are listed in the table given below. LSet
/ Pim nor Pinname Description (Hub)
1 Vous Carties power SV)
2 Se. Differential data carrier line Peripheral Peripheral
3 Dt Differential data earrier line device 4 device 5
4 GND Ground signal line
‘USB Device Connection topology
USB uses differential signals for data transmission. It
improves the noise immunity. USB interface has the ability to supply power to the connecting devices
‘Two connection lines (Ground and Power) of the USB interface are dedicated for carrying power. It can
supply power up to 500 mA at 5 V. It is sufficient to operate low power devices. Mini and Micro USB
connectors are available for small form factor devices like portable media players.
Each USB device contains a Product ID (PID) anda Vendor ID (VID). The PID and VID are embed-
ded into the USB chip by the USB device manufacturer. The VID for a device is supplied by the USB
standards forum. PID and VID are essential for loading the drivers corresponding to a USB device for
communication.
‘USB supports four different types of data transfers, namely; Control, Bulk, Isochronous and Inter-
rupt. Control transfer is used by USB system software to query, configure and issue commands to the
USB device. Bulk transfer is used for sending a block of data to a device. Bulk transfer supports error
checking and correction. Transferring data to a printer is an example for bulk transfer. Isochronous data
transfer is used for real-time data communication. In Isochronous transfer, data is transmitted as streams
in real-time. Isochronous transfer doesn’t support error checking and re-transmission of data in ease of
any transmission loss. All streaming devices like audio devices and medical equipment for data collec-
tion make use of the isochronous transfer. Interrupt transfer is used for transferring small amount of
data, Interrupt transfer mechanism makes use of polling technique to see whether the USB device has
any data to send. The frequency of polling is determined by the USB device and it varies from 1 t0 255
milliseconds. Devices like Mouse and Keyboard, which transmits fewer amounts of data, uses Interrupt
transfer.
USB.ORG (www.usb.org) is the standards body for defining and controlling the standards for USB
communication, Presently USB supports four different data rates namely; Low Speed (1.5Mbps), Full
Speed (12Mbps), High Speed (480Mbps) and Super Speed (4.8Gbps). The Low Speed and Full Speed
specifications are defined by USB 1.0 and the High Speed specification is defined by USB 2.0. USB 3.0‘The Typical Embedded System EA,
defines the specifications for Super Speed. USB 3.0 is expected to be in action by year 2009. There is a
move happening towards wireless USB for data transmission using Ultra Wide Band (UWB) technol-
ogy. Some laptops are already available in the market with wireless USB support.
2.4.2.3 IEEE 1394 (Firewire) JEEE 1304 is a wired, isochronous high speed serial communica-
tion bus. It is also known as High Performance Serial Bus (HPSB). The research on 1394 was started
by Apple Inc. in 1985 and the standard for this was coined by IEEE. The implementation of it is avail-
able from various players with different names. Apple Inc’s (wwwapple.com) implementation of 1394
protocol is popularly known es Firewire. i.LINK is the 1394 implementation from Sony Corporation
(www.sony.net) and Lynx is the implementation from Texas Instruments ( 1394 supports
peer-to-peer connection and point-to-multipoint communication allowing 63 devices to be connected
on the bus in a tree topology. /394 is a wired serial interface and it can support a cable length of up to
15 feet for interconnection.
The 1394 standard has evolved a lot from the first version JEEE 1394-1995 released in 1995 to the
recent version EEE 1394-2008 released in June 2008. The /394 standard supports a data rate of 400
to 3200Mbits/second. The /EEE 1394 uses differential data transfer (The information is sent using dif
ferential signals through a pair of twisted cables. It increases the noise immunity) and the interface cable
supports 3 types of connectors, namely; 4-pin connector, 6-pin connector (alpha connector) and 9 pin
connector (beta connector). The 6 and 9 pin connectors carry power also to support external devices
(in case an embedded device is connected to a PC through an JEEE 1394 cable with 6 or 9 pin connec
tor interface, it can operate from the power available through the connector.) It can supply unregulated
power in the range of 24 to 30V. (The Apple implementation is for battery operated devices and it can
supply a voltage in the range 9 to 12V.) The table given below illustrates the pin dewils for 4, 6 and 9
pin connectors.
Pin name Pin no: (4 Pin Pin no: (6 Pin no; (9 Pin Description
Connector) Connector) Connector)
Power 1 8 Unregulated DC supply. 24 to 30V
Signal Ground 2 6 Ground connection
TPB- 3 1 Differential Signal line for Signal line B
TPB+ 2 4 2 Differential Signal line for Signal line B
TPA- 3 5 3 Differential Signal line for Signal line A
TPAY 4 6 4 Differential Signal line for Signal line A
TPA(S 5 Shield for the differential signal line A.
Normally grounded
TPES) 9 Shield for the differential signal line B.
Normally grounded
NC 1 No connection
There are two differential data transfer lines A and B per connector. In a 1394 cable, normally the dif-
ferential lines of A are connecied to B (TPA+ to TPB+ and TPA-to TPB--) and vice versa.
1394 is a popular communication interface for connecting embedded devices like Digital Camera,
Camcorder, Scanners to desktop computers for data transfer and storage.
Unlike USB interface (Except USB OTG), JEEE 1394 doesn’t require a host for communicating
between devices. For example, you can directly connect a scanner with a printer for printing, The data-El, Introduction to Embedded Systems
rate supported by 394 is far higher than the one supported by USB2.0 interface. The 1394 hardware
implementation is much costlier than USB implementation
2.4.2.4 Infrared (IrDA) Infrared (IrDA) isa serial, half duplex, line of sight based wireless tech-
nology for data communication between devices. It is in use from the olden days of communication
nd you may be very familiar with it. The remote control of your TV, VCD player, ete. works on In-
frared data communication principle, Infrared communication technique uses infrared waves of the
electromagnetic spectrum for transmitting the data. IrDA supports point-point and point-to-multipoint
communication, provided all devices involved in the communication are within the line of sight. The
typical communication range for IrDA lies in the range 10 cm to 1 m, The range can be increased by
increasing the transmitting power of the IR device. IR supports data rates ranging from 9600bits/second
to 16Mbps. Depending on the speed of data transmission IR is classified into Serial IR (SIR), Medium
IR (MIR), Fast IR (FIR), Very Fast IR (VFIR) and Ultra Fast IR (UFIR). SIR supports transmission
rates ranging from 9600bps to 115.2kbps, MIR supports data rates of 0.576Mbps and 1.152Mbps. FIR
supports data rates up to 4Mbps. VFIR is designed to support high data rates up to 16Mbps, The UFIR
specs are under development and it is targeting a data rate up to 100Mbps.
IDA communication involves a transmitter unit for transmitting the data over IR and a receiver
for receiving the data. Infrared Light Emitting Diode (LED) is the IR source for transmitter and at the
receiving end a photodiode acts as the receiver, Both transmitter and receiver unit will be present in
each device supporting IrDA communication for bidirectional data transfer. Such IR units are known as
‘Transceiver’. Certain devices like a TV remote control always require unidirectional communication
and so they contain either the transmitter or receiver unit (The remote control unit contains the transmit-
ter unit and TV contains the receiver unit),
‘Infra-red Data Association’ (IrDA - http://www.irda.org/) is the regulatory body responsible for de-
fining and licensing the specifications for IR data communication. IrDA communication has two es-
sential parts; a physical link part and a protocol part. The physical link is responsible for the physical
transmission of data between devices supporting IR communication and protocol part is responsible
for defining the rules of communication. The physical link works on the wireless principle making use
of Infrared for communication. The IrDA specifications include the standard for both physical link and
protocol layer.
The IrDA control protocol contains implementations for Physical Layer (PHY), Media Access Con-
trol (MAC) and Logical Link Control (LLC). The Physical Layer defines the physical characteristics of
communication like range, data rates, power, ete.
IrDA is a popular interface for file exchange and data transfer in low cost devices. IrDA was the
prominent communication channel in mobile phones before Bluetooth’s existence. Even now most of
the mobile phone devices support IrDA.
2.4.2.5 Bluetooth (BT) Bluetooth isa low cost, low power, short range wireless technology for data
and voice communication. Bluetooth was first proposed by ‘Ericsson’ in 1994. Bluetooth operates at
2.4GHz of the Radio Frequency spectrum and uses the Frequency Hopping Spread Spectrum (FHSS)
technique for communication, Literally it supports a data rate of up to IMbps and a range of approxi-
mately 30 feet for data communication. Like IDA, Bluetooth communication also has two essential
parts; a physical link part and a protocol part. The physical link is responsible for the physical trans-
mission of data between devices supporting Bluetooth communication and protocol part is responsibleThe Typical Embedded System Eh
for defining the rules of communication. The physical link works on the wireless principle making use
of RF waves for communication. Bluetooth enabled devices essentially contain a Bluetooth wireless
radio for the transmission and reception of data. The rules governing the Bluetooth communication is
implemented in the ‘Bluetooth protocol stack’. The Bluetooth communication IC holds the stack. Each
Bluetooth device will have a 48 bit unique identification number. Bluetooth communication follows
packet based data transfer,
Bluctooth supports point-to-point (device to device) and point-to-multipoint (device to multiple
device broadcasting) wireless communication. The point-to-point communication follows the master-
slave relationship. A Bluetooth device can function as either master or slave, When a network is formed
with one Bluetooth device as master and more than one device as slaves, itis called a Piconet. A Piconet
supports a maximum of seven slave devices.
Bluetooth is the favourite choice for short range data communication in handheld embedded devices.
Bluetooth technology is very popular among cell phone users as they are the easiest communication
channel for transferring ringtones, music files, pictures, media files, ete. between neighbouring Blue-
tooth enabled phones.
The Bluetooth standard specifies the minimum requirements that a Bluetooth device must support
for a specific usage scenario. The Generic Access Profile (GAP) defines the requirements for detecting
a Bluetooth device and establishing a connection with it. All other specific usage profiles are based on
GAP. Serial Port Profile (SPP) for serial data communication, File Transfer Profile (FTP) for file transfer
between devices, Human Interface Device (HID) for supporting human interface devices like keyboard
and mouse are examples for Bluetooth profiles.
‘The specifications for Bluetooth communication is defined and licensed by the standards body “Blue-
tooth Special Interest Group (SIG)’. For more information, please visit the website www.bluetooth.org.
2.4.2.6 Wi-Fi Wi-Fi or Wireless Fidelity is the popular wireless communication technique for net-
worked communication of devices. Wi-Fi follows the IEEE 802.11 standard, Wi-Fi is intended for net-
work communication and it supports Internet Protocol (IP) based communication. It is essential to have
device identities in a multipoint communication to address specific devives for data communication, In
an IP based communication each device is identified by an IP address, which is unique to each device on
the network. Wi-Fi based communications require an intermediate agent called Wi-Fi router/ Wireless
Access point o manage the communications. The Wi-Fi router is responsible for restricting the access 10
a network, assigning IP address to devices on the network, routing data packets to the intended devices
on the network. Wi-Fi enabled devices contain a wireless adaptor for transmitting and receiving data in
the form of radio signals through an antenna. The hardware part of it is known as Wi-Fi Radio,
Wi-Fi operates at 2.4GHz or SGHz of radio spectrum and they co-exist with other ISM band devices
like Bluetooth. Figure 2.33 illustrates the typical interfacing of devices in a Wi-Fi network,
For communicating with devices over a 'i network, the device when its Wi-Fi radio is turned
ON, searches the available Wi-Fi network in its vicinity and lists out the Service Set Identifier (SSID) of
the available networks. If the network is security enabled, a password may be required to connect toa
particular SSID. Wi-Fi employs different security mechanisms like Wired Equivalency Privacy (WEP)
Wireless Protected Access (WPA), etc. for securing the data communication
Wi-Fi supports data rates ranging from IMbps to 1S0Mbps (Growing towards higherrates as technol-
ogy progresses) depending on the standards (802.1 a/b/g/n) and access/modulation method. Depending
on the type of antenna and usage location (indoor/outdoor), Wi-Fi offers a range of 100 to 300 feet.El Introduction to Embedded Systems
2.4.2.7 ZigBee ZigBee is a low power, Wi-Fi router
low cost, wireless network communication
protocol based on the IEEE 802.15.4-2006
standard. ZigBee is targeted for low pow-
er, low data rate and secure applications
for Wireless Personal Area Networking
(WPAN). The ZigBee specifications support
a robust mesh network containing multiple
nodes. This networking strategy makes the
network reliable by permitting messages to
travel through a number of different paths to
get from one node to another.
ZigBee operates worldwide at the unli-
censed bands of Radio spectrum, mainly at
2.400 10 2.484 GHz, 902 to 928 MHz and
868.0 to 868.6 MHz. ZigBee Supports an
operating distance of up to 100 metres and a
data rate of 20 to 250Kbps.
In the ZigBee terminology, cach ZigBee
device falls under any one of the following ZigBee device category.
ZigBee Coordinator (ZC)/Network Coordinator: The ZigBee coordinator acts as the root of the Zig-
Bee network. The ZC is responsible for initiating the ZigBee network and it has the capability to store
information about the network.
ZigBee Router (ZR)/Full function Device (FFD): Responsible for passing information from device to
another device or to another ZR.
‘ZigBee End Device (ZED)/Reduced Function Device (RFD): End device containing ZigBee func-
tionality for data communication. It can talk only with a ZR or ZC and doesn’t have the capability to act
as a mediator for transferring data from one device to another.
The diagram shown in Fig. 2.34 gives an overview of ZC, ZED ZED
ZED and ZR in a ZigBee network.
ZigBee is primarily targeting application areas like home
& industrial automation, energy management, home control/
security, medical/patient tracking, logistics & asset tracking
and sensor networks & active RFID. Automatic Meter Reading
(AMR), smoke detectors, wireless telemetry, HVAC control,
heating control, lighting controls, environmental controls, etc.
are examples for applications which can make use of the Zig-
Bee technology. ZED
The specifications for ZigBee is developed and managed by ail xaispiincwenibiss
the ZigBee alliance (www.zigbee.org), 2 non-profit consortium oe
of leading semiconductor manufacturers, technology providers, OEMs and end-users worldwide.
2.4.2.8 General Packet Radio Service (GPRS) General Packet Radio Service (GPRS) is a com- ,
munication technique for transferring data over a mobile communication network like GSM. Data is
sent as packets in GPRS communication. The transmitting device splits the data into several related
packets. At the receiving end the data is re-constructed by combining the received data packets. GPRSThe Typical Embedded System Eh
supports a theoretical maximum transfer rate of 171.2kbps. In GPRS communication, the radio channel
is concurrently shared between several users instead of dedicating a radio channel to a cell phone user.
The GPRS communication divides the channel into & timeslots and transmits data over the available
channel. GPRS supports Intemet Protocol (IP), Point to Point Protocol (PPP) and X.25 protocols for
communication.
GPRS is mainly used by mobile enabled embedded devices for data communication. The device
should support the necessary GPRS hardware like GPRS modem and GPRS radio. To accomplish
GPRS based communication, the carrier network also should have support for GPRS communication.
GPRS is an old technology and it is being replaced by new generation data communication techniques
like EDGE, High Speed Downlink Packet Access (HSDPA), etc. which offers higher bandwidths for
communication
2.5 EMBEDDED FIRMWARE
Embedded firmware refers to the control algorithm (Program instructions) and or the configuration
settings that an embedded system developer dumps into the code (Program) memory of the embedded
system, It is an un-avoidable part of an embedded system. There are various methods available for de-
veloping the embedded firmware. They are listed below.
1, Write the program in high level languages like Embedded C/C-+ using an Integrated Develop-
ment Environment (The IDE will contain an editor, compiler, linker, debugger, simulator, etc.
IDEs are different for different family of processors/controllers. For example, Keil micro vision3
IDE is used for all family members of 8057 microcontroller, since it contains the generic 8051
compiler C51).
2, Write the program in Assembly language using the instructions supported by your application's
target processor/controller.
The instruction set for each family of processor/controller is different and the program written in
either of the methods given above should be converted into a processor understandable machine code
before loading it into the program memory.
The process of converting the program written in either a high level language or processor/controller
specific Assembly code to machine readable binary code is called ‘HEX File Creation’. The methods
used for ‘HEN File Creation’ is different depending on the programming techniques used. If the pro-
gram is written in Embedded C/C++ using an IDE, the cross compiler included in the IDE converts it
into corresponding processor/controller understandable “HEX File’. If you are following the Assembly
language based programming technique (method 2), you can use the utilities supplied by the proces-
sor/eontroller vendors to convert the source code into ‘HEX File’. Also third party tools are available,
may be of firee of cost, for this conversion.
For a beginner in the embedded software field, itis strongly recommended to use the high level lan-
guage based development technique. The reasons for this being: writing codes ina high level language
is easy, the code written in high level language is highly portable which means you can use the same
code to run on different processor/controller with little or less modification. The only thing you need to
do is re-compile the program with the required processor's IDE, after replacing the include files for that
particular processor. Also the programs written in high level languages are not developer dependent.
Any skilled programmer can trace out the functionalities of the program by just having a look at the pro-
gram. It will be much easier if the source code contains necessary comments and documentation lines.
Itis very easy to debug and the overall system development time will be reduced to a greater extent.Gg, fnirdtation 16 abeekiod Systeme
The embedded software development process in assembly language is tedious and time consuming.
The developer needs to know about all the instruction sets of the processor/controller or at least s/he
should carry an instruction set reference manual with her/him, A programmer using assembly language
technique writes the program according to his/her view and taste. Often he/she may be writing a method
or functionality which can be achieved through a single instruction as an experienced person's point of
view. by two or three instructions in his/her own style. So the program will be highly dependent on the
developer. It is very difficult for a second person to understand the code written in Assembly even if it
is well documented.
‘We will discuss both approaches of embedded software development in a later chapter dealing with
design of embedded firmware, in detail. Two types of control algorithm design exist in embedded firm-
ware development. The first type of control algorithm development is known as the infinite loop or
“super loop’ based approach, where the control flow runs from top to bottom and then jumps back to
the top of the program in a conventional procedure. It is similar to the while (1) { }: based technique
in C. The second method deals with splitting the functions to be executed into tasks and running these
tasks using a scheduler which is part of a General Purpose or Real Time Embedded Operating System
(GPOS/RTOS). We will discuss both of these approaches in separate chapters of this book.
2.6 OTHER SYSTEM COMPONENTS
The other system components refer to the components/circuits/ICs which are necessary for the proper
functioning of the embedded system. Some of these circuits may be essential for the proper function-
ing of the processoricontroller and firmware execution. Watchdog timer, Reset IC (or passive circuit),
brown-out protection IC (or passive circuit), etc. are examples of circuits/ICs which are essential for
the proper functioning of the processor/controllers. Some of the controllers or SoCs integrate these
components within a single IC and doesn’t require such components extemally connected to the chip
for proper functioning. Depending on the system requirement, the embedded system may include other
integrated circuits for performing specific functions, level translator ICs for interfacing circuits with
different logic levels, etc. The following section explains the essential circuits for the proper functioning
of the processor/controller of the embedded system.
2.6.1 Reset Circuit
The reset circuit is essential to ensure that the device is not operating at 2 voltage level where the device
is not guaranteed to operate, during system power ON. The reset signal brings the intemal registers and
the different hardware systems of the processor/controller to a known state and starts the firmware exe-
cution from the reset vector (Normally from vector address 0x0000 for conventional processors/control-
lers. The reset vector can be relocated to an address for processors/controllcrs supporting bootloader).
The reset signal can be either active high (The processor undergoes reset when the reset pin of the pro-
cessor is at logic high) or active low (The processor undergoes reset when the reset pin of the processor
is at logic low). Since the processor operation is synchronised to a clock signal, the reset pulse should
be wide enough to give time for the clock oscillator to stabilise before the internal reset state starts.
The reset signal to the processor can be applied at power ON through an extemal passive reset circuit
comprising a Capacitor and Resistor or through a standard Reset IC like MAX810 from Maxim Dallas
(www.maxim-ic.com). Select the reset IC based on the type of reset signal and logic level (CMOS/TTL)
supported by the processor/controller in use. Some microprocessors/controllers contain built-in internalThe Typical Embedded System
reset circuitry and they don’t require external reset circuitry. Figure 2.35 illustrates a resistor capacitor
based passive reset circuit for active high and low configurations. The reset pulse width can be adjusted
by changing the resistance value R and capacitance value C.
Vee
Z
&
Reset pulse
3 Retive high ge
z
2
* GND
RC based reset circuit
2.6.2 Brown-out Protection Circuit
Brown-out protection circuit prevents the processor/controller
from unexpected program execution behaviour when the sup-
ply voltage to the processor/controller falls below a specified
voltage. It is essential for battery powered devices since there
are greater chances for the battery voltage to drop below the
required threshold. The processor behaviour may not be pre-
dictable if the supply voltage falls below the recommended op-
crating voltage. It may lead to situations like data corruption, A
brown-out protection citcuit holds the processor/controller in
reset state, when the operating voltage falls below the thresh-
old, until it nses above the threshold voltage. Certain proces-
sors/controllers support built in brown-out protection circuit
which monitors the supply voltage internally. If the proces-
sor/controller doesn't integrate a built-in brown-out protection
circuit, the same can be implemented using extemal passive
circuits or supervisor ICs. Figure 2.36 illustrates a brown-out
circuit implementation using Zener diode and transistor for
processor/controller with active low Reset logic.
Vee
R
Reset pulse
Active low
Brown.out protection circuit
with Active low output
The Zener diode Dz. and transistor Q forms the heart of this circuit. The transistor conducts always
when the supply voltage V,. is greater than that of the sum of Vie and V, (Zener voltage). The transistor
stops conducting when the supply voltage falls below the sum of Vay and Vz. Select the Zener diode
with required voltage for setting the low threshold value for Vec. The values of R1, R2, and R3 can
be selected based on the electrical characteristics (Absolute maximum current and voltage ratings) of
the transistor in use. Microprocessor Supervisor ICs like DS1232 from Maxim Dallas (www.maxim-
ic.com) also provides Brown-out protection.ih Introduction to Embedded Systems
2.6.3 Oscillator Unit
A microprocessor/microcontroller is a digital device made up of digital combinational and seuential
circuits. The instruction execution of a microprocessoricontroller occurs in syne with a clock signal. Itis
analogous to the heartbeat of a living being which synchronises the execution of life. For a living being,
the heart is responsible for the generation of the beat whereas the oscillator unit of the embedded system
is responsible for generating the precise clock for the processor. Certain processors/controllers integrate
a built-in oscillator unit and simply require an external ceramic resonator/quartz crystal for producing
the necessary clock signals. Quartz crystals and ceramic resonators are equivalent in operation, however
they possess physical difference. A quartz crystal is normally mounted in a hermetically sealed metal
case with two leads protruding out of the case. Certain devices may not contain a built-in oscillator unit
and require the clock pulses to be generated and supplied extemally. Quartz crystal Oscillators are avail-
able in the form chips and they can be used for generating the clock pulses in such a cases. The speed
of operation of a processor is primarily dependent on the clock frequency. However we cannot increase
the clock frequency blindly for increasing the speed of execution. The logical circuits lying inside the
processor always have an upper threshold value for the maximum clock at which the system can run,
beyond which the system becomes unstable and non functional. The total system power consumption
is directly proportional to the clock frequency. The power consumption increases with increase in clock
frequency. The accuracy of program execution depends on the accuracy of the clock signal. The accu-
racy of the crystal oscillator or ceramic resonator is normally expressed in terms of +/-ppm (Parts per
million), Figure 2.37 illustrates the usage of quartz crystal/ceramie resonator and external oscillator chip
for clock generation.
Microcontroller
oi am Stee 7
aa = Crystal oscillator
Quartz erystal LH H cies FLT Clock input pin
resonator c= IL
i y I Oxillator
nit
Oscillator circuitry using quarts crystal and quarts crystaloscilator
2.6.4 Real-Time Clock (RTC)
Real-Time Clock (RTC) is a system component responsible for keeping track of time. RTC holds infor-
mation like current time (In hours, minutes and seconds) in 12 hour/24 hour format, date, month, year,
day of the week, etc. and supplies timing reference to the system. RTC is intended to function even in
the absence of power. RTCs are available in the form of Integrated Circuits from different semiconduc-
tor manufacturers like Maxim/Dallas, ST Microelectronics etc. The RTC chip contains a microchip for
holding the time and date related information and backup battery cell for functioning in the absence of
power, in a single IC package. The RTC chip is interfaced to the processor or controller of the embedded
system. For Operating System based embedded devices, a timing reference is essential for synchronisingThe Typical Embedded System i,
the operations of the OS kernel. The RTC can interrupt the OS kemel by asserting the interrupt line
of the processor/controller to which the RTC interrupt line is connected. The OS kernel identifies the
interrupt in terms of the Interrupt Request (IRQ) number generated by an interrupt controller, One IRQ
can be assigned to the RTC interrupt and the kernel can perform necessary operations like system date
time updation, managing software timers etc when an RTC timer tick interrupt occurs. The RTC can be
configured to interrupt the processor at predefined intervals or to interrupt the processor when the RTC
register reaches a specified value (used as alarm interrupt).
2.6.5 Watchdog Timer
Indesktop Windows systems, if we feel our application is behaving in an abnormal way or if the system
hangs up, we have the *Ctrl + Alt + Del” to come out of the situation. What if it happens to our embed-
ded system? Do we really have a ‘Ctrl + Alt + Del’ te take control of the situation? Of course not ®, but
we have a watchdog to monitor the firmware execution and reset the system processor/microcontroller
when the program execution hangs up. A watchdog timer, or simply @ watchdog, is a hardware timer for
monitoring the firmware execution. Depending on the internal implementation, the watchdog timer in-
crements or decrements a free running counter with each clock pulse and generates a reset signal to reset
the processor if the count reaches zero for a down counting watchdog, or the highest count value for an
upcounting watchdog. If the watchdog counter is in the enabled state, the firmware can write a zero (for
upcounting watchdog implementation) to it before starting the execution of a piece of code (subroutine
or portion of code which is susceptible to execution hang up) and the watchdog will start counting. If the
firmware execution doesn’t complete due to malfunctioning, within the time required by the watchdog
to reach the maximum count, the counter will generate a reset pulse and this will reset the processor
(if it is connected to the reset line of the processor). If the firmware execution completes before the
expiration of the watchdog timer you can reset the count by writing a 0 (for an upcounting watchdog
timer) to the watchdog timer register. Most of the processors implement watchdog as a built-in compo-
nent and provides status register to control the watchdog timer (like enabling and disabling watchdog
functioning) and watchdog timer register for writing the count value. If the processor/controller doesn’t
contain a built in watchdog timer, the same can be implemented using an external watchdog timer IC
circuit. The extemal watchdog timer uses hardware logic for enabling/disabling, resetting the watch-
dog count, etc instead of the firmware based “writing’ to the status and watchdog timer register, The
Microprocessor supervisor IC DS1232 integrates a hardware watchdog timer in it, In modern systems
running on embedded operating systems, the watchdog can be implemented in such a way that when
a watchdog timeout occurs, an interrupt is generated instead of resetting the processor. The interrupt
handler for this handles the situation in an appropriate fashion. Figure 2.38 illustrates the implementa-
Sey Controller.
). UV emission from the embedded product
(e) Both of these (a) None of these
Non operational quality attributes are
(a) Non-functional requirements (b) Functional requirements
(©) Quality attributes for an offline product (2) @) and (e)
(©) None of these
Which of the following is (are) an operational quality attribute?
(a) Testability (b) Safety (c) Debug-ability (A) Portability
(©) Allof these a
Which of the following is (are) non-operational quality attribute?
(a) Reliability (b) Safety (©) Maintainability (a) Portability
(e) Allof these (f) None of these
In the Information security context, Confidentiality deals with the protection of data and application trom unautho-
rised disclosure. State True or False
(a) True (b) Fale
What are the two different aspects of debug-ability in the embedded system development context?
(a) Hardware & Firmware debug-ability (0) Firmware & Software debug-ability
(c) None of these
|. For an embedded system, the quality attribute “Evolvability’ refers to
(a) The upgradability of the product (b). The modifiabitity of the product
(©) Both of these (a) None of these
Portability isa measure of ‘system independence’, State Trve or False
(a) True (b) False
For a commercial embedded product the unit cost is high during
(a) Product launching (6). Product maturity
(©) Product growth (@)_ Product discontinuing
For a commercial embedded product the sales volume is high during
(a) Product launching (b), Product maturity
(©) Product growth (@)_ Product discontinaing
Explain the different characteristies of embedded systems in detail
Explain quality attribate in the embedded system development context? What are the different Quality attributes
to be considered in an embedded system design.
What is operational quality attribute? Explain the important operational quality attributes to be considered in any
embedded system design.
What is non-operational quality attribute? Explain the important non-operational quality attributes to be consid-
cred in any embedded system design.
Explain the quality attribute Response in the embedded system design context.
Explain the quality attribute Throughput in the embedded system design context@. Introduction lo Embedded Systems
10,
n
12,
1.
4.
15
16.
Explain the quality atribute Reliability in the embedded system design context
Explain the quality atiribute Maintainability in the embedded system design context.
The availability of an embedded product is 90%. The Mean Time Between Failure (MTBF) of the product is 30
days, What is the Mean Time To Repair (MTTR) in days/hours for the product?
Explain the quality attribute Information Security in the embedded system design context.
Explain the quality attribute Safety in the embedded system design context.
Explain the significance of the quality attributes Testability and Debug-ability in the embedded system design
context.
Explain the quality attribute Portability in the embedded system design context.
Explain Time-to-narker? What is its significance in product development?
Explain Time-to-protorype? What is its significance in product development?
Explain the Product Life-cycle curve of an embedded product development.Embedded Systems—Application
and Domain-Specific
&Q LEARNING OBJECTIVES
Illustrate the domain and application specific aspect of embedded systems with examples
Know the presence of embedded systems in automotive industry
Learn about High Speed Electronic Control Units (HECUs) and Low Speed Electronic Control Units (LECUs) employed
jin automotive applications
¥ learn about the Controller Area Network (CAN), Local Interconnect Network (LIN) and Media Oriented System
Transport (MOST) communication buses used in automotive applications
Y Know the semiconductor chip providers, tools and platform providers and solution providers for automotive
embedded applications
S88
‘As mentioned in the previous chapter on the characteristics of embedded systems, embedded systems
are application and domain specific, meaning; they are specifically built for certain applications in cer
tain domains like consumer electronics, telecom, automotive, industrial control, etc. In general purpose
computing, it is possible to replace a system with another system which is closely matching with the
existing system, whereas it is not the case with embedded systems. Embedded systems are highly spe-
cialised in functioning and are dedicated for a specific application. Hence it is not possible to replace
an embedded system developed for a specific application in a specific domain with another embedded
system designed for some other application in some other domain. The following sections are intended
to give the readers some idea on the application and domain specific characteristics of embedded
systems.
4.1 WASHING MACHINE—APPLICATION-SPECIFIC EMBEDDED
SYSTEM
People experience the power of embedded systems and enjoy the features and comfort provided by
them, but they are totally unaware or ignorant of the intelligent embedded players working behind the
products providing enhanced features and comfort. Washing machine is a typical example of an embed-
ded system providing extensive support in home automation applications (Fig. 4.1).B34 Introduction to Embedded Systems
As mentioned in an earlier chapter, an embedded
system contains sensors, actuators, control unit and ap-
plication-specific user interfaces like keyboards, display
units, etc. You can sec all these components in a washing
machine if you have a closer look at it. Some of them are
visible and some of them may be invisible to you.
The actuator part of the washing machine consists of
a motorised agitator, tumble tub, water drawing pump
and inlet valve to contro! the flow of water into the unit.
‘The sensor part consists of the water temperature sen-
sor, level sensor, etc. The control part contains a micro-
processor/controller based board with interfaces to the
sensors and actuators. The sensor data is fed back to the
control unit and the control unit generates the necessary
actuator outputs. The control unit also provides connec-
tivity to user interfaces like keypad for setting the wash-
ing time, selecting the type of material to be washed
like light, medium, heavy duty, ete. User feedback is
reflected through the display unit and LEDs connected
to the control board. The functional block diagram of a
washing machine is shown in Fig. 4.2.
EWE 1495
‘Washing Machine Typical example
tlancmbedded system
(fot couteyot EvraturCorpacton
(wwwelectrolux.com/au))
Integrated control
panel with user
interface. = <—7—
User interface
LED display
Level sensor
Water
inlet pipe
Inner tub
Outer tub Water Outlet
(Fig-42) Washing machine ~ Functional block diagram
Gé
Keypad
‘Temp Sensor
Picture not to scaleEmbedded Systems—Application- and Domain-Specific El,
Washing machine comes in two models, namely, top loading and front loading machines. In top load-
ing models the agitator of the machine twists back and forth and pulls the cloth down to the boitom of
the tub. On reaching the bottom of the tub the clothes work their way back up to the top of the tub where
the agitator grabs them again and repeats the mechanism. In the front loading machines, the clothes are
tumbled and plunged into the water over and over again. This is the first phase of washing.
In the second phase of washing, water is pumped out from the tub and the inner tub uses centrifugal
force to wring out more water from the clothes by spinning at several hundred Rotations Per Minute
(RPM). This is called a ‘Spin Phase’. If you look into the keyboard panel of your washing machine you
can see three buttons namely* Wash, Spin and Rinse. You can use these buttons to configure the washing
stages. As you can see from the picture, the inner tub of the machine contains a number of holes and
during the spin cycle the inner tub spins, and forces the water out through these holes to the stationary
outer tub from which it is drained off through the outlet pipe.
It is to be noted that the design of washing machines may vary from manufacturer to manufacturer,
but the general principle underlying in the working of the washing machine remains the same. The basic
controls consist of a timer, cycle selector mechanism, water temperature selector, load size selector and
start button, The mechanism includes the motor, transmission, clutch, pump, agitator, inner tub, outer
tub and water inlet valve. Water inlet valve connects to the water supply line using at home and regulates
the flow of water into the tub.
‘The integrated control panel consists of a microprocessor/controller based board with I/O interfaces
anda control algorithm running in it. Input interface includes the keyboard which consists of wash type
selector namely” Wash, Spin and Rinse, cloth type selector namely” Light, Medium, Heavy duty and
washing time setting, etc. The output interface consists of LED/LCD displays, status indication LEDs,
etc. connected to the /O bus of the controller. It is to be noted that this interface may vary from manu-
facturer to manufacturer and model to model. The other types of /O interfaces which are invisible to the
end user are different kinds of sensor interfaces, namely, water temperature sensor, water level sensor,
etc, and actuator interface including motor control for agitator and tub movement control, inet water
flow control, ete.
4.2 AUTOMOTIVE - DOMAIN-SPECIFIC EXAMPLES OF
EMBEDDED SYSTEM
The major application domains of embedded systems are consumer, industrial, automotive, telecom,
ete., of which telecom and automotive industry holds a big market share.
Figure 43 gives an overview of the various types of electronic control units employed in automotive
applications.
4.2.1 Inner Workings of Automotive Embedded Systems
Automotive embedded systems are the one where electronics take control over the mechanical systems.
The presence of automotive embedded system in a vehicle varies from simple mirror and wiper con-
trols to complex air bag controller and antilock brake systems (ABS). Automotive embedded systems
are normally built around microcontrollers or DSPs or a hybrid of the two and are generally known as
Electronic Control Units (ECUs). The number of embedded controllers in an ordinary vehicle varies
"Name may vary depending on the manufacturer.Introduction to Embedded Systems
13, Airbag control
14, Power steering 7 ae control
4
15. Airconditioner ft 11. Miror control
tmtmenin 4 | Piva toe
x 4
2. Engine control & f
1
Surjo0] poztent9 “6
8. Supension control
\
7. Wiper control
3, Fan control 5. Headlamp control
\ 6. ABS con‘rol
4. Fuel injection control
‘itndted eyster in the antornotive dint
(Pte courte of ona il Crna (enhanc)
from 20 to 40 whereas a luxury vehicle like Mercedes S and BMW 7 may contain 75 to 100 numbers of
embedded controllers. Government regulations on fuel economy, environmental factors and emission
standards and increasing customer demands on safety, comfort and infotainment forces the automotive
manufactures to opt for sophisticated embedded control units within the vehicle. The first embedded
system used in automotive application was the microprocessor based fuel injection system introduced
by Volkswagen 1600 in 1968.
The various types of electronic control units (ECUs) used in the automotive embedded industry can
be broadly classified into two-High-speed embedded control units and Low-speed embedded control
units.
4.2.1.1 High-speed Electronic Control Units (HECUs) High-speed electronic control units
(HECUs) are deployed in critical control units requiring fast response. They include fuel injection
systems, antilock brake systems, engine control, electronic throttle, steering controls, transmission
control unit and central control unit.
4.2.1.2 Low-speed Electronic Contro! Units (LECUs) Low-Speed Electronic Control
Units (LECUs) are deployed in applications where response time is not so critical. They generally
are built around low cost microprocessors/microcontrollers and digital signal processors. Audio con-
trollers, passenger and driver door locks, door glass controls (power windows), wiper control, mirror
control, seat control systems, head lamp and tail lamp controls, sun roof control unit etc. are examples
of LECUs.Embedded Systems—Application- and Domain-Specific A,
4.2.2 Kutomotive Communication Buses
Automotive applications make use of serial buses for communication, which greatly reduces the amount
of wiring required inside a vehicle. The following section will give you an overview of the different
types of serial interface buses deployed in automotive embedded applications.
4.2.2.1 Controller Area Network (CAN) The CAN bus was originally proposed by Robert Bosch,
pioneer in the Automotive embedded solution providers. It supports medium speed (ISO11519-class B
with data rates up to 125 Kbps) and high speed (1SO11898 class C with data rates up to !Mbps) data
transfer. CAN is an event-driven protocol interface with support for error handling in data transmission.
Itis generally employed in safety system like airbag control; power train systems like engine control and
Antilock Brake System (ABS); and navigation systems like GPS. The protocol format and interface ap-
plication development for CAN bus will be explained in detail in another volume of this book series.
4.2.2.2 Local Interconnect Network (LIN) LIN bus is a single master multiple slave (up to 16
independent siave nodes) communication interface. LIN is a low speed, single wire communication
interface with support for data rates up to 20 Kbps and is used for sensor/actuator interfacing. LIN bus
follows the master communication triggering technique to eliminate the possible bus arbitration prob-
Jem that can occur by the simultaneous talking of different slave nodes connected to a single interface
bus. LIN bus is employed in applications like mirror controls, fan controls, seat positioning controls,
window controls, and position controls where response time is not a critical issue.
4.2.2.3 Media-Oriented System Transport (MOST) Bus ‘The Medis-oriented system transport
(MOST) is targeted for automotive audio/video equipment interfacing, used primarily in European cars.
A MOST bus is a multimedia fibre-optic point-to-point network implemented in a star, ring or daisy-
chained topotogy over optical fibre cables. The MOST bus specifications define the physical (electrical
and optical parameters) layer as well as the application layer, network layer, and media access control.
MOST bus is an optical fibre cable connected between the Electrical Optical Converter (EOC) and
Optical Electrical Converter (OEC), which would translate into the optical cable MOST bus.
4.2.3 Key Players of the Automotive Embedded Market
The key players of the automotive embedded market can be visualised in three verticals namely, silicon
providers, solution providers and tools and platform providers.
4.2.3.1 Silicon Providers Silicon providers are responsible for providing the necessary chips which
are used in the control application development. The chip may be a standard product like microcon-
troller or DSP or ADC/DAC chips. Some applications may require specific chips and they are manufac-
tured as Application Specific Integrated Chip (ASIC). The leading silicon providers in the automotive
industry are:
Analog Devices (www.analog.com): Provider of world class digital signal processing chips, precision
analog microcontrollers, programmable inclinometer/accelerometer, LED drivers, etc. for automotive
signal processing applications, driver assistance systems, audio system, GPS/Navigation system, etc.
Xilinx (www.xilinx.com): Supplier of high performance FPGAs, CPLDs and automotive specific IP
cores for GPS navigation systems, driver information systems, distance control, collision avoidance,
rear seat entertainment, adaptive cruise control, voice recognition, etc.pcs 4 Introduction to Embedded Systems
Atmel (www.atmel.com): Supplier of cost-effective high-density Flash controllers and memories. At
mel provides a series of high performance microcontrollers, namely, ARM®, AVR®, and 80C51. A
wide range of Application Specific Standard Products (ASSPs) for chassis, body electronics, security,
safety and car infotainment and automotive networking products for CAN, LIN and FlexRay are also
supplied by Atmel
Maxim/Dailas (www.maxim-ic.com): Supplier of world class analog, digital and mixed signal products
(Microcontrotlers, ADC/DAC, amplifiers, comparators, regulators, etc), RF components, ete. for all
kinds of automotive solutions.
Nip semiconductor (www.nxp.com): Supplier of 8/16/32 Flash microcontrollers.
Renesas (www-renesas.com): Provider of high speed microcontrollers and Large Scale Integration (LSI)
technology for car navigation systems accommodating three transfer speeds: high, medium and low.
Texas Instruments (www.ti.com): Supplier of microcontrollers, digital signal processors and automo-
tive communication control chips for Local Inter Connect (LIN) bus products.
Fujitsu (www.final.fujitsu.com): Supplier of fingerprint sensors for security applications, graphic dis-
play controller for instrumentation application, AGPS/GPS for vehicle navigation system and different
types of microcontrollers for automotive control applications.
Infineon (www.infincon.com): Supplier of high performance microcontrollers and customised applica-
tion specific chips.
NEC (www.nee.co,jp): Provider of high performance microcontrollers.
There are lots of other silicon manufactures which provides various automotive sport systems like
power supply, sensors/actuators, optoelectronics, etc. Describing all of them is out of the scope of this
book. Readers are requested to use the Internet for finding more information on them,
4.2.3.2 Tools and Platform Providers Toolsand platform providers are manufacturers and suppli-
ers of various kinds of development tools and Real Time Embedded Operating Systems for developing
and debugging different control unit related applications, Tools fall into two categories, namely embed-
ded software application development tools and embedded hardware development tools. Sometimes the
silicon suppliers provide the development suite for application development using their chip. Some third
party suppliers may also provide development kits and libraries. Some of the leading suppliers of tools
and platforms in automotive embedded applications are listed below.
ENEA (www.enea.com): Enea Embedded Technology is the developer of the OSE Real-Time operat-
ing system. The OSE RTOS supports both CPU and DSP and has also been specially developed to sup-
port multi-core and fault-tolerant system development.
The MathWorks (www.mathworks.com): It is the world’s leading developer and supplier of technical
software. It offers a wide range of tools, consultancy and training for numeric computation, visualisa-
tion, modelling and simulation across many different industries. MathWork’s breakthrough product is
MATLAB-a high-level programming language and environment for technical computation and numeri
cal analysis. Together MATLAB, SIMULINK, Stateflow and Real-Time Workshop provide top quality
tools for data analysis, test & measurement, application development and deployment, image processing
and development of dynamic and reactive systems for DSP and control applications.
VARM® is the registered trademark of ARM Holdings.
2 AVR® isthe registered trademark of Atmel Corporation.Embedded Systems—Application- and Domain-Specific EE
Keil Software (www.keil.com): The Integrated Development Environment Keil Microvision from Keil
software is a powerful embedded software design tool for 8051 & C166 family of microcontrollers.
Lauterbach (http://www.lauterbach.com/): It is the world’s number one supplier of debug tools, pro-
viding support for processors from multiple silicon vendors in the automotive market.
ARTISAN (wwwartisansw.com): Is the leading supplier of collaborative modelling tools for require-
ment analysis, specification, design and development of complex applications.
Microsoft (www:microsoft.com): It is a platform provider for automotive embedded applications.
Microsoft’s WindowsCE is a powerful RTOS platform for automotive applications. Automotive features
are included in the new WinCE Version for providing support for automotive application developers.
4.2.3.3 Solution Providers Solution providers supply OEM and complete solution for automotive
applications making usc of the chips, platforms and diffcrent development tools. The major players of
this domain are listed below.
Bosch Automotive (www-boschindia.com): Bosch is providing complete automotive solution ranging
from body electronics, diesel engine control, gasoline engine control, powertrain systems, safety systems,
in-car navigation systems and infotainment systems.
DENSO Automotive (www.globaldensoproducts.com): Denso is an Original Equipment Manufacturer
(OEM) and solution provider for engine management, climate control, body electronics, driving control
& safety, hybrid vehicles, embedded infotainment and communications.
Infosys Technologies (www.infosys.com): Infosys is a solution provider for automotive embedded hard-
ware and software, Infosys provides the competitive edge in integrating technology change through cost-
effective solutions.
Delphi (www-delphi.com): Delphi is the complete solution provider for engine control, safety, infotain-
ment, etc., and OEM for spark plugs, bearings, etc.
...and many more. The list is incomplete. Describing all providers is out of the scope of this book.
e, Summary
¥ Embedded systems designed for a particular application for a specific domain cannot be replaced with another
embedded system designed for another application for a different domain
Y Consumer, industrial, automotive, telecom, etc. are the major application domains of embedded systems. Tele-
com and automotive industry are the two segments holding a big market share of embedded systems
Y Automotive embedded systems are normally built around microcontrollers or DSPs or a hybrid of the two and
are generally known as Electronic Control Units (ECUs)
¥- High speed Electronic Control Units (HECUs) are deployed in critical control units requiring fast response, like
fuel injection systems, antilock brake system, etc
¥ Low speed Electronic Control Units (LECUs) are deployed in applications where response time is not so critical.
They are generally built around fow cost microprocessors/microcontrollers and digital signal processors. Audio
controllers, passenger and driver door locks, door glass controls, etc, are examples for LECUS.
Y Automotive applications use serial buses for communication. Controller Area Network (CAN), Local Intercon-
rect Network (LIN), Media Oriented System Transport (MOST) bus, etc. are the important automotive commu-
nication buses.p20 4 ee
Y CAN is an event driven serial protocol interface with support for error handling in data transmission. It is gener-
ally employed in safety system like airbag control, powertrain systems like engine control and Antilock Brake
Systems (ABS)
Y LIN bus is single master multiple slave (up to 16 independent slave nodes) communication interface. LIN is
a low speed, single wire communication interface with support for data rates up to 20Kbps and is used for sen-
sor/actuator interfacing,
Y The Media Oriented System Transport (MOST) bus is targeted for automotive audio video equipment interfac-
ing. MOST bus is a multimedia fibre-optic point-to-point network implemented in a star, ring or daisy-chained
topology over optical fibres cables
¥ The key players of the automotive embedded market can be classified into ‘Silicon Providers’, ‘Tools and Plat-
form Providers’ and ‘Solution Providers’
Keywords
ECU = Electronic Control Unit. The generic term for the embedded control units in automotive application
HECU : High-speed Electronic Control Unit. The high-speed embedded control unit deployed in automotive appli-
cations
LECU + Low-speed Electronic Control Unit. The low-speed embedded control unit deployed in automotive applica-
tions
CAN + Controller Area Network. An event driven serial protocol interface used primarily for automotive applica-
tions
LIN + Local Interconnect Network. A single master multiple slave, low speed serial bus used in automotive ap-
plic
MOST : Media Oriented System Transport Bus. A multimedia fibre-optic point-to-point network implemented ina
star, ring or daisy-chained topology over optical fibres cables,
1. In Automotive systems, High-speed Electronic Control Units (HECUs) are deployed in
(a) Fuel injection systems (b) Antilock brake systems
(©) Power windows (@) Wiper control (©) Only (a) and (b)
2. In Automotive systems, Low speed electronic control units (LECUs) are deployed in
(@) Electronic throttle (b) Steering controls. (c). Transmission control (d) Mirror control
3. The first embedded system used in automotive application is the microprocessor based fuel injection system intro-
duced by in 1968
(@) BMW (b) Volkswagen 1600 _(¢) Benz E Class (@) KIA
4. CAN bus is an event driven protocol for communication. State True or False
(@) Tre (b) False
‘5. Which of the following serial bus is (are) used for communication in Auiomotive Embedded Applications?
(a) Controller Area Network (CAN) (b)_Locel Interconnect Network (LIN)
(©) Media Oriented System Transport (MOST) bus (d)_ All of these (e) None of these
6. Which of the following is tue about LIN bus?
(@) Single master multiple slave interface (b) Low speed serial bus
(©) Used for sensor‘actuator interfacing (@) Allof these (e) None of theseEmbedded Systems—Application- and Domain-Specific
Which of the following is true about MOST bus?
(@) Used for automotive audio video system interfacing.
(b) Itis a fibre optic point-to-point network
(©) Itis implemented in star, ring or daisy-chained topology
(@ All ofthese (© None of these
Which of the following is (are) example(6) of Silicon providers for automotive applications?
(@) Maxim/Dallas (b) Analog Devices (c) Xilinx (@) Atmel
(©) Allofthese (None of these
Review Questions
Explain the role of embedded systems in automotive domain.
Explain the different electronic control units (ECUs) used in automotive systems.
Explain the different communication buses used in automotive application.
Give an overview of the different market players of the automotive embedded application domain.ES nau eS R en ac
8bit Microcontrollers—8051
s
Understand the different factors that need to be considered while selecting a microcontroller for an. embedded
design
Know why 8051 is the popular choice for low cost low performance embedded system design
leam the A to Z of 8051 microcontroller architecture
eam the Internals of the 8051 microcontroller
Lear the program memory and internal data memory organisation of 8051
eam the Paged Data memory access and Von-Neumann memory model implementation for 8051
team about the organisation of lower 128 bytes RAM for data memory, upper 128 bytes RAM for SFR and upper
426bytes RAM for Internal Data memory (TRAM)
Learn about the CPU registers and general purpose registers of 8051
Learn about the Oscillator unit and speed of execution of 8051
learn about the different 1/0 ports, organisation of the ports, the internal implementation of the port pins, the
different registers associated with the ports and the operation of ports
¥ Lear about interupts and its significance in embeded applications
Learn about the Interrupt System of 8051, the interrupts supported by 8051, interupt priorities, different registers
essociated with configuring the interrupts, Interupt Service Routine and their vector address
¥ Learn about the Timer/Counter units supported by 8051, and configuring the Timer unit for Timer/Counter opera-
tion. Learn the different registers associated with timer units and the different modes of operations supported by
Timer/Counter units
Learn about the Serial Port of the 8051, the different control, status and data registers associated with it
Learn the different modes of operations supported by the Serial port and setting the baudrate for each mode
Lear about the Power-On Reset circuit implementation for 8051
team about the different power saving modes supported by 8051
Learn the difference between 8051 and 8052
wns
as
KAKK GK
Arecent survey on the microcontroller industry reveals that 8bit microcontrollers account for more than
40% of the total sales in the microcontroller industry. Among the 8bit microcontrollers, the 805/ family
is the most popular, cost effective and versatile device offering extensive support in the embedded appli-Designing Embedded Systems with 8bit Microcontrollers—8051 p23]
cation domain. Looking back to the history of microcontrollers you can find that the 8bit microcontroller
industry has travelled a lot from its first popular model 803/AH built by Intel in 1977 to the advanced
8bit microcontroller built by Maxim/Dallas recently, which offers high performance 4 Clock, 75MHz
operation 805/ microcontroller core (Remember the original 8031 core was 12 Clock with support for
a maximum system clock of 6MHz, so a performance improvement of 3 times on the original version
in execution) with extensive support for networking by integrating 10/100 Ethernet MAC with IEEE
802.3 MMI, CAN bus for automotive application support, RS-232 C interface for legacy serial applica-
tions, SPI serial interface for board level device inter connect, 1-wire interface for connecting to low
cost multi-drop sensors and actuators, and 16MB addressing space for code and data memory.
5.1 FACTORS TO BE CONSIDERED IN SELECTING A CONTROLLER
Selection of a microcontroller for any application depends on some design factors. A good designer
finalises his selection based on a comparative study of the design factors. The important factors to be
considered in the selection process of a microcontroller are listed below.
5.1.1 Feature Set
The important queries related to the feature set are: Does the microcontroller support all the peripherals
required by the application, say serial interface, parallel interface, etc.? Does it satisfy the general /O
port requirements by the application? Does the controller support sufficient number of timers and coun
ters? Does the controller support built-in ADC/DAC hardware in case of signal processing applications?
Does the controller provide the required performance’)
5.1.2 Speed of Operaticn
Speed of operation or performance of the controller is another important design factor. The number
of clocks required per instruction cycle and the maximum operating clock frequency supported by the
processor greatly affects the speed of operation of the controller. The speed of operation of the controller
is usually expressed in terms of million instructions per second (MIPS).
5.1.3 Code Memory Space
If the target processor/controller application is written in C or any other high level language, does the
controller support sufficient code memory space to hold the compiled hex code (In case of controllers
with internal code memory)?
5.1.4 Data Memory Space
Does the controller support sufficient internal data memory (on chip RAM) to hold run time variables
and data structures?
5.1.5 Development Support
Development support is another important factor for consideration. It deals with-Does the controller
manufacture provide cost-effective development tools? Does the manufacture provide product samplesi Introduction to Embedded Systems
for prototyping and sample development stuffs to alleviate the development pains? Does the controller
support third party development tools? Does the manufacture provide technical support if necessary?
5.1.6 Availability
Availability is another important factor that should be taken into account for the selection process. Since
the product is entirely dependent on the controller, the product development time and time to market the
product solely depends on its availability. By technical terms itis referred to as Lead time. Lead time is
the time elapsed between the purchase order approval and the supply of the product,
5.1.7 Power Consumption
‘The power consumption of the controller should be minimal. It is a crucial factor since high power
requirement leads to bulky power supply designs. The high power dissipation also demands for cool-
ing fans and it will make the overall system messy and expensive. Controllers should support idle and
power down modes of operation to reduce power consumption.
5.1.8 Cost
Last but not least, cost is a big deciding factor in selecting a controller. The cost should be within the
reachable limit of the end user and the targeted user should not be /righ tech, Remember the ultimate aim
of a productiis to gain marginal benefit.
5.2 WHY 8051 MICROCONTROLLER
8051 is avery versatile microcontroller featuring powerful Boolean processor which supports bit manip-
ulation instruetions for real time industrial control applications. The standard 805/ architecture supports
6 interrupts (2 extemal interrupts, 2 timer interrupts and 2 serial interrupts), two 16bit timers/counters,
32 1/0 lines and a programmable full duplex serial interface. Another fascinating feature of 805/ is the
way it handles interrupts. The interrupts have two priority levels and each interrupt is allocated fixed 8
bytes of code memory. This approach is very efficient in real time application, Though 8051 is invented
by Intel, today it is available in the market from more than 20 vendors and with more than 100 variants
of the original 805/ flavour, supporting CAN, USB, SPI and TCP/IP interfaces, integrated ADC/DAC,
LCD Controller and extended number of I/O ports. Another remarkable feature of 8051 is its low cost.
The 6051 flash microcontroller (T89C51) from Atmel is available in the market for less than 1USS per
piece. So imagine its cost for high volume purchases.
5.3 DESIGNING WITH 8051
5,3.1 The 8051 Architecture
The basic 8051 architecture consist of an 8bit CPU with Boolean processing capability, oscillator driver
unit, 4K bytes of on-chip program memory, 128 bytes of intemal data memory, 128 bytes of special
function register memory area, 32 general purpose I/O lines organised into four 8bit bi-directional ports,
two I6bit timer units and a full duplex programmable UART for serial data transmission with configu-
rable baudrates. Figure 5.1 illustrates the basic 8051 architecture.Designing Embedded Systems with 8bit Microcontrollers—8051 Ek
rooney P201r27
A ese hak SHAERE ES
Ta eee oa
tera ereuiay fo rine ox? muRy
as | aes drives Tine
Timer Tinero mig
Eten Lis
Pon tach | [tae fox
Faniero | | anon |
Hi
ce
RAM
- (028 Bye
= as Row
vant aac) | 4 —Lersem
(Ser Por) L eo
: Timing & Conta |-—1> EA\VPP
noe ast
f — &D
RX TXD. t we
sella
Port tah — |
8051 Axchitecture—Block diagram representation
5.3.2 The Memory Organisation
8051 is built around the Harvard processor architecture. The program and data memory of 805/ is
logically separated and they physically reside separately. Separate address spaces are assigned for data
memory and program memory. 805/'s address bus is 16bit wide and it can address up to 64KB (2!6)
memory.
5.3.2.1 The Program (Code) Memory The basic 8051 architecture provides lowest 4K bytes
of program memory as on-chip memory (built-in chip memory). In 8031, the ROMless counterpart of
8051, all program memory is extemal to the chip. Switching between the internal program memory and
extemal program memory is accomplished by changing the logic level of the pin External Access (EA\).
Tying EA\ pin to logic | (V,.), configures the chip to execute instructions from program memory up to
4K (program memory location up to OFFFH) from internal memory and 4K (program memory location
from 1000H) onwards from external memory, while connecting EA\ pin to logic 0 (GND) configures the
chip to extemal program execution mode, where the entire code memory is executed from the external
memory. Remember External Access pin is an active low pin (Normally referred as EA\). The control
signal for external program memory execution is PSEN\ (Program Strobe Enable). For internal programSh Introduction to Embedded Systems
memory fetches PSEN\ is not activated. For 8031 controller without on-chip memory, the PSEN\ signal
is always activated during program memory execution. The External Access pin (EA\) configuration
and the corresponding code memory access are illustrated in Fig. 5.2.
FFFFH| FFFFH
External program
memory
External program (Of-Chip ROM)
memory
(Off-Chip ROM)
1000H
OFFFH
Internal program
memory |
(On-Chip ROM) |
00008 00H }
EA\=0 EA\=1
Extemal program Intemal program
memory access memory access
1st Peogeais meesny capatiecii
If the program memory is external, 16 I/O lines are used for accessing the extemal memory. Port 0
and Port 2 are used for extemal memory accessing. Port 0 serves as multiplexed address/data bus for
external program memory access. Similar to the 8085 microprocessor, Port 0 emits the lower order
address first. This can be latched to an 8bit external latch with the Address Latch Enable (ALE) signal
emitted by 805/. Once the address outing is over, Port 0 functions as input port for data transfer from
the corresponding memory location. The address from which the program instruction to be fetched is
supplied by the 16bit register, Program Counter (PC), which is part of the CPU. The Program Counter is
a 16bit register made up of two 8bit registers. The lower order byte of program counter register is held
by the PCL register and higher order by the PCH register. PCL and PCH in combination serve as a 16bit
register. During extemal program memory fetching, Port 0 emits the contents of PCL and Port 2 emits
the contents of PCH register. Port 0 emits the contents of PCL only for a fixed duration allowing the
external latch to hold the content on arrival of the ALE signal. Afterwards Port 0 goes into high imped-
ance state, waiting for the arrival of data from the corresponding memory location of external memory.
‘Whereas Port 2 continues emitting the contents of PCH register throughout the external memory fetch,
Once the PSEN\ signal is active, data from the program memory is clocked into Port 0. Remember, dur-
ing external program memory access Port 0 and Port 2 are dedicated for it and cannot be used as general
purpose I/O ports, The interfacing of an external program memory chip is illustrated in Fig. 5.3.
5.3.2.2 The Data Memory The basic 8051 architecture supports 128 bytes of internal data memory
and 128 bytes of Special Function Register memory. Special Function Register memory is not avail-
able for the user for general data memory applications. The address range for internal user data memory
is 00H to 7FH. Special Function Registers are residing at memory area 80H 10 FFH. 805/ supports
interface for 64 Kbytes of extemal data memory. The control signals used for external data memoryDesigning Embedded Systems with 8bit Microcontrollers—8051
Program Memo
apt Data Bus D0....D7 my.
PO 00....07
Lateh s
(e922 TALS373) jm A0,..A7 me
ALE és
-—_—_ 2
TS A815 &
Address B
Output enable of ROM chip
PSEN\ -— OE)
EA
Vv
8051 External Program Memory chip (ROM) interfacing
access are RD\ and WR\ and the 1 6bit register holding the address of external data memory address to
be accessed is Data Pointer (DPTR). Similar to the Program Counter, the Data Pointer is also made up
of two 8bit registers, namely, DPL (holding the lower order 8bit) and DPH (holding the higher order
8bit). The program counter is not accessible to the user whereas DPTR is accessible to the user and the
contents of DPTR register can be modified. In external data memory operations, Port 0 emits the content
of DPL and Port 2 emits the content of DPH. Port 0 is address/data multiplexed in external data memory,
operations also. The intemal and external data memory model of 8057 is diagrammatically represented
in Fig. 5.4.
FFFFH
On-chip RAM Off-chip RAM
| Upperi28ives t] |
‘ (RAM) t | SER memory |
t entin 8052 | | space |
{ | 64KB extemal |
om bn | eel
TH | } |
| (RAM) |
oot | | |
oon |
Data memory map for 8051
Internal data memory addresses are always one byte long. So it can accommodate up to 256 bytes
of intemal data memory (Ranging from 0 to 255). However the addressing techniques used in 8051
can accommodate 384 bytes using a simple memory addressing technique. The technique is: Directea Introduction to Embedded Systems
addressing of data memory greater than 7FH will access one memory space, namely Special Function
Register memory and indirect addressing of memory address greater than 7FH will access another
‘memory space, the upper 28 bytes of data memory (Direct and indirect memory addressing will be dis-
cussed in detail in a later section), Remember these techniques will work only if the upper data memory
is physically implemented in the chip. The basic version of 805/ does not implement the upper data
memory physically. However the 8052 family implements the upper data memory physically in the chip
and so the upper 128 byte memory is also available for the user as general purpose memory, if accessed
through indirect addressing.
External data memory address can be either one or two bytes long. As deseribed earlier, Port 0 emits
the lower order 8bit address and, if the memory address is two bytes and if it ranges up to 64K, the entire
bits of Port 2 is used for holding the higher order value of data memory address. If the memory range
is 32K, only 7 bits of Port 2 is required for addressing the memory. For 16K, only 6 lines of Port 2 are
required for interfacing and so on. Thereby you can save some port pins of Port 2. The interfacing of an
external data memory chip is illustrated Fig. 5.5.
External data
| Data bus DO....D7 memory, |
PO DO....D7
|
Lateh
(€§-74L8373) maps A0...A7
/ —
oF
RD\ z
P3~ WR\ WR\
—_-
|
|
|
External Data memory access
5.3.2.3 Paged Data Memory Access In paged mode addressing, the memory is arranged like the
lines of a notebook. The notebook may contain 100 to 200 pages and each page may contain a fixed
number of lines. You can access a specific line by knowing its page number and the line number. Mem-
ory can also arrange like the lines of a notebook. By using 8bit address, memory up to 256 bytes can be
accessed. Imagine the situation where the memory is stacked of 256 bytes each. You can use port pins
(High order address rule) to signal the page number and the lower order 8 bits to indicate the memory
location corresponding to that page.
For example, take the case where paging is done using the port pin P2.0 and port 0 is used for holding
the lower address. The memory range will be
Page selector (P2.0) Lower order address Address range
0 OOH to FFH 00H to OFFH
1 OOH to FFH 100H to 1FFHDesigning Embedded Systems with bit Microcontrollers—8051 Hk
5.3.2.4 The Von-Neumann Memory Model for 8051 The code memory and data memory of
8051 can be combined together to give the Von-Neumann architectural benefit for 805/.A single mem-
ory chip with read/write option can be used for this, The program memory can be allocated to the lower
memory space starting from 0000H and data memory can be assigned to some other specific area after
the code memory. For program memory fetching and data memory read operations combine the PSEN\
and RD\ signals using an AND gate and connect it to the Output Enable (OE\) signal of the memory
chip as shown in Fig. 5.6
External memory
Data bus D0....D7 (Code + Data)
DO....D7
z |
o
PSEN\ | :
ee |
Combining Code memory and Data memory
The Von-Neumann memory model is very helpful in evaluation boards for the controller, which
allows modification of code memory on the fly. The major drawbacks of using a single chip for program
and data memory are
* Accidental corruption of program memory
‘Reduction in total memory space. In separate program and data memory model the total available
memory is 128KB (64KB program memory + 64KB Data memory) whereas in the combined
model the total available memory is only 64KB
5.3.2.5 Lower 128 Byte Internal Data Memory (RAM) Organisation This memory area is
volatile; meaning the contents of these locations are not retained on power lose. On power up these
memory locations contain random data, The lowest 32 bytes of RAM (00H to IFH) are grouped into 4
banks of 8 registers each. These registers are known as RO to R7 registers which are used as temporary
data storage registers during program execution. The effective usage of these registers reduces the code
memory requirement since register instructions are shorter than direct memory addressing instructions.
The next 16 bytes of RAM with address 20H to 2FH is a bit addressable memory area. It accommodates
128 bits (16 bytes x 8), which can be accessed by direct bit addressing. The address of bits ranges from
00H to 7FH. This is very useful since 8051 is providing extensive support for Boolean operations (Bit
Manipulation Operations). Also it saves memory since flag variables can be set up with these bits andp 1004 Introduction to Embedded Systems
there is no need to waste one full byte of memory for setting up a flag variable. These 16 bytes can also
be used as byte variables. The context in which these bytes are used as either byte variable or bit vari-
able is determined by the type of instruction. If the instruction is a bit manipulation instruction and the
operand is given as a direct address in the range 00H to 7FH, itis treated as a bit variable. The lower 128
bytes of intemal RAM for 8051 family members is organised as shown in Fig. 5.7.
FA)
Scratchpad RAM.
80 bytes 30H ~7FH
30H
TE Bitaddressable area
(Bit addresses 00-07H)
16 bytes 20H -2FH
f
<
ees alae |
(4 banks of 8 registers RO-R7
ieee OE - 32 bytes 00H ~1FH
Remember the byte-wise storage and bitwise storage in the area 20H to 2FH shares a common physi-
cal memory area and you cannot use this for both byte storage and bit storage simultaneously. If you do
so, depending on the usage, the byte variables and bit variables may get corrupted and it may produce
unpredicted results in your application. This is explained more precisely using the following table.
B7 B6 BS B4 B3 B2 BL BO Byte Address
TBH 7EH 7DH 7CH 7BE TAH 79H 78H 2FH
7m 76H 75H 74H 73H PH 71H 70H 2EH
OFH EH DH 6CH 6B 6AH 69 8H 2DH
on 66H 05H oat 63H 62H ol oo 2cH
FH SEH SDH SCH SBH SAH SoH SH 2BH
STH SOE SSH SaH 53H S21 sin SoH 2AH
4FH 4EH 4DH 4CH 4BH 4H 49H 48H 29H
47H 46H. 45H dH a3H 42H 41H 40H 28H
3FH 3EH 3DH 3CH 3BH 3AH 39H 38H 27H
37H 36H 35H 34H 33H 32H 31H 30H 26H
2FH 26H 2DH 2CH 2BH 2AH 29H 28H 25H.
27H 26H 23H 24H 23H 22H 21H 20H 24H
IH 1EH. IDH ICH 1BH 1AH 19H 18H 23HDesigning Embedded Systems with 8bit Microcontrollers—8051 p20.
17H 16H 15H 14H BH RH tH 10H 2H
OFH OEH ODH cH BH OAH 09H 08H 21H
O7H 6H OSH. 4H OH oH on oH 20H
BO, B1, B3 ...B7 represents the bit addresses, Now let’s have a look at the following piece of
Assembly code:
10008
END
This piece of assembly code sets the bit with bit address 01H and loads the memory location 2011
with value FOH. Don’t worry about the different instructions used here. We will discuss about the 8051
instruction set in a later chapter. The MOV 20H, #00H instruction clears the memory location 20H. The
SETB 01H instruction stores logic 1 in the bit address 01H. In reality the bit address 01H is the bit 1 of
the memory location pointed by address 20H. Executing the instruction SETB 01H changes the contents
of memory location 20H to 02H (00000010b. Only bit 1 is in logic 1 state). The instruction MOV 20H,
#FOH alters the content of memory location 20H with FOH (11110000b). This overwrites the informa-
tion held by bit address 01H and leads to data corruption. So be careful while using bitwise storage and
byte-wise storage simultaneously.
The next 80 bytes of RAM with address space 30H to 7FH is used as general purpose scratch-
pad RAM. Though memory spaces 00H to 2FH have specific usage, they can also be used as general
purpose scratchpad (Read/Write) RAM. The lower 128 byte RAM can be accessed by either direct
addressing or indirect addressing.
5.3.2.6 The Upper 128 bytes RAM (Special Function Registers) The upper 128 bytes of RAM
when accessed by direct addressing, accesses the Special Function Registers (SFRs). SFRs include port
latches, status and control bits, timer control and value registers, CPU registers, stack pointer, accumula-
tor, otc. Some of the SFR registers are only byte level accessible and some of them are both byte-wise
and bit-wise accessible. SFRs with address ends in OH and 8H are both bit level and byte level acces-
sible. In the standard 8051 architecture, among the 128 bytes, only a few bytes are occupied by the SFR
and the rest are left unused and are reserved for future implementations. The table given below explains
the SFR implementation for standard 805/ architecture.
Memory SFR Name Memory SFR Name Memory SFR Name
Address Address Address
80H Port 0 SAH TLO AOH Pont 2
Sin sp BH TL ASH IE
92H DPI 8CH THO ROH Port 3
83H DPH 8DH THI BSH P
87H PCON 90H Port 1 DOH PsW
88H TCON 98H SCON EOH A
89H TMOD 99H SBUF FOH B= Introduction to Embedded Systems
SFR memory is not available to the user for general purpose scratchpad RAM usage. However the
user can modify the contents of some of the SFR according to the program requirements. Some of the
‘SFRs are Read Only. Some of the SFR memory spaces are not implemented in the basic 8051 version.
‘They are reserved for future use and users are instructed not to do anything with this reserved SFR
space, Reading from the unimplemented SFR memory address returns random data and writing to this
memory location will not produce any effect. Each of the SFRs will be discussed in detail in the sections
covering their usage.
5.3.2.7 Upper 128 Bytes of Scratchpad RAM (IRAM) Variants of 8051 and the 8052 architec-
ture where the upper 128 bytes of RAM are physically implemented in the chip can be used as general
purpose scratchpad RAM by indirect addressing. They are generally known as IRAM. The address of
IRAM ranges from 80H to FFH and the access is indirect. Registers RO and R1 are used for indirect ad-
dressing. For example, for accessing the IRAM located at address 80H, load RO or RI with 80H and use
the indirect memory access instruction. The following piece of assembly code illustrates the same.
MOV RO, #80H ; Load IRAN address 80H in indirect register
MOV A,@RO ; Load Accumulator with IRAN content at address 80H
5.3.3 Registers
Registers of 8051 can be broadly classified into CPU Registers and Scratchpad Registers
5.3.3.1 CPU Registers Accumulator, B register, Program Status Word (PSW), Stack Pointer (SP),
Data Pointer (DPTR, Combination of DPL and DPH), and Program Counter (PC) constitute the CPU
registers. They are described in detail below.
Accumulator (ACC) (SFR-E0H) tis the most important CPU register which acts as the heart of all
CPU related Arithmetic operations. Accumulator is an implicit operand in most of the arithmetic opera-
tions. Accumulator is a bit addressable register.
acer ACC Accs ACCA AcC3 ACC ACCA ACCO
BRegister (SFR-FOH) 1 is a CPU register that acts as an operand in multiply and division operations.
Italso stores the remainder in division and MSB in multiplication Instruction. B can also be used as a
general purpose register for programming,
Program Status Word (PSW) (SFR-DOH) It is an 8-bit, bit addressable Special Function register
signalling the status of accumulator related operations and register bank selector for the scratch pad
registers RO to R7. The bit details of PSW register is given below.
PSW.7 PSW6 PSWs PSw4 PSW3 Psw2 PSwi PSw.o
cy AC FO RSI RSO ov P
The table given below explains the meaning and use of each bit.
Bit ‘Name ‘Explanation
cy Carry flag Sets when a carry occurs on the addition of two 8-bit numbers or when a borrow
occurs on the subtraction of two 8-bit numbers.
‘AC Auxiliary carryflag Sets when a amy generated Out of bit 3 (bit index starts from 0) on additionDesigning Embedded Systems with 8bit Microcontrollers—8051 f 103
FO Flag 0 General purpose user programmable flag (PSW.5)
ov Over flow Sets when overflow occurs. OV is set if there is a carry-out of bit 6 but not out of
bit 7, or a cary-out of bit 7 but not bit 6; otherwise OY is cleared, When adding
signed integers, OV indicates a negative number produced as the sum of two
positive operands, ora positive sum from two negative operands.
P Parity flag Set or cleared by hardware each instruction eyele to indicate an odd oreven number
of 15 in the accumulator, “P* is set to 1 if the number of 1s in the accumulator
content is odd else reset to 0
PSW.L General lag User programmable general parpose bit
RSO
RSI
The following table illustrates the possible combinations for the register bank select bits, the cor-
responding register bank number and the address for the scratchpad registers RO-R7 in the specified
register bank.
Register bank selector The it status and bank selected is given in the following table
RSI RSO Register Bank Register Address
0 0 0 (O0H-07H
0 1 1 OSH-OFH
i 0 2 10H-17H
1 1 3 18H-IFH
The power-on reset value for the bits RS! and RS2 are 0 and the default register bank for scratchpad
registers RO to R7 is 0 and the address range for RO to R7 is 00H to 07H. A programmer can change the
register bank by changing the values of RS! and RSO. The following piece of assembly code illustrates
the selection of bank 2 for the scratchpad registers RO to R7.
clear pit RSi
et bit RS1. Bank 2 is selected
Data Pointer (DPTR) (DPL: SFR-82H, DPH: SFR-83H) It is a combination of two 8-bit register
namely DPL (Lower 8-bit holder of DPTR) and DPH (Higher order 8-bit holder of DPTR). DPTR holds
the 16-bit address of the external memory to be read or written in extemal data memory operations. DPH
and DPL can be used as two independent 8-bit general purpose registers for application programming.
Program Counter (PC) It is a 16-bit register holding the address of the code memory ta be fetched.
It is an integral part of the CPU and it is hidden from the programmer ([t is not accessible to the pro-
grammer).
Stack Pointer (SP) (SFR-81H) It is an 8-bit register holding the current address of stack memory.
Stack memory stores the program counter address, other memory and register values during a sub rou-
tine/function call. On power on reset the stack pointer register value is set as 07H. The stack pointer
address and bank 0, address of R7 is same when the controller is at reset, so care should be taken for
selecting SP address. It is the responsibility of the programmer to assign sufficient stack memory by.
entering the starting address of stack into the Stack Pointer register. Care should be taken to avoid theF102 Introduction to Embedded Systems
overflow of stacks and merging of stack memory with data memory. This will result in un-predicted
program flow. The stack grows up in memory.
5.3.3.2 Scratchpad Registers (RO to RZ) The scratchpad registers RO to R7 is located in the lower
32 bytes of internal RAM. It can be on one of the four banks, which is selected by the register selector
bits RSO and RS! of the PSW register. On power on reset, by default, RSO and RS1 are 0 and the default
bank selected is bank 0. There are eight scratchpad registers and they are named as RO, R1...R7. The
register names and their memory address corresponding to bank 0 are given below.
RT R6 RS Ra RB R? RI RO
o7H OH 05H o4H GH 02H 1H 00H
‘As the bank number changes the register address also offsets by the memory address bank number
multiplied by 8. Though you can select between the register banks 0 and 3, there will be only one active
register bank at a time and it depends on the RSO and RSI bits of Program Status Word (PSW). Reg-
isters RO to R7 are used as general purpose working registers. RO and R1 also handle the role of index
addressing or indirect addressing register (@RO and @R1 instructions). RO and RI can also be used for
external memory access in place of DPTR, if the memory address is 8-bit wide ((MOVX A, @RO)- will
be discussed later).
5.3.4 Oscillator Unit
The program execution is dependent on the clock and the oscillator unit is responsible for generating
the clock signals, All 805/ family microcontrollers contain an on-chip oscillator. This contains all nec-
essary oscillator driving circuits. The only external component required is a ceramic crystal resonator.
The 805/ on chip oscillator circuit provides external interface option through two pins of the microcon-
troller, namely, XTAL1 and XTAL2.
If you are using a ceramic resonator, you can con- ae
nect itacross the XTAL1 and XTAL2 pins of the chip (CMOS Type)
with two external capacitors. Capacitors with values ee
15pF, 22pF, 33pF, ete. are used with the crystal reso- eae
nator. This is the cheapest solution since the total cost
for a ceramic resonator and two capacitors is always
less than a standalone oscillator module.
If an extemal stand alone oscillator unit is used, Creal
the output signal of the oscillator unit should be goles
connected to the pin XTALI of the chip and the pin
XTAL2 should be left unconnected for a CMOS*
type microcontroller (80C51). For an NMOS" type Circuit configuration for using on-chip
microcontroller, the oscillator output signal should oscillator
be connected to the Pin XTAL2 and the pin XTALI
should be grounded (Fig. 5.8).
* CMOS—Complementary metal-oxide-semiconductor field effect transistor teshnology for
power consumption and high logic density on an iniegrated circuit.
* NMOS—r-type metal-oxide-semiconductor field effect transistor technology for digital circuit design. It is an old technology and pos-
sesses the drawback of noise susceptibility and slow logic transition. In modern designs.
circuit design. CMOS features lessDesigning Embedded Systems with 8bit Microcontrollers—8051 2054
You may be thinking why an oscillator circuit is required? The answer isThe microcontroller chip
is made up of digital combinational and sequential circuits and they require a clock to drive the digital
circuitry. The clock is supplied by this oscillator circuit and the operational speed of the chip is depen-
dent on the clock speed.
5.3.4.1 Execution Speed The execution speed of the processor is directly proportional to the oscil-
lator clock frequency. Increasing the clock speed will have direct impact on the speed of program execu-
tion. But the internal processor core design will always have certain limitations on the maximum clock
frequency on which it can be operated. During program execution the instructions stored in the code
memory is fetched, decoded and corresponding action is initiated. Each instruction fetching consists of
the number of machine cycles. The instruction set of 8051 contains single cycle to four machine cycle
instructions.
Each machine cycle is made up of a sequence of states called 7'states. The original 8051 processor’s
machine cycle consists of 6 T states and is named $1, S2, $3...S6. Each T states in turn consist of two
oscillator periods (Clock cycles) and so one machine cycle contains 12 clock cycles. For a one machine
cycle instruction to execute, it takes 12 clock cycles. If the system clock frequency is 12MHz, it takes
Imicrosecond (1p!s) time to execute one machine cycle. The machine cycle, T state and clock cycle
relationship is illustrated in the following Fig. 5.9.
Machine cycle (M1) |
1 ' T state 1
SI s2 3 st
86
Pi | P2 | Pi | P2 | Pl | P2 | PL | P2 | PI | P2 | Pi | P.
4S1P2»-482P | P-4S2P2>-4S3P1h4 S3P20-4 S4P1 P4S4 P24 SSP PASS PL> (x~ 0,1,2,3. e.g. ANL PO, A)
ORL Px, (x= 0.1.2.3. e.g. ORL PI, A)
XRL Px, (x= 0,1,2,3. e.g. XRL P2, A)
JBC Px.y, LABEL (x= 0,1,2,3. y= 0 to 7 eg. JBC P3.0, REPEAT)
CPL Px.y (x 0,1,2,3. y ~ 0 to 7e.g. CPL PO.2)
INC Px (x= 0,1,2,3. e.g. INC PO)
DEC Px (x= 0,1,2,3. e.g. DEC P1)
DINZ Px, LABEL Px (x= 0,1,2,3. e.g. DJNZ PO, REPEAT)
MOV Px.y, C (x= 0,1,2,3. y= 0 to 7 e.g. MOV P3.7, C)
CLR Px.y (x= 0,1,2,3. y = Oto 7 e.g. CLR P1.0)
SETB Px.y (x= 0,1,2,3. y= 0 to7 eg. SETB P3.6)
‘The instructions MOV Px,y, C, CLR Px.y and SETB Px.y, read the Port x byte (8 bits of the Px latch)
and modify bit y and write the new byte back to the Px latch,
The following assembly code snippet illustrates the Read Latch operation
) #0FH
$0FH
Executing the instruction MOV PO, #0FH loads the Port 0 latch with OFH (The latches for port pins
PO. to P0.3 are set). Now Port pins P0.0 to P0.3 acts as input pins, Executing the instruction MOV A,
#0FH loads the accumulator with OFH. The ANL PO, A instruction reads the PO latch and logical AND it
with accumulator and rewrites the PO latch with the ANDed result. The status of port pins configured as
input port has no effect on the instruction ANL PO, A. Suppose PO.0 pin (Not P0.0 latch bit) is at logic
O and pins PO.1 to PO.3 are at logic | at the time of executing the instruction AN P0, A, still Port 0 latch
is loaded with OFH and not 0EH.
The Read Pin operation reads the status of a port pin when the corresponding port pin is configured
as input pin (When the corresponding port latch bit is loaded with logic |). The port architecture for all
4 ports contains necessary circuit for reading the Port Pin for all ports. The read Port Pin operation is
triggered by the control signal Read Pin. The Read Pin control signal is generated internally on execut-
ing an instruction implementing the Read Pin operation. MOV 4, Px, MOY C, Pxy are examples for
Read Pin instructions, The following code snippet illustrates the ‘Read Pin’ operation.
MOV-PO, #0FH = Configure P0.0 to P0:3 pins. as. input pins
MOV. A, PO #)Load Accumulator with PO Port pin status
Executing the instruction MOV P0, #0FH loads the Port 0 latch with OFH (The latches for port pins PO.0
to PO.3 are set). Now Port pins P0.0 to PO.3 act as input pins. Executing the instruction MOV A, PO loads
accumulator with the Pin status of pins P0.0 PO.3. Suppose P0.0 pin is at logic 0 and pins PO.1 to PO.3
are at logic 1 at the time of executing the instruction MOV A, PO, the accumulator is loaded with OEH.
5.3.5.6 Source and Sink Currents for 8051 Ports
Source Current The term source current refers to how much current the 8051 port pin can supply to
drive an externally connected device. The device can be an LED, a buzzer or a TTL logic device. ForTTL
family of 8051 devices the source current is defined in terms of TTL logic. TTL logic has two logic levelsDesigning Embedded Systems with Bbit Microcontrolers—B051 Am
namely logic 1 (High) and logic 0 (Low). The typical voltage levels for logic Low and High is givenin the
following table.
Logic Level Input signal level Output signal level
Min Max Min Max
Low ov sv ov osv sv
His! 2 sv 20V sv a
The logic levels are defined for a TTL gate acting as input and output. For logic 0 the input voltage
level is defined as any voltage below 0.8V and the current is 1.6mA sinking current to ground through
a TTL input. According to the 805/ design reference, the maximum current that a port pin (For an LS
TTL logic based 8051 devices) can source is 60 \1A.
Sink Current It refers to the maximum current that the 805/ port pin can absorb through a device
which is connected to an external supply. The device can be an LED, a buzzer ot a TTL logic device
(For TTL logic based 8051 devices). Pins of Ports Pl, P2 and P3 can sink a maximum current of 1.6
mA. Port 0 pins can sink currents up to 3.2 mA. Under steady state the maximum sink current is limited
by the criteria: Maximum Sink Current per port pin = 10 mA, Maximum Sink current per 8-bit port for
port 0 = 26 mA, Maximum Sink Current per 8-bit port for port 1, 2, & 3= 15 mA, Maximum total Sink
current for all output pin = 71 mA (As per the AT89C51 Datasheet). Figure 5.14 illustrates the circuits
for source, sink and ideal port interfacing for 8057 port pins.
~ 8051
P10
|
sist |
|
uy
P10
vss vss
@ S ©
(@) Current Sourcing, (b) Current Sinking (c) Ideal Port pin interface for 8051
Figure 5.14(a) illustrates the current sourcing for port pins. Since 8051 port pins are only capable
of sourcing less than | mA current, the brightness of LED will be very poor. Figure 5.14(b) illustrates
the current sinking for port pins. In this configuration, the forward voltage of LED while conducting is
approximately 2V and the supply voltage SV (V..) is distributed across the LED and the internal TTL
circuitry. The extra 3V has to be dropped across the internal TTL circuitry and this will lead to high
power dissipation, which in turn will result in the damage of the LED or the port pin. This type of design
isnot recommended in embedded design. Instead the current through the LED is limited by connecting
the LED to the power supply through a resistor as shown in Fig. 5.14(c). In this configuration, the port
pin should be at Logic 0 for the LED to conduct. For a 2.2V LED, the drop across Resistor is calculated
as Supply voltage ~ (LED Forward Voltage + TTL Low Voltage) ~ 5 ~ (2.2 + 0.8) ~ 2.0V. The Resis-
tance value is calculated as 2V / (Required LED Current). Refer LED data sheet for LED current. If the
resistance value is not properly selected, it may lead to the flow of high current through the LED and
may damage the LED.Introduction to Embedded Systems
Design an 8051 microcontroller based system for displaying the binary numbers from 0 to 255 using 8 LEDs as per the
specifications given below:
1, Use Atmel's ATS9CS1/52 or AT89S8252 (Flash microcontroller with In System Programming (ISP) support) for
designing the system.
2. Usea 12MH7z erystal resonator for generating the necessary clock signal for the controller.
3. Use on-chip program memory for storing the program instru
4. The 8 LEDs are connected to the port pins P2.0 to P2.7 of the microcontroller and are arranged in a single row with
the LED connected to P2.0 at the rightmost position (LSB) and the LED connected to P2.7 at the leftmost position
(NSB),
5, The LEDs are connected to the port pins through pull-up resistors of 470 ohms and will conduct only when the
corresponding port pin is at logic 0.
6. Each LED represents the corresponding binary bit of a byte and it reflects the logic levels of the bit through turning
ON and OFF the LED (The LED is turned on when the bit is at logic 1 and off whea the LED isat logic 0).
7. The counting starts from 0 (All LEDs at turned OFF state) and increments by one. The counter is incremented at
the rate of 5 seconds.
8, When the counter is at 255 (OFFH, all LEDs are in the tura ON state), the next increment resets the counter to OOH
and the counting process is repeated
The design of this system has two parts. The first partis the design of the microcontroller based hantware circuit.
‘The hardware circuit part can be wired on a breadboard for simplifying the development. The controller for this can be
chosen as either AT89C51/52 or AT89S8252. Both of these controllers are from the 805/ family and are pin compatible.
Both of them contain built in program memory. The only difference is that for programming the AT89C51/52 device an
EEPROM/FLASH programmer device is required whereas AT89S8252 doesn’t require a special programmer. It can be
programmed through the In System Programming (ISP) utility running ox the firmware development PC and through the
parallel portof the PC. The In System Programming technique for ATS9S8252 is described in OLC. For the controller to
work, a regulated SV de supply is required. For generating a regulated SV lc supply, a regulator IC is used. For the current
design the regulator {C LM780S from National semiconductor is selected. The input voltage required for this regulator
IC is in the range of 9V to 12V de. A wall mounted de adaptor with ratings 9V or 12V, 250mA can be used for supply-
ing the input power. It is better to use a 9V de adaptor to avoid the excessive heating of the regulator IC. Excessive heat
production in the regulator IC leads to the requirement for heat sinks. The circuit details and the components requited to
implement the counter is shown in Fig. 5.15.
‘The circuit shows the minimal components and the interconnection among them to make the controller operational
‘As mentioned earlier, it requires 2 regulated SV de supply for powering the controller. The 12 MHZ exystal resonator in
combination with the external 22 picofarad (pF) capacitors drives the on-chip oscillator unit and generates the required
clock signal for the controller. The RC circuit connected to the RST pin of the controller provides Power-On reset for
the controller. The cepacitor and resistor values arc selected in such a way that the reset pulse is active (high) for at least
2 machine cycle duration. The diode in the reset circuitry is used as freewheeling diode and it is not mandatory. The 0.1
Microfarad (0.1. MFD) capacitor connected to the power supply line filters the spurious (noise) signals from the power
supply line. For proper driving, the LEDs should be connected to the respective port pins through pull-up resistors, The
pull-up resistor values are determined by the forward voltage of LEDs and the current rating of the LEDs. The current
design uses 470 ohms as the pull up resistor. If you are not sure about the forward voltage and current ratings of the LED,
it is better to start with a high value (say 8.2K) for the resistor and replace it with successive low value resistors (4.2 K,
2.7K, 1 K, 870 E, 470 E etc.) tll you feel that the brightness of the LED while itis conducting is reasonably good. The
controller contains on-chip program memory and it can be used for storing the firmware. In order fo use the on-chip pro-
‘gram memory, the EA\ pin should be tied to V7... Pulling the EA\ pin to V’,. through a high value resistor ensures that the
pin draws very minimal amount of current.
‘The second part is the design and development of program code (firmware) for implementing the binary counter and
displaying the counter content using the LEDs interfaced to Port 2. The firmware requirement can be modelled in the
form of a flow chart as given in Fig. 5.16.Designing Embedded Systems with 8bit Microcontrollers—8051 p34)
1N«007
Epes
aay oir 2
25v oaMED
pio 7 veeso
ATS9CSI
ome
ost
FAI
INaI48
14007
82k)
Lars0s
Arsecsi §
ATa9sy252_ LED SV
‘ne
Binary Counter
loXTALL
WeXTALD
20 GND
Fig. 5.18) Binary number display circuit using 8051 and LEDs
1 Initialise Post 2
2. Initialise stack pointer
4. Initialise counter to zero
1. Increment the counter
3. Disable all interrupts (Optional)
Wait for 5 seconds
2. Display the counter content on LEDpil Introduction to Embedded Systems
‘Once the firmware requirements are modelled using the flow chaut, the next step is implementing it in cither proces-
sor specific assembly code or high level language. For the time being let us implement the requirements in 8051 specific
assembly language. The firmware for implementing the binary counter in 805/ assembly language is given below.
ERE E ERATE UT HOUT ETN EHESAEA ER EED AERP AE EEN SEE U SATS BAER HEU EM EAE
;Binary_Counter.sre
;Source code for implementing a binaty counter and displaying the
icount through the LEDs connected to P2.0 to P2.7 port pins
{Tlie LED is turned on when the port line“is at logic 0
The counter value should be complemented to display the count
gusing the LEDs connected at Port 2. Written by Shibu K V
Copyright (c) 2008
FARPRRERERESEOURTEEEESE AUG UE OPI EOR EEO RISES ORE EGR SES HE SE HER EES EERE
‘ORG 00008 2 Reset vector
IMP 00508 } dump to code mem location 0050H
ORG 0003 } External Interrupt 0 ISR location
RETI ; Simply return, ‘Do nothing
‘ORG 60082 } Timer 0 Interfupt TSR location
RETI } Simply return. Do. nothing
ORG 0013H } External Interrupt 1 ISR location
RETI 7 Simply ‘return, Do nothing
oRG 001BK 7 Timer Thterrupt IR location
RETI } Simply return, Do nothing
ORG 00234 } Serial Interrupt ISR location
RETI j Simply return. ‘Do nothing
ORG 00508 2 Start of Program Execution
MOV P2, #OFFH ; Turn off all LEDs
CLR EA } Disable All interrupts
Mov Sr, F08H ; Set stack at memory location 08H
MOV R7, #0OH Set counter Register R7 to zero.
REPEAT: CALL DELAY 7 Wait for 5 seconds
INC P7 } Increment binary counter
MOV A, RT ;
CPL A? The LED's are turned on when corresponding bit is 0
MOV P2, A; Display the count on LEDs connected at Port 2
SMP REPEAT 7 Repeat. counting
PAPEROGSHERSIELEROSEUEROGEEEEOGSEUAODECHADOEESEEO EERIE US EfUE HELENE RD
:Routine for generating 5 seconds delay
jDelay generation is dependent on. clock frequency
#This routine assumes a clock frequency of 12.00MHZ
#LOOPL generates 248 x 2 Machine cycles (496microseconds] delay
LOOP? generates 200 x (4964241) Nachine cycles (99800microseconda)
jdelay. LOOP3 generate 50 x (99800+2+1) Machine cycles
7 (4990150microseconds) delay. The routine generates a-
sprecise delay of 4.99 seconds
PHEREEEDEDED SGEREDEA EAE EERSOEEASEOESERREESEAAEOEOESAEELOO LEEDS EEE EEREDesigning Embedded Systems with bit Microcontrollers—8051 psi
MOV R2,
MOV R1,
RO
Ri, LOOP2
R2, LOOPL
Assembly Program
Once the assembly code is written and checked for syntax errors, it is converted into a controller specific machine
code (hex file) using an assembler program. The conversion can be done using a freely/commercially available assembler
program for 805/ oran IDE based tool (like Keil microvison 3). The final stage is embedding the hex code in the program
memory of the controller. Ifthe controller used is ATS9CSI, the program can be embedded using a FLASH programmer
device. For controllers supporting In System Programming (ISP), like AT89S8252, the hex file can be directly loaded into
the program memory of the controller using an ISP application running on the development PC.
Design an 8051 microcontroller based control system for controlling a SV, 2-phase 6-wire stepper motor, The system.
should satisfy the following:
1. Use Atmel’s AT89CS1/52 or AT89S8252 (Flash microcontroller with In System Programming (ISP) support) for
designing the system.
Use a 12 MHz crystal resonator for generating the necessary clock signal for the controller.
Use on-chip program memory for storing the program instructions,
‘The wires of the stepper motor are marked corresponding to the coils (A, B, C & D) and Ground (2 wires)
Use the octal peripheral driver IC ULN2803 from National semiconductors for driving the stepper motor.
Step the motor in ‘Full step’ mode with a delay of 1 sec between the steps.
7. Connect the coil drives to Port | in the order Coil A to P1.0, Coil B to PI.1, Coil Cto P1.2, and Coil D to P1.3
Refer to the description on stepper motors given in Chapter 2 to get an understanding of unipolar stepper motors and the
coil energising sequence for ‘Full step’ mode.
Figure 5.17 illusirates the interfacing of stepper motor through the driver circuit connected to Port 1 of 8051
The flow chart given in Fig, 5.18 models the firmware requirements for interfacing the stepper motor.
From the pulse sequence for running the stepper motor in ‘Full step’ it is clear that the pulse sequence for next step
is obtained by right shifting the current pulse sequence. The initial pulse sequence required is H, H, L, L at coils A, B,
C & D respectively (Please refer to the stepper motor section in Chapter 2). In our case we have only 4 bits to shift and
our controller isan Sbit controller, Performing a right shift operation of the accumulator moves the LS bit of accumulator
to the MS bit position (Bit position 7 in 0-7 numbering). We want the LS bit to be available at 3* bit position after each.
rotation. This can be achieved by some bit manipulation operation. We can also achieve itby loading the MS nibble of ac-
ccumutator with the same initial sequence HHLL. In this example we arenot using Port P! for any other operation. Hence
the values of port pins PI.4 to PI.7 are irrelevant in our case. But in real life scenario it may not be the case always. The
firmware implementation for this is given below:Introduction to Embedded Systems
IMF
a
oxst t
bon———
IN ge EA's eR:
14007 821 : |
x IN |
xm 73 SINS uLszan
3}___ans
Ltisxtai2 Fg
| mA ain
5 1
2 on
2 inmos 2+; ;
cp | enw 4
g
1. Initialise Port PI to OOH to disable
current flow through all coils
2. Initialise stack pointer
3. Load accumulator with the pulse
sequence for first rotation
Output accumulator content to Port P1
Rotate Accumulator to Right
Wait for 1 second
‘Flow chart for Implementing Stepper Motor InterfacingDesigning Embedded Systems with 8bit Microcontroliers—8051
SEEPHREREUOUSSQUSUREPEATO EEA ERERE EAS RIGUESHO REEL RS EURE EYES PEER EER RE RE
Stepper_motor.erc. Pirmware for Interfacing stepper motor
The stator coils A, B, C and Dare controlled through Port pins P1.0,
;P1.1, P1.2 and P1.3 respectively.
jAccumulator is used for generating the pulse sequence for ‘Fullstep’
iThe initial pulse sequence is represented by OCH
iWritten & Compiled for A51 Assembler. Written by Shibu K V
Copyright (C) 2008
jPetteeeaeneesavetrnedateenseeeteeneetereeseccetensteerraresretsa tree
oR 00008 2 Reset vector
SMP 01008 7 Jump to code mem location 0100H to start-
oRG 00038 } External Interrupt 0 ISR location
RETI } Simply return. Do nothing
ORG 0O0BH ; Timer 0 Interrupt ISR location
RETI ; Simply return. Do nothing
ORG 00138 External Interrupt 1 TSR location
RETI } Simply return. Do nothing
ORG OOLBH } Timer 1 Interrupt ISR location
RET! } Simply return, Do nothing
ORG 0023H } Serial Interrupt ISR location
RETI ? Simply return. Do nothing
[PEVOREREOREROLOEOSELOYSHE RGU CUR EaNESEEERE ESSE ROSES AUER ERERE EER OR EE
} Start of main Program
ORG 0100H
MOV Pl, #00H ; Turn off the drives to all stator coils
MoV SP, #08H ; Set stack at memory location 08H
MOV A, #0CCH Load the initial pulse sequence
REPEAT: MOV Pl, A Load Port Pl with pulse sequence
RR A } Rotate Accumalator to right
CALL DELAY 2 Wait for 1 second
UMP REPEAT } Load Port P1 with new pulse sequence
SHOP ORER OPERAS NGA PATHS HEHE HEE HEHEHE EE RL RA RE RE EME A EERIE aH FERN EES He EE
jRoutine for generating 1 second delay
:Delay generation is dependent on clock frequency
iThis routine assumes a clock frequency of 12.00MHz
;LOOP1 generates 248 x 2 Machine cycles: (496microseconds) delay
:LO0P2 generates 200 x (4964241) Machine cycles (99800microseconda)
idelay. LOOP3 generate 10 x (99800+2+1) Machine cycles
;(998030microseconds) delay. ;The routine generates a~
i precise delay of 0.99 seconds
FPSPRRRERLDER EGP RLESELEUEER USES OS HEHE EO AA EU EURO REREAD EON EEE EERE EERE
DELAY: MOV R2, #10
LOO?1: MOV RL, #200
10072: MOV RO, #248
100P3: DINZ RO, 10073
DINZ R1, LOOP2
DINZ R2, LOOPL
RET
END ;END of Assembly Program
i)Introduction to Embedded Systems
Design an 805/ microcontroller based system for interfacing the Programmable Peripheral Interfece (PPI) device 8255.
‘The system should satisfy the following:
1, Use Atmel’s AT89CS51/S2 or AT89S8252 (Flash microcontroller with In System Programming (ISP) support) for
designing the system
2. Use a 12 MHz crystal resonator for generating the necessary clock signal for the controller. Use on-chip program
‘memory for storing the program instructions
3. Use Intersil Corporation's (wwww.intersil.com) $2C5SA PPI device
4, Allocate the address space 8000H to FEFFH to 8255. Initialise the Port A, Port Band Port C of 8255 as Output ports
in Mode
Here we are allocating the address space 8000H to FFFFH to 8255. Hence the 8255 is activated when the 15% bit of
address line becomes 1. Here we have to use a single NOT gate to invert the A15 line before applying itto the Chip Select
(CS\) line of 8255. In this configuration 8255 requires only four address space namely 8000H for Port A, 8001H for Port
B, 8002H for Port C and 8003H for the Control Register. Rest of the address space 8004H to FFFFH is left unused. Here
‘we have the luxury of using the entire address range since we don’t have any other devices to connect. In real life appli-
cations it may not be the case. We may have multiple devices sharing the entire address space 0000H to FFFFH and we
need to select each device in their own address space, In such scenarios the address lines A2 to A15 needs to be decoded
using a combination of logic gates (NAND, AND, NOT, OR, NOR) and decoders. Figure 5.19 illustrates the interfacing
of 8255 with 8051.
ee a as
+p {2 Lmmes 2
eld Loa! Lewd,
sv ~] [omen |? L ‘i
a 7
sts
oRst WR: agway
Nga
nano A 8:2
——n
mp Pale C55,
WoxTALL ad Ri |
RS i
iwxtaia 4 1) vans |
ma i |
mi H
sams ees
t206ND, Pog Dore t
DpF =, Sern LEPC? 9 204} Ao Fin? 7 GND J
PF |
: y
Intertncing £255 PPE with 8051
Jen
SMB Ey
3108 Devoder lofice f= Vee
2 LSS
Ais |yesp. uveDesigning Embedded Systems with bit Microcontrollers—8051 push
‘The Octal latch 74L$373 latches the lower order address bus (A0-A7) which is multiplexed with the data bus (D0-
D7). A3 to8 decoder chip, 74LS138, decodes the address bus to generate the Chip Select (CS\) signal for $255. Here we
have only one address line (A15) to decode. The rest of the 2 input lines to the decoder (Pins 2 & 3) are grounded. Our
intention is to assert the CS\ signal of 8255 when A15 line is 1. The /p condition corresponds to this is 001. The decoded
output for this is Output 1 (¥1). You can replace the decoder with a NOT Logie IC. The reset line of 8255 is controlled
through port pin PI.0. The Reset of 8255 is active high and when 805/ is initialised, the port pin P1.0 automatically
‘generates a reset high signal for 8255.
The flow chart given in Fig. 5.20 models the firmware requirements for interfacing 8255 with 805/ controller.
T- Reset PLO tohold the RESET line of 4255 inactive
2. Initialise Stack Pointer
3. Load Accumulator with the control word for configuring
8255 Pons,
4. Load DPTR with the address of 8255 control register (8003H)
5. Write the control word to 8255 Cantrol Regster
Flow chart for Interfacing 8255 with 8051
The control word for configuring all the §255 ports as output ports in mode 0 is shown below. Please refer to the
section on Programmable Peripheral Interface (PPI) given in Chapter 2 for more details on 8255's control register.
D7 D6 Ds Da D3 D2 DI po
1 0 0 0 0 0 0 0
The firmware implementation for this is given below. :
PEPER EES EEG EPO EET EE EST UE EEE ETE EU EYE ATE EEE UED EAP POD PLEATED ER EEE
78255.sre, Firmware for Interfacing 8255A PPT
78255 is memory mapped at 8000H to FFFFH. The address assignment for
svarious port and control register are: Port A: 8000H,
Port B : 8001H, Port C : 8002H, Control Register : 8003H
pReset of 8295 is controlled through P1.0 of 8051
led for ASL Assembler. Written by Shiby K V
(c) 2008
FEERPRRSESAEAHRRER EEE RER SH SOER ERE EUR SEAT URER ERR AD REE RIERER RHEE
‘ORG 00008 j Reset vector
IMP MAIN j Jump to the address location pointed by
j the Label ‘MAIN’ to start execution
ORG 00038 External Interrupt 0 ISR location
RETI y return. Do nothing
ORG 000BH nterrupt ISR location
RETI ; Simply return. Do nothing
ORG 00138 External Interrupt 1 ISR location
Simply return. Do nothing
RG Timer 1 Interrupt ISR location
Simply return. Do nothingE Introduction to Embedded Systems
ORG 00238 F seris:
RETI sim
pPeARRAREHER HEHEHE HEHE ERE EE
7 Start of main Prog:
MAIN: CLR P1.0
MOV
PeePeREURHSE ORES
END
5.3.6 Interrupts
Before going to the details of 805/ interrupt system, let us have a look al
interrupts work in microprocessor/controller systems.
lerrupt
general and how
5.3.6.1 What is Interrupt? As the name indicates, interrupt is something that produces some kind
of interruption. In microprocessor and microcontroller systems, an interrupt is defined as a signal that
initiates changes in normal program execution flow. The signa! that generates changes in normal pro-
‘gram execution flow may come from an external device connected to the microprocessor/controller,
requesting the system that it needs immediate attention or the interrupt signal may come from some of
the internal units of the processor/controller such as timer overflow indication signal. The first type of
interrupt signals are referred as external interrupts,
5.3.6.2 Why Interrupts? From programmer point of view interrupt is a boon. Interrupts are very
useful in situations where you need to read or write some data from or to an extemally connected device.
Without interrupts, the normal procedure adopted is polling the device to get the status. You can write
your program in two ways to poll the device. In the first method your program polls the device continu-
ously till the device is ready to send data to the controller or ready to accept data from the controller.
This technique achieves the desired objective effectively by sacrificing the processor time for that single
task. Also there is a chance for the program hang up and the total system to crash in certain situations
where the external device fails or stops functioning. Another approach for implementing the polling
techniques to schedule the polling operation on a time slice basis and allocate the total time on a shared
basis to rest of the tasks also. This leads to much more effective utilisation of the processor time. The
biggest drawback of this approach is that there is a chance for missing some information coming from
the device if the total tasks are high in number. Your device polling will get another chance to poll the
device only after the other tasks are done at least once.
Here comes the role of interrupts. If the external device supports interrupt, you can connect the inter-
rupt pin of the device to the interrupt line of the controller. Enable the corresponding interrupt in firm-
ware, Write the code to handle the interrupt request service in a separate function and put the other tasks
in the main program code. Here the main program is executed normally and when the external device
asserts an interrupt, the main program is interrupted and the processor switches the program execution
to the interrupt request service. On finishing the execution of the interrupt request service, the program
flow is automatically diverted back to the main stream and the main program resumes its execution
exactly from the point where it got interrupted.Designing Embedded Systems with ébit Microcontrollers—8051
nterrupts are mainly used for accom-
5.8.6.3 Use of Interrupts In any interrupt based systems,
plishing the following tasks:
1, V/O data transfer between peripheral devices and processor/controller
2. Timing applications
3. Handling emergency situations (e.g. switch off the system when the battery status falls below the
critical limit in battery operated systems)
4, Context switching/Multitasking/Real-Time application programming
5. Event driven programming
5.3.7 The 805] Interrupt System
Thope by now you got reasonably good information on interrupts and interrupt handling. Now let us
move on to the interrupt system of 805/ microcontroller. The basic 805/ and its ROMless counterpart
8031AH supports five interrupt sources; namely two external interrupts, two timer interrupts and the se-
rial interrupt. The serial interrupt is an ORed combination of the two serial interrupts; Receive Interrupt
(RD) and Transmit Interrupt (TD).
§.3.7.1 Enabling Interrupts The interrupt system of 805/ can be enabled or disabled totally under
software control. This is achieved by setting or clearing the globel interrupt enable bit of the Special
Function Register Interrupt Enable (IE). Also, each interrupt can be enabled or disabled individually by
setting or clearing the corresponding interrupt enable bit in the SFR Interrupt Enable.
Interrupt Enable (IE) (SFR-A8H) The bit details of the Interrupt Enable Register is given below:
1E.7 1E.6 IES Es IE3 1E2 TE. 1E0
EA RSD RSD ES ETl EX! ETO EXO
The table given below explains the meaning and use of each bit.
Bit Name
EA Enable All EA = 0 disable all interrupts. EA = 1 enable all interrupts, which are individually
enabled by setting their comesponding enable bit in Interrupt Enable SFR.
RSD Reserved Unimplemented. Reserved for future use
ES Enable Serial ES ~ 1 enables Serial Interrupt. ES ~ 0 disables it
ETI Enable Timer! ETI = 1 enable Timer! Interrupt. ET = 0 disables it
EX! Enable External | EX1 = | enable External Interrupt 1. EX1 =0 disables it
ETO | Eaabie Timer) ETO“1 enable Timerd Imertupt, ETO=0 disables it
EX0 Enable External 0 EXO=I enable External Interrupt 0. EXO = 0 disables it
The following code snippet illustrates the enabling of Timer 0 interrupt and disabling of all other
interrupts.
ORL 16, #100000
Set b.
bits
ANL IE, #1110Ey Introduction to Embedded Systems
The instruction ORL /E, #10000010B sets the global interrupt enabler bit EA(IE.7) and the Timer 0
Interrupt enabler bit ETO (IE.1). The status of all other bits in the IE register is preserved. The instruc
tion ANL JE, #11100010B preserves the status of the global interrupt enabler bit £4(/E.7), the RSD (IE.6
& JE.5) bits and the Timer 0 Interrupt enabler bit £70 (IE. |) and resets the Serial interrupt enabler bit
ES(E.4), Timer 1 Interrupt enabler bit ET! (/E.3), External Interrupt | enabler bit EX/ (IE.2) and Ex-
ternal Interrupt 0 enabler bit EXO (7E.0). This ensures that the reserved bits RSD (1E.6 & IE.5) are left
untouched. The same can also be achieved by individually setting or clearing the corresponding bits of
IE register using SETB and CLR instructions. This requires more number of instructions to achieve the
result.
Note: Though the corresponding interrupt bits are ‘set’ in the IE register, the Interrupts will not be en-
abled and serviced if the global interrupt enabler, EA bit of the Interrupt Enable Register (IE) is 0.
5.3.7.2 Setting Interrupt Priorities In a Real World application, interrupts can occur at any time
(asynchronous behaviour) and different interrupts may occur simultaneously. This may confuse the pro-
cessor on deciding which interrupt is to be serviced first. This arbitration problem is resolved by setting
interrupt priorities. Interrupt priority is configured under software control. The Special Function Regis
ter Interrupt Priority (IP) Register is the one holding the interrupt priority settings for each interrupt.
Interrupt Priority Register (IP) (SFR-B8H) The bit details of the Interrupt Priority Register is ex-
plained in the table below.
17 1P6 IPs 1P4 1P3 1P2 IP. 1P0
RSD RSD RSD. PS Pri PXI Pro PXO
The table given below explains the meaning and use of each bit in the IP register.
Bit Name Description
RSD Reserved Unimplemented, Reserved for future use
Ps Serial interrupt priority PS = | sets priority to Serial Interrupt
PTL Timer | interrupt priority PTI = | sets priority to Timer! Interrupt
PX1 External 1 interrupt priority PXi = 1 sets priority to External Interrupt 1
PTO Timer 0 interrupt priority PTO = 1 sets priority to Timer 0 interrupt
PXO External ( interrupt priority EXO = 1 sets priority to External interrupt 0
The interrupt control system of 805/ contains latches to hold the status of each interrupt. The status
of each interrupt flags are latched and updated during SSP2 of every machine cycle (Refer to machine
cycles for information on $5P2). The latched samples are polled during the following machine cycle.
If the flag for an enabled interrupt is found to be set in SSP2 of the previous cycle, the interrupt system
transfers the program flow to the corresponding interrupt’s service routine in the code memory (Pro-
vided none of the conditions described in section “Different conditions blocking an interrupt” blocks the
vectoring of the interrupt). The Interrupt Service Routine address for each interrupt in the code memory
is listed below.
Interrupt number Interrupt source ISR Location in code memory
0 Extemal interrupt 0 0003H
1 ‘Timer 0 interrupt 000BHDesigning Embedded Systems with 8bit Microcontrollers—8051 Ee,
2 Extemal interrupt 1 0013H
3 Timer 1 interrupt o01BH
4 Serial interrupt 00231
It is to be noted that each Interrupt Service Routine (ISR) is allocated 8 bytes of code memory in the
code memory spi
From the IP Register architecture it is obvious that each interrupt can be individually programmed to
one of two priority levels by setting or clearing the corresponding priority bit in the Interrupt Priority
Register. Some general info on 805/ interrupts is given below:
1. If two interrupt requests of different priority levels are received simultaneously, the request of
higher priority interrupt is serviced.
2. If interrupt requests of the same priority level are received simultaneously, the order in which the
interrupt flags are polled internally is served first. First polled first served. (Also known as internal
polling sequence.)
A low-priority interrupt can always be interrupted by a high priority interrupt.
A low-priority interrupt in progress can never be interrupted by another low priority interrupt.
A high priority interrupt in progress cannot be interrupted by a low priority interrupt or an
interrupt of equal priotity.
5.3.7.3 Different conditions blocking an Interrupt It is not necessary that an interrupt should
beserviced immediately on request. The following situations can block an interrupt request or delay the
servicing of an interrupt request in 8051 architecture.
1. All interrupts are globally disabled by clearing the Enable All (EA) bit of Interrupt Enable regis-
ter.
2. The interrupt is individually disabled by clearing its corresponding enable bit in the Interrupt
Enable Register (IE).
3. An interrupt of higher priority or equal priority is already in progress.
4. The current polling machine cycle is not the final cycle in the execution of the instruction in
progress (To ensure that the instruction in progress will be completed before vectoring to the inter
tupt service routine. In this state the LCALL generation to the ISR location is postponed till the
completion of the current instruction).
5. The instruction in execution is RET! or a write to the IE/IP Register. (Ensures the interrupt related
instructions will not make any conflicts).
In the first three conditions the interrupt is not serviced at all whereas conditions 4 and 5 services the
interrupt request with a delay.
5.3.7.4 Returning from an Interrupt Service Routine An Interrupt Service Routine should end.
with an RETI instruction as the last executable instruction for the corresponding ISR. Executing the
RETI instruction informs the interrupt system that the service routine for the corresponding interrupt
is finished and it clears the corresponding priority-X (X=1 High priority) interrupt in progress flag by
clearing the corresponding flip flop. This enables the system to accept any interrupts with low priority
or equal priority of the interrupt which was just serviced. Remember an interrupt of higher priority can
always interrupt a lower priority even if the corresponding priority's interrupt in progress flag is set.
Executing the RETI instruction POPs (retrieves) the Program Counter (PC) content from stack and the
program flow is brought back to the point where the interruption occurred.pis Introduction to Embedded Systems
In operation, RET! is similar to RET where RETI indicates return from an Interrupt Service Routine
and RET indicates return from a normal routine. RETI clears the interrupt in progress flag as well as
POPs (retrieves) the content of the Program Counter register to bring the program flow back to the point
where it got interrupted. RET instruction only POPs the content of the Program Counter register and
brings the program flow back to the point where the interruption occurred.
Will a non serviced Interrupt be serviced later? This is a genuine doubt raised by beginners in
the 805/ based system design. The answer is “No’. Each interrupt polling sequence is « new one and it
happens at S5P2 of cach machine cycle. If an interrupt is not serviced in a machine cycle for the reason
that it occurred simultaneously with another high priority interrupt, will be lost. There is no mechanism
in place for holding the non serviced interrupts in queue and marking them as pending interrupts and
servicing them later.
5.3.7.5 Priority Levels for 8051 Interrupts By default the 805/ architecture supports two levels
of priority which is already explained in the previous sections, The first priority level is determined by
the settings of the Interrupt Priority (IP) register. The second level is determined by the internal hard-
ware polling sequence. The intemal polling sequence based priority determination comes into action if
two or more interrupt requests of equal priority occurs simultaneously. The internal polling based prior-
ity within the same level of priority is listed below in the descending order of priority.
Interrupt Priority
External interrupt 0 HIGHEST
Timer 0 overflow interrupt
Siena ep |
‘Timer 1 overflow interrupt
Serial interrupt LOWEST
5.3.7.6 What Happens when an Interrupt Occurs? On identifying the interrupt request num-
ber, the following actions are generated by the processor:
1. Complete the execution of instruction in progress.
2. The Program Counter (PC) content which is the address of the next instruction in code memory
which will be executed in normal program flow is pushed automatically to the stack. Program
Counter Low byte (PCL) is pushed first and Program Counter High (PCH) byte is pushed next.
3. Clear the corresponding interrupt flags if the interrupt is a timer or extemal interrupt (only for
transition activated (edge triggered) configuration).
4, Set interrupt in progress flip flop.
Generate a long call (LCALL) to the corresponding Interrupt Service Routine address in the code
memory (Known as vectoring of interrupt).
5.3.7.7 Interrupt Latency _In the 8051 architecture, the interrupt flags are sampled and latched at
S5P2 ofeach machine cycle. The latched samples are polled during S5P2 of the following machine
cycle to find out their state. If the polling process identifies a priority interrupt flag’s flip flop as set,
an LCALL to its [SR location is generated (If and only if none of the conditions listed under the topic
“Different conditions blocking an interrupt” blocks it). Interrupt latency is the time elapsed between
the assertion of the interrupt and the start of the ISR for the same.Designing Embedded Systems with 8bit Microcontroliers—8051
Interrupt
ta
Interrupt Latency
Interrupt latency is highly significant in real-time applications and is very crucial in time-critical
applications. Interrupt latency can happen due to various reasons. For external interrupts there is no
synchronisation with the system (asynchronous in behaviour) and so it can occur at any point of time.
But the processor latches each interrupt flag only at SSP2 of each machine cycle. So there is no point
even if the interrupt occurs at S1P1 of the machine eyele. It is latched only at SSP2 of the current ma-
chine cycle and the latched interrupts flags are polled at SSP2 of the following machine cycle and an
LCALL is generated to the corresponding ISR, if no other conditions block the call. So this delay itself
contributes a significant part in interrupt latency. Even if the ISR is entered some delay can be happened
by the number of register contents to be stored (PUSH instructions) and other actions to be taken before
executing the ISR task. The interrupt latency part which contributes the delay in servicing the ISR is the
sum of the following time delays.
Time between the interrupt assertion to the start of state S5 of current machine cycle (polling cycle)
+ (Time for 5 & S6) + Remaining machine cycles for the current instruction in execution (The current
execution should not be RETI or instructions accessing registers IE or IP, ifso there will be an additional
delay of the execution time for the next instruction) + LCALL generation time. The LCALL generation
time is 12 T States (2 Machine cycles).
If the current machine cycle (the polling cycle) is the last cycle of the current instruction in execution
and the current instruction in execution is other than RETI or instruction accessing IE or IP register, the
interrupt vectoring happens at the shortest possible time and it is given as
Time between the interrupt asserted to start of state $5 of current machine cycle (polling cycle)
+ (S5+S6T state + 12 clock)
= Time between the Interrupt Asserted to the start of state $5 + (((1+1+12) x 2)/f,,.) seconds.
(I Tstate =2 clock cycles and 1 clock cycle = I/f,,.)
The minimum time required to identify an interrupt by the system is one machine cycle, i.e. if an
interrupt occurs at $5 of a machine cycle, it is latched and it is identified as an interrupt at state SS
of next machine cycle (Polling eyele). Hence the minimum time from interrupt assertion to S5 of the
polling machine cycle is 1 machine cycle (12 clack periods). The maximum time required to identify
an interrupt by the system is approximately 2 machine cycles. Assume the interrupt is asserted at state
$6 of a machine cycle, it is latched at $5 of next machine cycle and the latched value is polled at S5 of
next machine cycle. Hence the minimum time between the “Interrupt Asserted’ to state $5 of the current
machine cycle (polling cycle) is 6 T States (1 machine cycle). That means State S6 of previous machine
cycle to state $5 of current machine cycle, Hence the minimum acknowledgement time will be 20 T
States (Since | machine cycle = 6 T states. The approximate response delay will be 3 machine cycles).
3 machine cycles is the minimum response delay for acknowledging an interrupt in a single inter
rupt system. There may have additional wait times which come as an addition to the minimum responseES. introduction to Embedded Systems
delay, depending on some other conditions. If you look back to the section “Different conditions block-
ing an Interrupt” you can see that if the current machine cycle when the interrupt asserted (The machine
cycle at which the interrupt is latched) is the last machine cycle of the current instruction in progress, the
interrupt vectoring will happen only after completing the next instruction. If the instruction in progress
is not in its final machine cycle, the maximum additional waiting (waiting time excluding the LCALL
generation time) time required to vector the Interrupt cannot be more than 3 machine cycles since the
longest instructions MUL AB and DIV AB are 4 cycle instructions. If the instruction in progress is a
RET instruction or any access to IP or IE register then also the vectoring of the interrupt service routine
will be delayed till the execution of next instruction. If the next instruction following the RETI or IP/E
register related instruction is MUL AB or DIV AB, the additional wait time will be 5 machine cycles
(RET! and IP/IE related instructions are 2 machine eycle instructions).
In brief. the response time for interrupt in 8051 system is always more than 3 machine cycles and less
than 9 machine cycles.
5.3.7.8 Configuring External Interrupts 8051 supports two external interrupts, namely, Exter-
nal interrupt 0 and External interrupt I. These are hardware interrupts. Two port pins of Port 3 serve the
purpose of external interrupt input line. External interrupts are usually used for connecting peripheral
devices. The external interrupt assertion can be either level triggered or edge wiggered depending on
the external device connected to the interrupt line. From the 805/ side it is configurable and the con-
figuration is done at the SFR Timer/Counter Control Register (TCON). Bits TCON.0 and TCON.2 of
TCON register configures the same for External Interrupt 0 and | respectively. TCON.0 is also known
as interrupt O type control bit (IT). Setting this bit to 1 configures the external interrupt 0 as falling edge
triggered, Clearing the bit configures the extemal interrupt 0 as low level triggered. Similarly, TCON.2
is known as Interrupt 1 type control bit (IT1). Setting this bit to | configures the external interrupt 1 as,
falling edge triggered. Clearing this bit configures the external interrupt I as low level triggered.
For external interrupts, the interrupt line should be asserted by the externally connected device toa
minimum time period of the interval between two consecutive latching, i.e. S6P1 of previous machine
cycle to $SP2 of current machine cycle (1 Machine cycle). Otherwise it may not be identified by the pro-
cessor (Only interrupts which are found asserted during the latching time (SSP2) will be identified).
5.3.7.9 Single Stepping Program with the Help of External Interrupts Single stepping is
the process of executing the program instruction by instruction. This can be achieved with the help of
the external interrupt 0 or 1 and a small firmware modification, This works on the basic principle that
an interrupt request will not be acknowledged if an interrupt of equal priority is in progress and if the
instruction in progress when the interrupt is asserted is # RETI instruction, the vectoring will happen
only after executing an instruction from the main program, which is interrupted by the interrupt. If the
external interrupt is in the asserted state, the interrupt vectoring happens after executing one instruction
from the main program. This execution switching between the main program and ISR can be achieved
by a simple ISR firmware modification. Connecting a push button switch to the external interrupt line
0 through a resistor is the only hardware change needed for a single step operation (Fig. 5.22). Config-
ure INTO as level triggered in firmware. Activating the push button asserts the INTO interrupt and the
processor starts executing the ISR for interrupt 0. At the end, the ISR waits for a | to 0 transition at the
INTO line that asserts the external interrupt 0 again. The next instruction that is going to be executed on
asserting the INTO is RE7/ and according to the general interrupt vectoring principle the processor will
go back to the point in the main code where it got interrupted and after completing one instruction it will
again come back to the INTO ISR. This process is repeated.Designing Embedded Systems with 8bit Microcontrollers—8051 Ei,
Single stepping can also be done with external inter-
rupt 1. Make external interrupt 1 as level triggered and
connect the hardware set up to pin P3.3 (external inter-
rupt I line) and modify the ISR for external interrupt 1 | =
as explained for external interrupt 0 ISR. It will work | °
fine. Single stepping is a very useful method in debug- 12 INTO\+
ging the application. It gives an insight into the various |
effects produced by the execution of an instruction, like f Push button
registers and memory locations modified as a result of 20 GND|
the execution of an instruction. =
icy ae toe nin ciple
‘Example 1 program with external interrupt
Design an 805/ microcontroller based data acquisition system for interfacing the Analog to Digital Converter ADC.
ADCO801 from National semiconductors. The system should satisfy the following:
1. Use Atmel’s AT89C51/52 or ATS9S8252 (Flash microcontroller with In System Programming (ISP) support) for
designing the system. Use a 12MHZ erystal resonator for generating the necessary clock signal for the controller.
Use on-chip program memory for storing the program instructions.
‘The data lines of the ADC is interfaced to Port 2 of the microcontroller. The control signals (RD\, WR), CS\) to the
ADC is supplied through Port 3 pins of microcontroller.
3. The Analog voltage range for conversion is from OV to §. The varying analog input voltage is generated from the
5V supply voltage (Vc) using a variable resistor (Potentiometer). The ADC asserts its interrupt line to interrupt the
microcontroller when the AD conversion is over and data is available at the ADC data port.
4. ‘The microcontroller reads the data on receiving the interrupt and stores it in the memory. The successive data con-
version is initiated after reading the converted data for a sample. Only the most recent 16 samples are stored in the
microcontroller memory.
‘This example is a good starting point for a discussion on data converters and their use in embedded applications. The
processing/controlling unit (The core of the embedded system) of every emivedded system is made up of digital systems
and they work only on digital data. The processor/controller is capable of dealing with binary (digital) data only. As men-
tioned in the beginning, embedded systems are in constant interaction with the real world through sensors and actuators.
In most of the situations, the signals which are handled by embedded systems fall into the category ‘analog’. Analog
tions include
ignals are continuous in nature. Most of the embedded systems use
the monitoring or control of at least one analog signal. The thermocouple-based temperature sensing system used in in-
Tuer A 82k a |
man-—————kntm yy
pee ADCO8OL 2
+{iextans 2D
rt i‘ 10K
isxTaa Mm cin
ISDBy RING
: P2122 17D) 6 1500F
289NP peat Ike
Schmitt Trigger Circuit
In the current design, a potentiometer is used for varying the voltage from OV to SV. The data lines of the ADC are
interfaced to Port 2 of the controller. The control signals to the ADC are supplied through the pins of Port3. Port Pin P3.3
supplies the Chip Select (CS\) signal and Port Pin P3.0 supplies the RD\ Signal to the ADC. The WR) signal to ADC is130 Introduction to Embedded Systems
supplied through Port Pin P3.1. The INTR\ signal line of ADC is interfaced to the External Interrupt 0 (INTO\) line (Port
Pin P3.2) of 8051. The flow chart given in Fig. 5.25 illustrates the firmware design for the system.
’
ADC main routine
start
1. Initialise Port 2 es lip port
2. Initialise stack pointer
3. Disable all Interrupts (Optional)
1. Select the ADC chip
2. Clear the interrupt line of ADC
3. Deselect ADC chip
4, Set the counter for sample counting
5. Select the start address of storage
‘memory forstoring the frst sample
1, Set External 0 Interrupt as level
triggered
2. Enable interupts and EXTO Interrupt
3. Select the ADC
4. Assent the Start of Conversion signal
Wait forever
Flow chart for interfacing ADC0801
The firmware for interfacing the ADC in 8051 Assembly language
Extemal interrupt 0
routine
1. Read the data from ADC
2, Store the read data in memory location
3. Reset the ADC interrupt
4, Deselect the ADC chip
5. Decrement the counter and reset the
memory location to store the next sample
to the start address of storage memory if
the counter value is zero
6. If the decremented counter value is non-
zero increment the memory location to
store the next sample
ee
1. Reset the EXTO Flag
2, Select the ADC chip
3. Assert Start of Conversion signal
iven below.
FROPECAPU FEDS ER AGUEEHOR EE DUG ECP RIRUSERE SOEE EES PRELHELEALEREG EER EE ALES
jade080i_ int
ADC — £081
FADE Dat
S\ 3P3.3; RD\ > 7 WR\ > P
Written by Shibu K Vv, Copyright
crupt.src. Firmware for interfacing Al
nysical Interface detaile
lines connected to Port B2 of 8051
INTR\ >
2008
C801) with 8051
+2 GNT0\)
ry ed
ORG 0000H Reset. vector
oMP 0050# } Jump to Start of main program
‘ORG 00038 } External Interrupt 0 ISR iocation
The ISR will not fit in 8 bytes size.
Hence it is implemented as separate routine
CALL EXTERNAL INTRO ; Function implementing sxtnl 9
RETI 7 ReturnDesigning Embedded Systems with 8bit Microcontrollers—8051
ORG 000BH j Timer 0 Interrupt ISR location
RET ; Simply return. Do nothing
ORG 00138 j External Interrupt 1 ISR location
RET Simply return. Do nothing
ORG 001BH Timer 1 Interrupt ISR location
RETI Simply return. Do nothing
one 00238 j Serial Interrupt 162 locetion
REIT ; Simply return. Do nothing
THRDOUAIAUUNSEUGUEUGLEUESEUEA HOO GEGORAGEOIAEEUAOEHHAEEUSEREREEHEEDENE
ORG 00508 7 Start of main Program
Mov P2, $0FFH
Mov SP, #06H
Configure Port? as input Part
Set stack at memory location 08H
CLR P3.3 3 Select ADC
CLR P3.0 7 Clear ADC interrupt line by asserting ADC
3 RD\
SETB P3.3 3 De-select ADC
Mov RO, #16 ; Set the counter for 16 samples
Mov Ri, #20H 7 Set start of sample storage menloc as 20H
CLR ITO } Set External Interrupt 0 as low-level
3 triggered
MO/ IE, #10900001b > Enable only External 0 interrupt
cuR P34 2 Select ADC
cuR P3.1 + Trigger ADC Conversion; Reset ADC SAR
NOP ; Hold the WR\Signal low for 2 machine cycles
NoP
SETB P3,1 Toggle WR\ line from 0 to 1 to initiate-
+ conversion
IMP $ 3 Loop for ever
AAA HEHE GEE HE
; Routine for handling External 0 Interrupt
; External 0 Interrupt is asserted when ADC finishes data conversion
HPRERES RIA TERSESEOROR ATOR IEOE TREE RE TSRL EERIE SCHEER ES RAE HEE FEET REE
EXTERNAL_INTRO:
RETURN:
MOV @RI, PZ
CLR P3.0 Assert RD\ Signal to clear INTR\ ADC Signal
line
NOP
Nop
SETB P3.0
SETB P3.3 + De-select ADC
DINZ RO, RETURN
; The 16 samples are taken
7 overwrite the provious samples with now
MOV Rl, #1FH ; 20H is the mem loc holding the start of sample
MOV RO, #16 —; Reload Sample counter with 16
INC RL ; Increment mem loc to hold next sample
CLR IEO 3 Clear the interrupt 0 edge detect flag
CLR P3.3 3 Select ADCaa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.aa
You have either reached a page that is unavailable for viewing or reached your viewing limit for this
book.error 351
NETCF 650
wire 49
7-Segment LED Display 36
8051 92,164
Addressing Mode 98, 165
Direct 97, 168
Immediate addeessing 167
Indexed addressing 167
Indirect 165
Register Addressing 166
Architecture 94
Arithmetic Instruction 177
‘Addition 178
Decimal Adjust 184
Decrement 184
Division 180
Increment 183,
Multiplication 180
Subtraction 178
BitAdcressing 99
Clock Speed 105
Crystal Rescnator 104
DAA instruction 184
Data Memory 95
Execution Speed 105
High Speed Core 153,
Instruction Set 171
‘Arithmetic Instructions 177
Boolean instruction 190
Data Transfer Instructions 171
Logical Instruction 185
Program Control Transfer. 193
Interrupt System 121
External Interrupts 125
Interrupt Enable Register 121
Interrupt Lateney 124
Interrupt Priorities 122
Interrupt Service Routine 123
IPRegister 122
RETI instruction 123
IRAM 102
LCALL Instruction 124
Logical Instructions 185
ANL 187
CLRA 188
CPLA 188
ORL 188
Rotate Instruction 188
SWAPA Instruction 190
XRL 188
Machine Cyele 105
MOVC Instruction 177
MOVX Instruction 175
Oscillator Unit Lod
Paged Data Memory Access 98
POPInstruction 123
Port 10s
‘Alternate Pin Function 108
Port0 105
PORT! 107, 108,
PORTS Los
Read Latch 102
Read Pin 109
Sink Current 111
Source Current 110
Power Consumption 153
Power on Reset 151
Power Saving 151
IDLE Mode 151PCON Register. 152
PowerDown Mode 152
Program Control Transfer. 193
CALL Instruction 194
CINE Instruction 195
CINE instruction 195
DINZ instruction 195
Jump Instructions 193
Register instructions 167
Registers. 102
‘Accumulator 102
BRegisters 102
Data Pointer U3
DPTR 103,
Program Counter 103
Program Status Word 102
PSW 102
Scratchpad Registers. 104
Stack Pointer 103
Register Specific Instructions 167
Reset Circuitry 150
RET Instruction 124
Serial Pot 139
bbaudrae 141
Mode 0 140
Mode 1.140
Mode 2 143
Mode 3. 143
‘Multiprocessor Communication 143
Receive Interupt 141
REN 140
SBUF Register 139
SCON Register. 139
‘Transmit Interrupt 141
SFR 101
Single Stepping 126
Special Function Register 96
Stack 172
Stack Pointer 172,
Timer/Counter Units 132
‘Ato Reload Mode 136
GATE Control 134
Mode 0.134
Mode 1135
Mode 2.136
Mode 3137
TMOD Register 132
TStates 108
8052 Microcontroller 155
8255A 42
pVision3 558
Actuators 16,35
ADC 127
Index
‘Advanced High Performance Bus 658
Advanced Peripheral Bus 68
Advanced System Bus 668
‘Aging 422
AHB 668
AMBA 668
‘Analog 10 Digital Converter 127
Android 652
AOT Compiler 650
APB. 658
Application Specific Instruction Set Processor 19
Application Specific Integrated Circuit 19, 26,647
“Applicaion Specie Sundard Product. 25
Arithmetic Operation 321
ARM. 664
Amy 325,344
ASB 668
ASIC 19,26, 647
ASP 19
‘Assembler 309
‘Assembly Language 583, 306
Assembly Note 285
ASSP 26
ATBOCSI. 112
ATSOCSIRDI/ED2 155
‘ATH988252_ 12
‘Atomic 364
auto. 320, 321, 366
‘Automotive 85
‘AVR 637
Baudrate 140
BCD 184
Bigendian 24
Bill of Material. 262
‘Binary Coded Decimal 184
Packed 184
Unpacked 184
Binary Semaphore 467
BIOS 3
Bitfield 346
BitManipulation 356
BitwiseAND 355
Bitwise NOT 357
BitwiseOR 356
Bitwise XOR 356
Bluetooth 56
BOM 262
Boot losder 553
Boot ROM 553
Boundary Sean 608
‘Boundary Scan Description Language 610
‘Bounded Buffer Problem 451
Branching Instructions 322Indox
break 320, 324
Brown-out Protection Circuit 61
BSDL 610
Buffer 231
Busy Waiting 457
calloc. 369
CAN 87,94
case 320
Cathode Ray Oscilloscope 607
DFG 207
cher 320
Character 330
Chipievel Muli Processor 647
cH 650
Gireular Wait 446
CISC 22.206
CLR 650
CMP 647
CMPXCHG 459
Co-design 208
Co-operating Process 426
Co-operative Multitasking 403
Code Memory 93
Combinational Cireait 236
Commercial Of-the-Shelf 23
Common Language Runtime 650
Communicating Process Model 212
‘Communication Imerface 43
Competing Process. 427
Compile Control 350
Compiler. 319
Complex instruction Set Computing 22. 206
Computational Engine 21
Computational Move! 207
‘Computer Aided Design 616
‘Computer Numeric Contol 617
Conceptualisation 626
Concurrent Process Moéel 212
Conditional Operator 323
sonst 320, 352
Constant data 352,366
Constant pointer. 353
Context Retrieval 402
Context Saving 402
Context Switching 121, 402
continue 320
Control DFG 207
Controller Architecture 20S
Controller Ares Network 37
Cost Benefit Analysis €27
COTS. 28,624
Counter 126
Counting Semephore 463
CPLD 26
CPU Utilisation 404
Critical Section 470
CRO 607
Cross Compiler 319
Data Flow Graph 207
Data Memory 21, 93
Datapath Architecture 205
Data type 320
ADCOROL 127
De-muttiplexer 236
Deadlock 445, 449
Debugging 570, 599
Decoder 233
Decompiler 597
default 320
delay 355
Deployment 634
Detailed Design 631
Devicedriver 476
Device Queue 405
DFG 207
Digital Signal Processors (DSP) 6,15, 72
Dining Philosophers’ Problem 448
Disassembler 597
Distributed 73
do 320
dowhile 324
DS80C320 156
DS80C323 156
Dynamic Memory 356
Dynamic RAM. 32
EDA 249
EDLC 622
Electrically Erasable Programmable Read Only Memory 30
else 320
Embedded ‘C” 319
Embedded firmware $9
Embedded Operating System 303
Embedded Systems 3, 72
Characteristics 22
Large-Scale 2
Medium-Seale 2
Quality Attributes 24
Small-Seale 2
Emulation 155
Encoder 234
‘enum 320
Erasable Programmable Read Only Memory 30
Events 475
Fyolutionary Medel 639
Exception Handling 388Execute in Place 34
extern 320,321
Factory programmed chips $53
FCFS. 405
Feasibility Stady 627
Feature set $3
FET 107
ld Programmable Gate Array (FPGA) 15, 26
File 350
File System Management 383
inte State Machine 208
Finite State Machine Datapeth 205
Firewire SS
Firmware 4,302,548
First Come First Served Scheduling 405
Flip-lop 238
D 239
JK 239
SR 28
float 320
Footprint 267
for 320,324
Fountain Model 638
FPGA 26
FPSLIC 647
free 370
FSM_208
FSMD 205
Full Duplex. 139
Function Generator 608
function pointer 337
Funetions 333
Fused Deposiion Modelling 617
General Packet Radio Service 58
‘General Purpose Operating System 386
General Purpose Processor 12
Gerber File 286
slobal 366
goto 320,328
GPOS 386
cer
GPRS. 58
Hard Real-Time 390
Hardware Software Trade-offs 219
HCFSM 210
HECU 86
HEX File 594
Intel HEX File 595
‘Motorola HEX File 396
jerarchical/Concurrent 210
High-speed Electronic Control Units 86
Index
High Level Language 313
iLINK ss
VO System Management 383
vO Unit 21
Re 4s
IAP 552
Ic 243
ICE 603,
IDE 548,557,587
IDL 439
IDLE Task 424
IE
IEEE 1394 35
if 320
ifelse 322
In Application Programming $52
In Circuit Emulator 603,
Incremental Model 638
Infinite loops 355,
Infrared $6
Injection Moulding 618
Inline Assembly 318
Tastriction Set 164
In SystemProgramming 112, 551
im 320
Integrated Circuit 243
Integrated Development Environment. $87
Integiation Testing 630, 633
Inter integrated Circuit 45
InterlockedCompareExchange 460
Intermediate Language 650
Interrupt 120,360
Interrupt Handling 389
Interrupt Service Routine 316
EDA 36
ISP 112,551
Lterative Model 638
RME 650
Thva bytecode 649
Java ME 650
Java Native Interface 650
Java Thread 399
Java Virtual Machine 649
INI 650
Job Queue 405
STAG 551, 608
Just In Time Compiler 649
IVM 649
Keil 558
Kemel 382
Kemel Space 384Index
Kemel Thread 401
Keyboard 42
Keywords 320
Large-Scale Integration 243
Last Come First Served Scheduling 407
Latch 231
Layers 271
Layout Design 272
LCFS 407
LECU 86
LED 36
Library fle 311
LIFO. 407
Light Emitting Diode 36
LIN &7
Linear Model 636
Linker 311
List File 589
Litte-endian 24
Livelock 448, 449
L803 112)
Load Store Architecture 24
Local Interconnect Network Bus 87
Locator 311
Logic Gates. 231
ong 320
Looping Instructions 323
Low-speed Electronic Contol Units. 86
Lym 55
Machine Languags 306
Macro 351
Mailbox 438
‘malloc 368
‘Map File 592
MAX232. 144
‘Mean Time Between Failures 25
‘Mean Time To Repair 75
‘Medi Oriented System Transport Bus 82
Medium-Scale Integration 243
Memory 17,28
RAM 30 ‘
DRAM 32
NVRAM 32
SRAM 20
ROM 29
EEPROM 30
EPROM 30
FLASH 30
Masked ROM 29
OTP 29
PROM 22
Memory Management 388
Memory Mapped Objects. 428
Memory Shadowing 33
momict 370
Message Passing 433,
Message Queue 434
MieroC/O8-1f 470, 514
‘Counting Semaphore 529
Interrupt Handling. 40
Inter Task Communication $21
Kemel functions $19
Mailbox. 521
Memory Management 538
Message Queue 526
Mutex 530
Mutual exclusion 527
Task Creation 515
“Task Scheduling 520
Task Synchronization 527
Timing & Reference 538
Microcontroller 6,15, 12
Microkernel 385
Microprocessor 6, 15, 18
Million Instruction Per Second $3
MIMD 206
MIPS 93
mnemonics 396
Model. 625
Monitor Progr 602
Monitor ROM. 602
Monolithic Kemet 385
MOST 7
Motorola HEX 595
Moulding 617
MROM 29
MTBF 25
MTTR 75
Multicore Processors 647
Multimeter 607
Multiple Instruction Multiple Data 206
Multplexer 235
Multiprocessing 401
Multitasking 121, 402, 403
Multithreading 393,
Mutex. 457
Mutual Exclusion 446
NAND FLASH 34
Need 625
Netlist 264
Non-Operational Quality Attributes. 25
Debugeability 76
Evolvability 22Partability 77
Testability 26
Non-preemptive Multitasking 403
‘Non-preemptive Scheduling 405
NOR FLASH 34
Object-Oriented Model 213
Object File $92
Object Oriented Design 214
OCD 60s
offsetof 349
OHA 651
OMA 651
ONCE 155
On Chip Firmware Debugging 605
Opcode 164,307
Open Collector 230
(Open Handset Alliance 651
Open Mobile Alliance 651
Openmoko 652
Operand 164, 307
Operating System 305, 382
Operational Quality Attribute 24
‘Availability 76
Confidentiality 25
Integrity 76
Maintainability 25
Reliability 75
Response 15
Safety 75
Security 76
‘Throughput 75
Optacoupler 37
Oscillator Unit 62
Out-of-Circuit Programming 549
Package 267
Packed structure 345
PCB 64,288,393
PCBEtching 290
PCBMilling 290
PCB Printing 291
PIC 653
Piczo Buzzer 41
Pipelining 25
Pipes 427
‘Anonymous 428
Named 428
PLD 26
Pointer 327
Pointer to constant data. 353
Polling 120
Portability 315
Porteble threads 400
Index
POSIX 502
POSIX Threads 395
PPL 42
Pre-procestor 349
Preemptive multitasking 403
Preemptive Scheduling 412
Preemptive SJF Scheduling. 413
Preliminary Design 630
Preprocessor Output File 591
Primary Memory Management 383
Princeton architecture 23
Printed Circuit Board 64,288,
printf 331
Priority Based Scheduling 410, 420
Priority Ceiling 455
Priority Inheritance 454
Priority Inversion 453,
Process 391, 392
State 392
Process Control Block 393
Processing Elements 206
Process Life Cycle 392
Process Management 382, 387, 393,
Processor Architecture 23,
Harvard 23
Von-Neunann 23
Process Scheduling 387
Process Synchronisstion 388
Producer Consumer Problem 451
Product Enclosure 616
Productivity 624
Product Life Cycle 78, 625,
Product Re-engineering 626
Product Support 634
Programmable Logic Device 26
Programmable Peripheral Interface 42
Programmable ReadOnly Memory 29
Program Memory 21
Programming Elements 647
Project Management 623
Prototyping Model 639
threads 395
Push Button 41
(Quasi Bi-directional 107
Racing 443, 449
RAM 30,344
Random Access Memory 30)
Rapid Prototyping 616
Re-entrant Function 364
Reactive System 73
Read-Modify-Write 106
Readers-Writers Problem 453Index
Read Latch 106
Read Pin 105
Ready Queue 405
RealTime 73, 343, 386
Real-Time Clock (RTC) 62, 389
Real-Time Kemel 387
realloe 370
Real Time Operating System 7, 306,386
Reconfigurable Processor 647
Reconfigurable SoCs 647
Recursive Function 362
Reduced instruction Set Computing 22, 206
register 320, 321
Register Transfet Level 245
Relational Operations 322
Relay 40
Remote Method Invocation 439
Remote Procedure Call 439
Requirements Analysis 628
Reset Circuit 60.
‘Response Time 404
RET 124
Retirement 636
return 320
RISC 7,22, 206, 646
RMI 439
ROM 29
Room Tempefature Vulcanised 617
Round Robin Scheduling 414
Routes 270
RPC 439
RS-232. SI, 144
RS42 3
RS-485
RSOC 7. 648
RIC 62
RTL 245
RTOS 386
seanf 331
‘Schematic Design 249
Schmitt Trigger 128
Selective Laser Sintering 617
‘Semaphore 463
Sensors 10, 16,35
‘Sequential Circuits 237
‘Sequential Programming Model 211
Serial Peripheral Interface Bus 47, 551
Shared Memory 427
Sheet Metal 618
short 320
‘Shortest Job Firs! Scheduling 408
‘Shortest Remaining Time 413
Signalling 438
Screen 291
SIMD 205
Simulator $71, 598
Single Instruction Multiple Data. 206
sizeof 320
SIF 408
Sleep 355
Sleep & Wakeup 462
Small-Scale Integration 243
SoC 646
Sockets 440
Soft Real-Time 390
Solder Mask 291
SPI 47,851
Spin Lock 457
Spiral Model 640
SRT 413,
Suck 391
Starvation 422, 448, 449
State Machine Model 208
static 320, 321,335, 366
Static Memory "366
Sutic RAM. 30
Stepper Motor 38
Bipolar 38
Half Stepping 39
Unipolar 38
Wave Stepping 39
Stereolthogaphy ‘617
Storage Class 321
strcat 331
stremp_ 332
strepy 333
stricmp 332
String 330
strlen 332
struct 320,341
structure 341
Structure padding 345
Super Loop 303
switch 320
switch case 323
Sysiem € 206
Sysiem on Chip 646
System Testing 633
Task 390
‘Task Communication 426
Task Synchronisation 442, 456
TCON 126
‘Testand Set Lock 459
Testing Bits 359
Integrated Development Environment 557
Thread 401Birding 401
Many-to-One 401
One-to-One 401
Thread Preemption 400
Threads 393
Thread Standard 394
Throughput 404
Time Management 389
Timer 126
Timer tick 389
Timeto Market 7,204
Timeto Prototype 77
Toggling Bits 358
Tooling. 617
TriState 230
Truth Table 236
TSL 439
TTL Logic 106
Tumaround Time 404
typedef 320, 342, 348
UART 4
‘ULN2803. 15
UML 214, 218
Activity diagram 219
Collaboration 218
Sequence diagram 218
‘State Chart diagram 219
Use Case-diagram 218
Unified Modelling Language 214
320, 348
Unit Testing 620,633
Universal Asynchronous Receiver Transmitter 48
Universal Serial Bus 53
User Aaceptance Testing 630
User Level Thread 401,
User Space 384
Verilog 206
Very Large-Seale integration 243,
Index
‘Very Long Instruction Word 206
VHDL 206,245
Via 271
Virtual Memory 388
VLIW 206
VLSI 243
void 320
volatile 320, 353,
volatile pointer. 355
Von-Neumann 99.
VWorks 470,499, 648
Binary Semaphore 509
Counting Semaphore $09
Intemupt Handling $11
Interupt Locking 509
Inter Task Communication $03
Kemel Service 503
Message Queve 503
Mutual Exclusion 508
Mutual exclusion Semaphore $09
Pipes. 507
Signals 507
Task Creation 499
Task Locking 508
‘Task Scheduling 502
‘Task Synchronisation 508
Waiting Time 404
Watchdog Timer 63
‘Waterfall Mode! 635,
while 320,324
while continue 324
‘Win32 Thread 397
wind 499
xIP 34
ZigBee $8
ZigBee Coordinator 58
‘ZigBee End Device 58
‘ZigBee Router 58Introduction to
EMBEDDED
SYSTEMS
Meant for students and practicing engineers, this
book provides a comprehensive introduction to the
design and development of embedded hardware and
firmware, their integration, and the management of
embedded system development process.
Salient features
> Follows a design-oriented approach
> Detailed coverage of RTOS internals, multitasking,
task management, task scheduling, task j
communication and synchronisation |
>» In-depth elucidation of the internals of
MicroC/ OS-Il and VxWorks RTOS kernels
> Practical implementation using real-life examples of
Washing Machine, Automotive, Stepper Motor, and
Mobile Phones
» Deals in embedded C, delving into basics and
unraveling advanced level concepts
» Pedagogy
@ 433 Review questions
@ 428 Objective-type questions
@ 25 Examples
+ 80 Lab assignments
Visit us at: www tatamegrawhil.com
SBN 13:9784-07-0145894 |
ISBN 10: 0-07.0458
eee
ro Higher Education
iil
F