NOT YET RELEASED 91577-00 32BitMicroprocessor SW ED4 PR4.d

Transcription

32-Bit MicroprocessorStudent Workbook91577-00Edition 4 3091577000000

FOURTH EDITIONFourth Printing, June 2009Copyright June, 2003 Lab-Volt Systems, Inc.All rights reserved. No part of this publication may be reproduced, stored in a retrieval system,or transmitted in any form by any means, electronic, mechanical, photocopied, recorded, orotherwise, without prior written permission from Lab-Volt Systems, Inc.Information in this document is subject to change without notice and does not represent acommitment on the part of Lab-Volt Systems, Inc. The Lab-Volt FACET software and othermaterials described in this document are furnished under a license agreement or a nondisclosureagreement. The software may be used or copied only in accordance with the terms of theagreement.ISBN 978-0-86657-219-4Lab-Volt and FACET logos are trademarks of Lab-Volt Systems, Inc.All other trademarks are the property of their respective owners. Other trademarks and tradenames may be used in this document to refer to either the entity claiming the marks and names ortheir products. Lab-Volt System, Inc. disclaims any proprietary interest in trademarks and tradenames other than its own.

Lab-Volt License AgreementBy using the software in this package, you are agreeing tobecome bound by the terms of this License Agreement,Limited Warranty, and Disclaimer.This License Agreement constitutes the completeagreement between you and Lab-Volt. If you do not agreeto the terms of this agreement, do not use the software.Promptly return the FACET Resources on Multimedia(CD-ROM) compact discs and all other materials that arepart of Lab-Volt's FACET product within ten days toLab-Volt for a full refund or credit.1. License Grant. In consideration of payment of the licensefee, which is part of the price you paid for this Lab-Voltproduct, Lab-Volt, as Licensor, grants to you, the Licensee, anonexclusive, nontransferable license to use this copy of theCD-ROM software with the corresponding FACET Lab-Voltreserves all rights not expressly granted to the Licensee.2. Ownership. As the Licensee, you own the physical mediaon which the CD-ROM is originally or subsequently recordedor fixed, but Lab-Volt retains title to and ownership of thesoftware programs recorded on the original compact disc andany subsequent copies of the CD-ROM, regardless of theform or media in or on which the original and other copiesmay exist. This license is not a sale of the original softwareprogram of Lab-Volt's CD-ROM or any portion or copy of it.3. Copy Restrictions. The CD-ROM software and theaccompanying materials are copyrighted and containproprietary information and trade secrets of Lab-Volt.Unauthorized copying of the CD-ROM even if modified,merged, or included with other software or with writtenmaterials is expressly forbidden. You may be held legallyresponsible for any infringement of Lab-Volt's intellectualproperty rights that is caused or encouraged by your failure toabide by the terms of this agreement. You may make copiesof the CD-ROM solely for backup purposes provided thecopyright notice is reproduced in its entirety on the backupcopy.4. Permitted Uses. This CD-ROM, Instructor's Guide, and allaccompanying documentation is licensed to you, theLicensee, and may not be transferred to any third party forany length of time without the prior written consent of LabVolt. You may not modify, adapt, translate, reverse engineer,decompile, disassemble, or create derivative works based onthe Lab-Volt product without the prior written permission ofLab-Volt. Written materials provided to you may not bemodified, adapted, translated, or used to create derivativeworks without the prior written consent of Lab-Volt.5. Termination. This agreement is effective until terminated.It will terminate automatically without notice from Lab-Voltif you fail to comply with any provisions contained herein.Upon termination you shall destroy the written materials,Lab-Volt's CD-ROM software, and all copies of them, in partor in whole, including modified copies, if any.6. Registration. Lab-Volt may from time to time update theCD-ROM. Updates can be made available to you only if aproperly signed registration card is filed with Lab-Volt or anauthorized registration card recipient.7. Miscellaneous. This agreement is governed by the laws ofthe State of New Jersey.Limited Warranty and DisclaimerThis CD-ROM software has been designed to assure correctoperation when used in the manner and within the limitsdescribed in this Instructor's Guide. As a highly advancedsoftware product, it is quite complex; thus, it is possible that ifit is used in hardware configurations with characteristics otherthan those specified in this Instructor's Guide or inenvironments with nonspecified, unusual, or extensive othersoftware products, problems may be encountered by a user. Insuch cases, Lab-Volt will make reasonable efforts to assist theuser to properly operate the CD-ROM but withoutguaranteeing its proper performance in any hardware orsoftware environment other than as described in thisInstructor's Guide.This CD-ROM software is warranted to conform to thedescriptions of its functions and performance as outlined inthis Instructor's Guide. Upon proper notification and within aperiod of one year from the date of installation and/orcustomer acceptance, Lab-Volt, at its sole and exclusiveoption, will remedy any nonconformity or replace anydefective compact disc free of charge. Any substantialrevisions of this product, made for purposes of correctingsoftware deficiencies within the warranty period, will bemade available, also on a licensed basis, to registered ownersfree of charge. Warranty support for this product is limited, inall cases, to software errors. Errors caused by hardwaremalfunctions or the use of nonspecified hardware or othersoftware are not covered.LICENSOR MAKES NO OTHER WARRANTIES OF ANY KINDCONCERNING THIS PRODUCT, INCLUDING WARRANTIESOR MERCHANTABILITY OR OF FITNESS FOR APARTICULAR PURPOSE. LICENSOR DISCLAIMS ALLOBLIGATIONS AND LIABILITIES ON THE PART OFLICENSOR FOR DAMAGES, INCLUDING BUT NOT LIMITEDTO SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUTOF OR IN CONNECTION WITH THE USE OF THE SOFTWAREPRODUCT LICENSED UNDER THIS AGREEMENT.Questions concerning this agreement and warranty and allrequests for product repairs should be directed to the Lab-Voltfield representative in your area.LAB-VOLT SYSTEMS, INC.P.O. Box 686Farmingdale, NJ 07727Attention: Program DevelopmentPhone: (732) 938-2000 or (800) LAB-VOLTFax: (732) 774-8573Technical Support: (800) 522-4436Technical Support E-Mail: techsupport@labvolt.com

THIS PAGE IS SUPPOSE TO BE BLANKTable of ContentsUnit 1 – Trainer Familiarization .1Exercise 1 – Introduction to the Trainer .5Exercise 2 – Operating the Trainer .8Unit 2 – Bus Operations .11Exercise 1 – Bus States .15Exercise 2 – 32-Bit Bus Transfers .17Exercise 3 – Read and Write Cycles .19Exercise 4 – CPU Initialization.21Unit 3 – Memory Interfacing .23Exercise 1 – Memory Control Signals .28Exercise 2 – Memory Address Decoding.30Exercise 3 – Memory Data Transfers.32Unit 4 – I/O Interfacing .35Exercise 1 – DAC and ADC Ports .38Exercise 2 – PPI and Keypad Interface.40Exercise 3 – Display and Serial Port.42Unit 5 – Interrupt Processing.45Exercise 1 – Non-maskable Interrupts .53Exercise 2 – Maskable Interrupts.55Exercise 3 – Exceptions .58Unit 6 – Programming: Addressing Modes .61Exercise 1 – Immediate and Register Addressing Modes.68Exercise 2 – Memory Addressing Modes - I .70Exercise 3 – Memory Addressing Modes - II .72Unit 7 – Programming: 80386 Instructions .75Exercise 1 – Instruction Formats - I.78Exercise 2 – Instruction Formats - II.80Exercise 3 – Using the 80386 CPU Instructions - I .82Exercise 4 – Using the 80386 CPU Instructions - II.84i

Unit 8 – Troubleshooting.87Exercise 1 – Troubleshooting Basics .89Exercise 2 – 32-Bit Microprocessor Troubleshooting .90Unit 9 – Microprocessor Applications (Optional).91Exercise 1 – Application Board Familiarization.96Exercise 2 – DC Motor Control .98Exercise 3 – Temperature Control .100Appendix A – Safety . A-iiii

IntroductionThis Student Workbook provides a unit-by-unit outline of the Fault Assisted Circuits forElectronics Training (FACET) curriculum.The following information is included together with space to take notes as you move through thecurriculum. The unit objectiveUnit fundamentalsA list of new terms and words for the unitEquipment required for the unitThe exercise objectivesExercise discussionExercise notesThe Appendix includes safety information.iii

THISiv

32-Bit MicroprocessorUnit 1 – Trainer FamiliarizationUNIT 1 – TRAINER FAMILIARIZATIONUNIT OBJECTIVEUpon completion of this unit, you will be able to locate and describe the various components onyour circuit board, and demonstrate basic trainer functions.UNIT FUNDAMENTALSMicroprocessors have changed virtually every facet of our daily lives. They can be found inoffice, industrial, and personal computers, as well as scientific and medical instrumentation.Even the car you drive may have on-board microprocessors to monitor and control some of theengine and braking functions.A microprocessor, or Central Processing Unit (CPU), is a digital integrated circuit that canperform arithmetic and logic functions and transfer information to and from external devices.The block diagram shows a typical microprocessor system.The support devices that are usually found in a microprocessor circuit include other digitalIntegrated Circuits (ICs) for memory and Input/ Output (I/O) functions.Memory ICs are storage devices that contain information in binary form. Some of thisinformation is in the form of programs, or sets of instructions, for the CPU to execute.The CPU also uses part of the memory to store system information and calculation results. I/Odevices allow the CPU to communicate with the outside world. The CPU in your computer usesan input device to read your commands from the keyboard, and an output device to send text andgraphics information to the screen you are now viewing.Communication between the CPU and memory and I/O devices occurs on groups of connectinglines that are called buses. The binary information travels back and forth on the data bus.1

32-Bit MicroprocessorUnit 1 – Trainer FamiliarizationThe CPU uses the address bus to pinpoint the exact location to which or from which the data istransferred. The size of the buses (number of connecting lines) is a measure of the CPU'sprocessing power.The first microprocessors had a 4-bit data bus. In an output operation, for example, a 4-bit CPUcould only send a number in the range of 0 - 16 (24) in one operation. The CPU could send alarger number by making several successive transf

The 4-bit microprocessor quickly evolved into an 8-bit version, which could send a number as high as 256 (28) in one operation. The next generation developed a 16-bit data bus. The 80386 microprocessor on your circuit board is a 32-bit device. The largest number it can send is 4,294,967,296 (232).