Microcontroller Technology: The 68HC11 / Edition 3 available in Hardcover
- Pub. Date:
- Prentice Hall Professional Technical Reference
This updated edition continues to provide readers with the background needed to understand and use microcontrollers, specifically the popular Motorola 68HC11. The 68HC11 is relatively easy to work with and has most of the features essential for a complete control system. The book starts at an introductory level by explaining the applications and origins of microcontrollers. Next, a programmer's view of the device is developed. Finally, the hardware is described and the reader learns how to connect it to the outside world for control applications.
Many changes have been made to this edition:
- To acknowledge the prominence of C programming, the topic is introduced earlier and the text uses C program examples throughout.
- A CD-ROM containing source code, a special demo version of the THRSim11 simulator, a IC11 demo C compiler, a cross assembler, fuzzy logic tools, and assorted electronic design tools is included. Because it provides a practical way to explore programming and interfacing concepts, readers will find the simulator extremely useful.
- Chapter openers now list learning objectives to help the reader pick out the important points in each chapter.
- Numerous helpful appendices have been added to reinforce key topics.
This book is an excellent guide and reference, and it will prove indispensable to students of control automation and interested amateurs, as well as to experienced users of microcontrollers.
An Instructor's Manual (ISBN 0-13-033248-8) is available free of charge to instructors using the book for a course.
|Publisher:||Prentice Hall Professional Technical Reference|
|Edition description:||Older Edition|
|Product dimensions:||7.23(w) x 9.56(h) x 1.62(d)|
Table of Contents
|Part 1||Introducing Microcontroller Technology||1|
|1.1||What Is a Microcontroller? and What Is It Used For?||1|
|1.3||Top-Down View of Microcontroller Systems||8|
|1.5||Microcontroller Memory Map||16|
|2.1||Assembly and Other Programming Languages||19|
|2.2||Source Code, Object Code, and the Assembler||21|
|2.3||Using High-Level Languages||28|
|2.4||Fetch/Execute Operation of the Central Processing Unit (CPU)||31|
|2.5||The Instruction Set and Addressing Modes||36|
|2.7||Microcontroller Arithmetic and the Condition Code Register||74|
|2.8||Program Flow Control Using Looping and Branching||90|
|3||The Stack, Subroutines, Interrupts, and Resets||112|
|3.1||Introducing the Stack||112|
|3.2||Using the Stack to Store Data||114|
|3.4||Modular Programming Using Subroutines||124|
|3.6||Concept of Interrupts||137|
|3.9||Hardware Interrupts and Resets||146|
|3.10||Software and CPU Control Interrupts||155|
|3.11||The Kiss of Death: Stack Overflow||156|
|4||Cross Assembly and Program Development||162|
|4.1||Introduction to Program Development||162|
|4.2||Format of the Source Code||163|
|4.3||Code and Data Segments||167|
|4.5||The Assembly Two-Pass Process||177|
|4.6||Assembler Options and Preprocessor Directives||180|
|4.7||Hex and Binary Files||185|
|4.10||Evaluation Boards and Emulation||191|
|5||Bus Concepts and Modes of Operation||197|
|5.5||Modes of Operation||207|
|5.6||Single-Chip Operating Mode||207|
|5.7||Expanded Multiplexed Operating Mode||208|
|5.8||Special Bootstrap Mode||209|
|5.9||Special Test Operating Mode||211|
|6.4||Erasable Programmable Read-Only Memory (EPROM)||230|
|6.6||Electrically Erasable Programmable Read-Only Memory (EEPROM)||233|
|6.7||Configuration Control Register (CONFIG)||239|
|6.8||RAM and I/O Mapping Register (INIT)||240|
|7.5||Oscilloscope Test Loops||255|
|7.7||Transmission Line Effects||260|
|8.2||Input/Output Subsystems and Registers||268|
|8.3||Memory or Input/Output Mapping||271|
|8.4||Interfacing Using Polling or Interrupts||274|
|8.5||The Parallel I/O Subsystem||276|
|8.7||Programmable Timer I/O Subsystem||280|
|8.8||Analog/Digital I/O Subsystem||282|
|8.9||The I/O Subsystem Registers||284|
|9.1||Introduction to the Subsystem||294|
|9.2||Seven-Segment (LED) Display Output||297|
|9.3||Liquid-Crystal Displays (LCDs)||304|
|9.5||Other User Input/Output||324|
|9.7||Full Handshake Input/Output||330|
|9.8||Parallel Interface Standards||338|
|10||The Serial Subsystems||358|
|10.1||Asynchronous Communications Systems||359|
|10.2||The Serial Communications Interface (SCI)||370|
|10.4||Synchronous Serial Input/Output||391|
|10.5||The Serial Peripheral Interface (SPI)||393|
|10.6||SPI Topologies and Applications||393|
|10.8||SPI Error Handling||408|
|11||Programmable Timer Operations||417|
|12||The Analog Converter Subsystem||465|
|12.1||Concepts and Terminology||466|
|12.5||The Built-in A/D Subsystem||488|
|Part 5||The Microcontroller World||497|
|13||Application Control Software||497|
|13.1||Boolean Logic Control||498|
|13.4||Feedback Control of the Analog World||511|
|13.5||Digital Signal Processors||517|
|13.6||Using the C Language||524|
|14.2||Consumer Electronics: Automatic Camera||582|
|14.3||Computer Peripherals: Dot Matrix Printer||590|
|14.4||Society and Microcontroller Technology||601|
|15||Eight-Bit Microcontroller Families||602|
|15.1||Microcontrollers and the Semiconductor Industry||603|
|15.3||The Intel 8051 Core||615|
|15.4||Survey of Other Families||624|
|15.5||Choosing a Microcontroller||624|
|A||Instruction Set Summary||630|
|MC68HC11E9 Block Diagram||639|
|Data Book and Programming Reference Guide Tables and Figures||641|
|Cross-References to Other Data||646|
|Some Trade Magazines||648|
|Logic Levels for Digital Signals||652|
|E||Header and Library File Source Listings||658|
|F||Digital Logic and Binary Codes||662|
|A Digital Logic Primer||662|
|H||Internet and Disk Resources||679|
Microcontrollers are used in the industrial world to control many types of equipment, ranging from consumer to specialized devices. They have replaced older types of controllers, including microprocessors. Also, there is a growing need for off-line support of a computer's main processor. The demand will grow as more and more equipment uses more intelligence. Applications range from controlling engines in modern automobiles to controlling laser printers and other computer peripherals. One consumer application is a washing machine controller that adjusts the wash cycle based on load size, fabric type, and amount of dirt.
This book illustrates how to use a popular microcontroller, the Motorola 68HC11. The 68HC11 is relatively easy to work with, yet it has most of the features essential for a complete control system. Thus the student of control automation can use it to work with control systems at the component level. The interested layperson can also use it as a tool to understand and experiment with computer and data communications systems.
The goals of the fourth edition remain the same as those of earlier editions. The book provides the background knowledge needed to understand and use microcontrollers in general as well as the 68HC11 specifically. It starts at an introductory level, explaining the applications and origins of microcontrollers. Next, a programmer's view of the machine is developed. Finally, we describe machine hardware and how to connect it to the outside world for control applications.
You will find the book useful in learning how to use the 68HC11. Original manufacturers' data books do not provide the background explanations that anovice needs. Experienced users will find the book to be a useful accompaniment to the manufacturer's original documentation.The book can be used as a textbook in introductory, interfacing, and industrial control courses. To use the book, you should have a background understanding of digital logic and numbering systems. Some computer programming knowledge is useful but not absolutely essential. Although this book was written to be used in college courses, the interested hacker or hobbyist should find the material useful for self-study. Others with a formal education from the past should also find useful information. The book can accompany hands-on exercises using a microcontroller training kit or simulation software. Where possible, concepts are presented generically, to help you understand other microcontrollers and related devices.
To permit flexible use of the book, we have organized it into five parts:
Part 1. Microcontroller technology is introduced in Chapter 1: what it is, how it evolved, and how to use it. The chapter continues with explanations of terminology and parts of the microcontroller. Finally, essential memory concepts are reviewed.
Part 2. Chapters 2 to 4 cover programming concepts, the language used to instruct the microcontroller, and how to use registers and memory. Also covered is how to produce, use, and document programs.
Part 3. Chapters 5 to 7 cover operation of the chip itself. Topics include the system bus, operating modes, clocked operation, and memory technology.
Part 4. Chapters 8 to 12 deal with the subsystems for parallel, serial, programmable timer, and analog interfacing. The basic software techniques to use these systems are presented. Also introduced are some common hardware designs used to connect the microcontroller to sensors and actuators. An overview of all subsystems without the processor-specific details is presented in Chapter 8.
Part 5. Control methods are illustrated in Chapter 13, where it is shown how programs use the subsystems for control applications. Chapters 14 and 15 cover the industry to date, presenting a survey of typical applications, choices in choosing microcontrollers, and characteristics of other microcontrollers.
Typically, an introductory course would include Parts 1 and 2. We also recommend including Chapter 8. Advanced or more intensive courses would include Parts 3 and 4. Either type of course can use Part 5, provided that Chapter 8 is also covered.
Although the book contains some data sheets, it is not a complete reference. The reader should refer to the literature listed in Appendix C for complete data.
FOURTH EDITION CHANGES
To acknowledge the prominence of C programming, this edition introduces C programming earlier and uses C program examples throughout. These changes also reflect the use of version 6 of the ICC11 cross compiler. There is more coverage of the 68HCI 1E9 with a de-emphasis on the `A' type parts because Motorola has discontinued their production. This edition also includes a CD-ROM (described in Appendix H) with source code, a special demo version of the THRSim11 simulator, ICC11 demo C compiler, cross assembler, fuzzy logic tools, and assorted electronic design tools. The simulator is a welcome addition because it provides a handy way to explore programming and interfacing concepts. Appendix H includes an introductory tutorial for using the simulator. Appendix C lists EVBU substitutes. Note that Motorola has discontinued its educational discount for the 68HC 11 EVBU (replacing it with the 68HC 12 EVBU). The chapters now list objectives, a long overdue pedagogical improvement.
HOW TO USE THIS BOOK
Most important to success when using this book is an enthusiasm for computer and related technology. If you are already familiar with assembly language programming, you may wish to skim Chapters 1 and 2 for new information instead of reading them in detail. If you are not familiar with digital logic and binary numbers, you should also read Appendix F.
We use generic principles whenever possible. After studying this book, you should be able to work with any microcontroller, but it is necessary to cover a specific microcontroller in depth in order to understand them all in general. We have chosen the 68HC11; however, there are many variations of the 68HC 11. When explaining specific details, we generally refer to the 68HC11E9, unless we state otherwise.
To understand microcontrollers, you also have to know a lot of jargon. You cannot understand the concepts without knowing the jargonbut you cannot understand the jargon without knowing the concepts. We get around this dilemma by introducing details step by step.
The appendices provide references and further clarification of terms used in the book. Appendix A lists the details of the 68HC 11 instructions used throughout the book. You will probably use it often. Appendix B is the quick reference section. Use it as a cross-reference to look up other 68HC 11 details as needed. Appendices A and B are necessary if you do not have 68HC 11 data sheets or a manual.
Most terms are explained in the text as required. New terms are indicated in italic type when they first occur in the text. You may wish to reread earlier sections of the book to review terms when used in another context. The glossary provides an additional reference.
A lot of abbreviations are used in the technical literature. Unfortunately, these frustrate many readers. In practice, most technical data books use abbreviations, often without explanation. In this book each abbreviation is defined the first time it is used, and many are redefined upon subsequent appearances. You can also find a list of abbreviations after the glossary.
Sources of further information on some topics are listed in Appendix C. Also listed are suppliers for some of the commercially available products mentioned in the book. We encourage you to use the bulletin board mentioned in Appendix C.
Some conventions are defined in Appendix D. Since there are many ways to do the same thing, we felt it necessary to define a standard way. The conventions are those used by many in the industry. For example, we use Motorola's dollar sign ($) convention to refer to a method of coding numbers (in this case the sign does not indicate dollars). This ensures that we all understand the sign to have the same meaning.
The header files used by some program examples are listed in Appendix E. Note that a header file is explained in Appendix E.
The basics of digital logic and number conversions are explained in Appendix F. You should read this section early if you are not already familiar with these topics.
If you need basic information about waveforms, refer to Appendix G.
Finally, we included a reference to Internet resources and the enclosed CD-ROM in Appendix H.
Prentice Hall also offers a lab manual, written by Robert John Dirkman and John Leonard of the University of Massachusetts, that can be used with this book. It is called the Microprocessor Applications Laboratory Workbook. Instructors can contact Prentice Hall for a copy of the Instructor's Solutions Manual with Powerpoints to accompany this book.
I would like to thank Hugh K. McGugan of Motorola Training Organization, Canada, for technical literature, review of some chapters, and the assistance he always gave willingly and promptly. Without his help this book would not exist. I thank also Alan D. Niemi of Lake Superior State University, Sault Sainte Marie, Michigan, for his valuable comments and advice when reviewing sections of the preliminary manuscript. Helpful advice was also received from V. S. Anandu of Southwest Texas State University, San Antonio, Texas, and from Jeffrey Rankinen of Pennsylvania College of Technology during review of the manuscript. Also, I thank my students and teaching colleagues whose experiences led me to make some of the changes in this edition. Any deficiencies are mine because I did not always follow their advice.
I am grateful to Hitoshi Doi and Chuck Westfall of Canon Incorporated, Japan, for valuable information about their model EOS cameras. In addition, I thank Richard Man of ImageCraft, USA, for providing information as well as the demo version of the ICC11 C cross compiler. Similarly, Harry Broeders of Rijswijk Institute of Technology, Netherlands, provided a special version of the THRSim11 simulator. Peter Fabo of Comenius University, Bratislava, Slovakia, provided information about his VT11 module. For valuable comments, suggestions, and corrections, I express sincere appreciation to Charles Edward Nunally of Virginia Tech, Blacksburg, VA, USA; Jack Levine of California State University, Los Angeles, CA, USA; Kurt Schneider of EDV Beratung and Schulung, OberRamstadt, Germany; Patrick J. O'Connor of DeVry Institute of Technology, Chicago, IL, USA; and Trung Do of University of Illinois at Chicago, Chicago, IL, USA. In particular, I want to acknowledge the numerous suggestions offered by Kurt Schneider. Finally, thanks to the editorial and production people who provided excellent and professional support. They are Jennifer Antonacci and Delia Uherec of Prentice Hall, and Megan Smith-Creed and Cindy Lanning of Custom Editorial Productions.
Finally, a very special thanks to my wife Renate, who provided invaluable emotional support. I also thank my eight-year-old daughter Emilie, six-year-old daughter Hannah, and three-year-old daughter Anika, who all provide much joy.
Sir Sandford Fleming College