You are on page 1of 557
e McGraw Hill Companies “Embedded Systems Architecture, Programming and Design Second Edition Raj Kamal IN | Tata McGraw-Hill Pubtished by the Tata McGraw-Hill Publishing Company Limited, 7 West Patel Nagar, New Delhi 110008, Copyright © 2008 by Tata McGraw-Hill Publishing Company Limited. First reprint 2008 RQOXLCRYXRBXBQ No part of this publication may be reproduced or distributed in any form ot 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 listing (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, Tua McGraw-Hill Publishing Company Limited. ISBN 13: 978-0-07-066764-8 ISBN 10; 0-07-066764-0 Managing Director: Ajay Shukla General Manager: Publishing—SEM & Tech Ed: Vibha Mahajan Sponsoring Editor: Shalini sha Jr: Sponsoring Editor: Nilanjan Chakravarty Executive—Editorial Services: Sohini Mukherjee Production Executive: Sunecta $ Bohra General Manager: Marketing—Higher Education & School: Michael J Cruz Product Manager: SEM & Tech Ed: Biju Ganesan Controtler—Production: Rajender P Ghansela Asst. General Manager—Production: B L Dogra Information contained in this work has been 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. If such services are requited, the assistance of an appropriate professional should be sought, Published by the Tata McGraw-Hill Publishing Company Limited, 7 West Patel Nagar, New Delhi 110 008, typeset at Bukprint India, B-180A, Guru Nanak Pura, Laxmi Nagar-110 092 and printed at SDR Printers, A-28, West Jyoti Nagar, Loni Road, Shahdara, Delhi 110.094 Cover: SDR Printers MeGrow Hill Contents Preface to the Second Edition vil Preface to the First Edition ix 1. Introduction to Embedded Systems 1 LI Embedded Systems 3 12 Processor Embedded into a System _5 13, Embedded Hardware Units and Devices in a System _/0 1.4 Embedded Software in a System 19 15 Examples of Embedded Systems 27 1.6 Embedded System-on-chip (Soc) and Use of VLSI Circuit Design Technology 29 1.7 Complex Systems Design and Processors 32 18 Design Process in Embedded System 37 19 Formalization of System Design _42 1.10 Design Process and Design Examples 43 LI Classification of Embedded Systems _52 1.12. Skills Required for an Embedded System Designer 53 2. 8051 and Advanced Processor Architectures, Memory Organization and Real-world Interfacing a 2.2 Real World Interfacing 72 24 Processor and Memory Organization _ 96 2.7 Memory Types, Memory-Maps and Addresses 106 2.9 Memory Selection 1/8 it © Talia Beem xiBaliinst " 3.110 Types and Examples 130 32 Sa ire 3.3_ Parallel Device Ports _/43. 3.4 Sophisticated Interfacing Features in Device Pons _/50 3.5_Wireless Devices 151 3.6 ‘Timer and Counting Devices _/52 3.7 Watchdog Timer 157 3.8 Real Time Clock 158 3.9 Networked Embedded Systems 159 ‘Network Using ISA, PCI, PCI-X and Advanced Buses 166 3.12 Internet Enabled Systems Network Protocols 170 3.13 Wireless and Mobile System Protocols 175 4. Device Drivers and Interrupts Service Mechanism 187 4 ymed-VO Busy-wait Aj without Interrupt Service Mechanism _/89