ebook img

PIC Microcontrollers An Introduction to Microelectronics PDF

387 Pages·2004·4.778 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview PIC Microcontrollers An Introduction to Microelectronics

PIC Microcontrollers This฀Page฀is฀Intentionally฀Left฀Blank PIC Microcontrollers An Introduction to Microelectronics Second Edition Martin Bates AMSTERDAM•BOSTON•HEIDELBERG•LONDON NEWYORK•OXFORD•PARIS•SANDIEGO SANFRANCISCO•SINGAPORE•SYDNEY•TOKYO NewnesisanimprintofElsevier Newnes AnimprintofElsevier LinacreHouse,JordanHill,OxfordOX28DP 200WheelerRoad,Burlington,MA01803 Firstpublished2000byArnold Secondedition2004 Copyright©2004,MartinBates.Allrightreserved AppendixAhasbeenreprintedwithpermissionofthecopyrightowner,MicrochipTechnology Incorporated©2001.Allrightsreserved.Nofurtherreprintsorreproductionsmaybemadewithout MicrochipTechnologyInc.’spriorwrittenconsent. Informationcontainedinthispublicationregardingdeviceapplicationsandthelikeisintendedas suggestiononlyandmaybesupersededbyupdates.Norepresentationorwarrantyisgiven,and noliabilityisassumedbyMicrochipTechnologyInc.withrespecttotheaccuracyoruseofsuch information,orinfringementofpatentsarisingfromsuchuseorotherwise.UseofMicrochip TechnologyInc.productsascriticalcomponentsinlifesupportsystemsisnotauthorizedexcept withexpresswrittenapprovalbyMicrochipTechnologyInc.Nolicensesareconveyedimplicitly orotherwiseunderanyintellectualpropertyrights. TherightofMartinBatestobeidentifiedastheauthorofthisworkhasbeenassertedinaccordance withtheCopyright,DesignsandPatentsAct1988 Nopartofthispublicationmaybereproducedinanymaterialform(includingphotocopyingorstoring inanymediumbyelectronicmeansandwhetherornottransientlyorincidentallytosomeotheruse ofthispublication)withoutthewrittenpermissionofthecopyrightholderexceptinaccordancewith theprovisionsoftheCopyright,DesignsandPatentsAct1988orunderthetermsofalicenceissued bytheCopyrightLicensingAgencyLtd,90TottenhamCourtRoad,London,EnglandWIT4LP. Applicationsforthecopyrightholder’swrittenpermissiontoreproduceanypartofthispublication shouldbeaddressedtothepublisher PermissionsmaybesoughtdirectlyfromElsevier’sScience&TechnologyRightsDepartmentin Oxford,UK:phone:(+44)186584830,fax:(+44)1865853333,e-mail:[email protected]. Youmayalsocompleteyourrequeston-lineviatheElsevierhomepage(http://www.elsevier.com), byselecting‘CustomerSupport’andthen‘ObtainingPermissions’ BritishLibraryCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheBritishLibrary LibraryofCongressCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheLibraryofCongress ISBN 0750662670 ForinformationonallNewnespublications visitourwebsiteathttp://books.elsevier.com Typesetin10/12ptTimesbyIntegraSoftwareServicesPvt.Ltd,Pondicherry,India www.integra-india.com PrintedandboundinMeppel,TheNetherlandsbyKripsbv. Contents Preface to the First Edition x Preface to the Second Edition xii Introduction xiii PART A MICROELECTRONIC SYSTEMS 1 Chapter 1 Computer Systems 3 1.1 The PC System 3 1.2 Wordprocessor Operation 9 1.3 PC Microprocessor System 11 1.4 PC Engineering Applications 14 1.5 The Microcontroller 15 Summary 18 Questions 18 Activities 19 Chapter 2 Information Coding 20 2.1 Number Systems 20 2.2 Machine Code Programs 25 2.3 ASCII Code 28 Summary 29 Questions 29 Answers 30 Activities 30 vi Contents Chapter 3 Microelectronic Devices 32 3.1 Digital Devices 32 3.2 Combinational Logic 36 3.3 Sequential Logic 39 3.4 Data Devices 41 3.5 Simple Data System 43 3.6 4-Bit Data System 44 Summary 47 Questions 47 Activities 48 Chapter 4 Digital Systems 49 4.1 Encoder and Decoder 49 4.2 Multiplexer, Demultiplexer and Buffer 51 4.3 Registers and Memory 51 4.4 Memory Address Decoding 51 4.5 System Address Decoding 54 4.6 Counters and Timers 55 4.7 Serial and Shift Registers 56 4.8 Arithmetic and Logic Unit 57 4.9 Processor Control 58 Summary 59 Questions 59 Answers 60 Activities 60 Chapter 5 Microcontroller Operation 61 5.1 Microcontroller Architecture 61 5.2 Program Operations 65 Summary 73 Questions 73 Answers 74 Activities 75 PART B THE PIC MICROCONTROLLER 77 Chapter 6 A Simple PIC Application 79 6.1 Hardware Design 79 6.2 Program Execution 83 6.3 Program BIN1 85 6.4 Assembly Language 87 Contents vii Summary 90 Questions 90 Answers 91 Activities 91 Chapter 7 PIC Program Development 92 7.1 Program Design 94 7.2 Program Editing 96 7.3 Program Structure 101 7.4 Program Analysis 101 7.5 Program Assembly 105 7.6 Program Simulation 109 7.7 Program Downloading 112 7.8 Program Testing 114 Summary 115 Questions 115 Answers 116 Activities 116 Chapter 8 PIC 16F84 Architecture 117 8.1 Block Diagram 117 8.2 Program Execution 119 8.3 Register Set 120 Summary 126 Questions 127 Activities 127 Chapter 9 Further Programming Techniques 129 9.1 Program Timing 129 9.2 Hardware Counter/Timer 131 9.3 Interrupts 135 9.4 More Register Operations 140 9.5 Special Features 144 9.6 Program Data Table 148 9.7 Assembler Directives 150 9.8 Special Instructions 153 9.9 Numerical Types 154 Summary 155 Questions 155 Answers 156 Activities 156 viii Contents PART C APPLICATIONS 157 Chapter 10 Application Design 159 10.1 Design Requirements 160 10.2 Block Diagram 162 10.3 Hardware Design 162 10.4 Software Design 164 10.5 Program Implementation 171 10.6 Source Code Documentation 174 Summary 175 Questions 175 Activities 176 Chapter 11 Program Debugging 177 11.1 Syntax Errors 177 11.2 Logical Errors 179 11.3 MPLAB Tools 183 11.4 Test Schedule 184 11.5 Hardware Testing 186 Summary 189 Questions 189 Activities 189 Chapter 12 Prototype Hardware 191 12.1 Hardware Design 191 12.2 Hardware Construction 192 12.3 Demo Board 196 12.4 Demo Board Applications 200 Summary 210 Questions 210 Activities 211 Chapter 13 Motor Applications 213 13.1 Motor Control Methods 213 13.2 Motor Applications Board 214 13.3 Control Methods 218 13.4 Position Control 219 13.5 Closed Loop Speed Control 221 13.6 Commercial Application 231 Summary 232 Questions 232 Activities 233 Contents ix PART D MORE CONTROLLERS 235 Chapter 14 More PIC Microcontrollers 237 14.1 Common Features of PIC Microcontrollers 237 14.2 Selecting a PIC 242 14.3 Advanced PIC Features 244 14.4 Serial Communications 251 Summary 254 Questions 255 Activities 255 Answers 255 Chapter 15 More PIC Applications and Devices 256 15.1 16F877 Application 256 15.2 16F818 Application 273 15.3 12F675 Application 274 15.4 18F452 Application 275 Summary 278 Questions 278 Answers 279 Activities 279 Chapter 16 More Control Systems 280 16.1 Other Microcontrollers 280 16.2 Microprocessor System 282 16.3 Control Technologies 288 16.4 Control System Design 298 Summary 299 Questions 301 Activities 301 Appendix A PIC 16F84 Data Sheet 302 Appendix B DIZI-2 Board and Lock Application 347 Index 367

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.