EMBEDDEDSYSTEMS CIRCUITSandPROGRAMMING
Julio Sanchez
Minnesota State University, Mankato
Professor Emeritus
Maria P. Canton
Software Engineer, SKIPA Software Associates
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
2012 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa business
No claim to original U.S. Government works
Version Date: 20120224
International Standard Book Number: 978-1-4398-7904-7 (Hardback)
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe.
Library of Congress Cataloging-in-Publication Data
Sanchez, Julio, 1938
Embedded systems : circuits and programming / Julio Sanchez, Maria P. Canton.
p. cm.
Includes bibliographical references and index.
ISBN 978-1-4398-7904-7 (hardcover : alk. paper)
1. Embedded computer systems--Design and construction. 2. Embedded computer systems--Programming. I. Canton, Maria P. II. Title.
TK7895.E42S263 2012
006.22--dc23
2012000494
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
Table of Contents
Embedded systems are everywhere in our modern world. You can find them in automobiles, toys, kitchen appliances, computers, airplanes, TVs and digital recording devices, cell phones, gaming machines, nuclear power plants, space telescopes; in every electronic device that furnishes an intelligent, independent, or controllable functionality. By definition an embedded system is a computer designed to perform one or a few specialized functions, most often in real-time. The embedded system is usually a part of a hardware or mechanical device that includes other physical components. For example, a household dishwasher contains a cabinet with trays, one or more motors, sprayers and jets, deposits for holding soap and other chemicals, and an embedded computer system that determines cycles, modes, and timing of the device. It is this embedded controller that actually operates the machine, and what our book is about.
The authors conceived Embedded Systems: Circuits and Programming as a reference and a resource kit for engineers, scientists, and electronic enthusiasts who need to develop systems and boards that contain digital components and controls sometimes combined with analog devices. Our book is also intended as a tutorial on microcontroller programming and on the basics of embedded design. The focus is on the needs of working professionals in the fields of electrical, electronic, computer, and software engineering.
Many engineered products require the development of one or more embedded systems. At the commercial fabrication stage the embedded system or systems are re fined and optimized by specialists in order to facilitate production and minimize cost. However, during the development and prototyping phases, the developer often needs to create an embedded system that demonstrates the operation of the device, proves its viability, or exercises its functionality. This initial product is often called a prototype. The availability of off-the-shelf components, the abundance of design and prototyping tools, and the ease with which digital controllers can be programmed make it possible for the non-specialist to develop these boards and controllers. In this book we focus on the following development tools and resources:
The use of standard or off-the-shelf components such as input/output devices, integrated circuits, motors, and programmable microcontrollers
The development of circuit prototypes and their implementation using breadboards, followed by the in-house fabrication of test-time PCBs, and finalized by the manufactured board
The availability and use of development tools that facilitate the design and prototyping of embedded systems, such as electronic design programs and software utilities for creating printed circuit boards
Sample circuits that can be used as part of the targeted embedded system
The selection and programming of microcontrollers suitable for use in the circuit at hand
We have aimed at a book that is functional and hands-on. The resources furnished to the reader include sample circuits with their corresponding programs. The circuits are depicted and labeled clearly in a way that is easy to follow and reuse. For some critical circuits we provide tested PCB files. The sample programs are matched to the individual circuits but general programming techniques are also discussed in the text. There are appendices with hands-on information and the books online software package includes tools, resources, and code listings. These materials are available at
http://www.crcpress.com/product/isbn/9781439879047.
Julio Sanchez
Maria P. Canton
An embedded system can be defined as a computer system that performs one or more dedicated or specialized functions usually with Real-Time constraints. It is the digital controller that is embedded as part of system, which also includes other hardware and mechanical elements. A modern dishwasher contains an embedded control system. On the other hand, a general-purpose computer such as a PC is designed to meet a variety of user needs. The control system in the dishwasher does one task: wash dishes, while the PC on your desktop can be used in word processing, browsing the Web, balancing your checkbook, and many other applications.
Embedded systems are controlled by one or more digital ...
An electrical network is a collection of electrical elements that can include voltage sources, lines, connectors, resistors, inductors, capacitors, switches, controllers, and a host of other standard and special components. The