




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
Preface
Duringtheearlyyearsofmicroprocessors,therewerefewengineerswitheducationandex
perienceintheapplicationsofmicroprocessortechnology.Nowthatmicroprocessorsandm
icrocontrollcrshavebecomepervasiveinsomanydevices,theabilitytousethemhasbcc
omealmostarequirementtbrmanytechnicalpeople.
Todaythemicroprocessorandthemicrocontrollerhavebecometwoofthemostpowerfult
oolsavailabletothescientistandengineer.Microcontmllcrshavcbeenembeddedinsoma
nyproductsthatitiseasytooverlookthefaetthattheygreatlyoutnumberpersonalcomp
liters.MillionsofPCsareshippedeachyear,butbillionsofmicrocontrollersshipannually.
Whileagreatdealofattentionisgiventopersonalcomputers,thevastmajorityofnew
designsarefbrembeddedapplications.ForeveryPCdesigner,therearethousandsofdesign
ersusingmicrocontrollersinembeddedapplications.Thenumberofembeddeddesignsisg
rowingquickly.Thepurposeofthisbookistogivethereaderthebasicdesignandanaly
sisskillstodesignreliablemicrocontrollerormicroprocessorbasedsystems.Theemphasis
inthisbookisonthepracticalaspectsofinterfacingtheprocessortomemoryandI/Od
evices,andthebasicsofinterfacingsuchadevicetotheoutsideworld.
Amajorgoalofthisbookistoshowhowtomakedevicesthatarcinhcrcntlyrcliablcby
design.Whilealotofattentionhasbeengivento“qualityimprove-ment,“themajority
oftheemphasishasbeenplacedontheprocessestharoccurafterthedesignofaproduct
iscomplete.Designdeficienciesareasig-nificantproblem,andcanbeexceedinglydiffi
culttoidentifyinthefieldThesetypesofqualityproblemscanbeaddressedinthedesig
nphasewithrelativelylittleeffort,andwithfarlessexpensethanwillbeincurredlateri
ntheprocess.Unfortunately,therearemanyhardwaredesignersandorganiza-tionsthat,fo
rvariousreasons,donotunderstandthesignificanceandex-penseofanunreliabledesign.
Thedesignmethodologypresentedinthistextisintendedtoaddressthisproblem.
Learningtodesignanddevelopamicrocontrollersystemwithoutanypracticalhands-onex
pcricnceisabitliketryingtolearntorideabikefromrcadingbook.Thus,anothergoal
istoprovideapracticalexampleofacompleteworkingproduct.Whatappearseasyon
papermayproveextremelydifficultwithoutsomerealworldexperienceandsomepotentia
llypainfulcrashes.
Inordertodoitright,it'sbesttoexamineandusearealdesign.Ontheotherhand,the
currentstateofthetechnology(surfacemountedpackaging,etc.)canmakethepracticals
ideproblematic.Inordertoaddressthisproblem,aspecialeducationalSystemDevelopme
ntKitisavailabletoaccompanythisbook(8031SDK).AHthedocumentationtoconstruct
anSDKisavailableonthecompanionCD-ROM.Thisinfo,alongwithupdatedinfonnati
onandapplicationexamples,isalsoavailableonthewebsiteforthisbook:http://www.hte.
com/echdbook.AlltheinformationneededtobuildtheSDKisavailablethere,aswellas
informationonhowtoordertheSDKassembled
andtested.
WhilesearchingforanappropriatetextforoneofthecoursesIteachinernbeddedcompu
terengineering,Iwasunabletolocateabookthatcoveredthetopicadequately.Anearlie
rversionofthisbookwaswrittentoaccom-panythatcourseandhassinceevolvedinto
whatyouseehere.ThecourseisofferedattheUniversityofCalifornia,SanDiegoExte
ndedStudies,andistitled“EmbeddedControllerHardwareDcsign.^^Thesamecoursesma
yalsobetakeninanon-lineformatusingtheInternet,andcanbefoundathttp://vvww.hte.
com/uconline/ecdThegoalsofthecourseandthebookareverymuchthesame:todescri
betherightwaytodesignembeddedsystems.
Whilenopriorknowledgeofmicrocontrollersormicroprocessorsisrequired,thereadersh
ouldalreadybefamiliarwithbasicelectronics,logic,andbasiccomputerorganization.Cha
pteroneisintendedasareviewofthosebasicconcepts.Nextthereisageneraloverview
ofmicrocontrollerarchitecture,andaspecificmicrocontrollerchiparchitecture,the8051f
amily,isintroducedanddetailed.The8051waschosenbecauseitcanbeinterfacedtoex
ternalmemory,hassimpletimingspecs,iswidelyusedandavailablefromanumberofma
nufacturers.Theconceptsofworst-casedesignandanalysisarcdcscribcdalongwithtcchni
quesforhardwareinterfacing.Agoodembeddeddesignrequiresfamiliaritywiththeunderl
yingmemorytechnology,includingROM,SRAM,EPROM,FlashEPROM,EEPROMstora
gemechanismsanddevices.Theprocessorbusinterfaceisthencoveredingeneralform,
alongwithanintroductiontothe8051'sbusinterface.Mostembeddeddesignscanalsobe
netitfromtheuseofuserprogrammablelogicdevices(PLD).Thissubjectistoocomplex
forin-depthcoveragehere,soPLDtechnologyiscoveredfromarelativelyhighlevel.T
hecentralthemeofdesigninganembeddedsystemthatcanbeproventobereliableisill
ustratedwithasimpleembeddedcon-troller.Theiterativenatureofthedesignprocessis
shownbyexample,andseveraldesignalternativesareevaluated.Withthecentralpartof
thedesigncompleted,theremainingchapterscoverthevarioustypesofI/Ointerfaces,bus
operations,andacollectionofinformationthatisseldomincludedintheusualsources,b
utisoftenhandeddownfromoneengineertoanother.
Ihopethatyouwillfindthisbooktobeuseful,andwelcomeanyobservationsandcontri
butionsyoumayhave.Ifyoushouldfindanyerrorsinthetext,orifyouknowofsome
goodembeddeddesignresources,pleasefeelfreetocontactmedirectlybye-mail:ken.ar
nold@
CHAPTERONE
ReviewofEleclronicsFundamenlals
Whyaremicroprocessorsandmicrocontrollersdesignedintosomanydifferentdevices?W
hiletherearcmanydryandpracticalreasons,Isuspectoneofthestrongestmotivationsf
orusingamicroprocessorissimplythatitisalotmorefun.Overthepastfewdecades
oftheso-called“computerrevolution/5Ihaveseenmanyproductsandprojectsthatcould
havebeenhandledwithoutresortingtoamicroprocessor.Yetthereisalwaysatendencyt
orationalizethechoiceofamicro-basedsolutionbyeconomicortechnicalargumentstos
upportthedecision.Infact,mostofthereallyexcellentproductsweresuccessfultoagre
atextentbecausetheywerefuntodevelop.Manyofthebestproductideashaveoccurred
whensomeonewas“playing“withsomethingtheywereintcrcstcdin.Inmyownexperien
ce,IhavefoundlearningsomethingnewismucheasierandmoreeffectivewhenIam"j
ustplayingaround”ratherthantryingtolearninastructuredwayoragainstadeadline.
Studiesofvariouscduca-tionalmethodsalsoindicate“coachedcxploration^^ismoreeffect
ivethanthetraditionalmethods.Theseandotherobservationsleadmetotheconclusionth
atthebestwaytolearnaboutamicrocontrollerisby“playing”withone.
Nobook—nomatterhowwellwritten-canpossiblymotivateandcducateyouaswellas
buildingandplayingwithamicrocontroller.Thebestwaytolearntheconceptsinthisbo
okistobuildasimplemicrocontroller.Evenititiscapableofnothingmorethanblinkin
galight,itwillprovideaconcreteexampleofthemicrocontrollerasatoolthatcanbef
untouse.Toeasethiseffort,acompanionsystemdevelopmentkit(SDK),isavailableto
accompanylhistext.Itincorporatesthefunctionsofastand-alonesingleboardcomputed
SBC),andanin-circuitemulator(ICE).Italsoservesasasampleembeddedcontrollerde
sign.ThedesignisincludedontheCD-ROMandwebsiteforthisbook,soanyonecan
reproduceanduseitasalearningtool.Byapplyingtheguidelinessetforthinthisbook
torealworldhardware,youcanlearntodesignreliableembeddedhardwareintootherpr
oducts.InformationonobtainingtheSDKcanbefoundinthePreface.
Objectives
Severaldifferentskillsarerequiredforsuccessfulembeddedhardwaredesign.Hereareso
meofthethingsyouwillknowhowtodowhenyoufinishthisbook:
*Interpretdesignrequirementsforthedesignofanembeddedcontroller.
*Readandunderstandthemanufacturer'sspecificationsheet.
*SelectappropriateICsforthedesign.
*InterfacetheCPU,memory,andI/Odevicestoacommonbus.
*DesignsimpleI/O(inpuCoutput)interfaces.
*Definethedecodingandinterconnectionofthemajorcomponents.
*Performaworst-caseanalysisofthetimingandloadingofallsignals.
*Understandthesoftwaredevelopmentcycleforamicrocontroller.
*Debugandtestthehardwareandsoftwaredesigns.
Thesetasksrepresentthemajorskillsrequiredinthesuccessfulapplicationofanembedde
dmicro.Inaddition,otherabilities——suchasthedesignandimplementationofsimpleuser
programmablelogic-willbecoveredasrequiredtosupporttheproficientapplicationoft
hetechnology.
EmbeddedMicrocomputerApplications
Thereisanincrediblediversityofapplicationsfbrembeddedprocessors.Mostpeopleare
awareofthehighlyvisibleapplications,buttherearemanylessapparentuses.Manyoft
heprojectsmystudentshavechosenturnedouttobeofpracticaluseintheirwork.How
ever,theyhavecoveredtheentirerangefromtheeconomicallypracticaltotheblatantlya
bsurd.Onepracticalexamplewastheuseofamicroprocessortomonitorandcontrolthe
ratioofingredientsusedinmixingconcrete.Aboutayearafterthestudentimple-mentedt
hesystem,hewrotetoinformmethatthesystemhadsavedhiscom-panybetweentwo
andthreemilliondollarsayearbyreducingthenumberof“badbatches”ofconcretetha
thadtobejackhammeredoutandreplaced.
Anotherexamplewasthatofastudentwhosuspendedaballbyairflowgener-atedbya
fanandprovidedclosedloopcontroloftheball'spositionwiththemicroprocessor.The
onlythingthatmanyofthestudentprojectsreallyhadincommonwastheuseofamicr
ocontrollerasatool.Someoftheactualcommercialapplicationsofembeddedcomputerc
ontrolsthattheauthorhasbeendirectlyinvolvedwithinclude:
*Abeltmeasuresaperson'sheartrateandrespirationthatsignalsanalarmwhensafeli
initsareexceeded.Aradiosignalisthentransmittedtoainicrocontrollerinapocketpage
rtodisplaythetypeofproblemandtheidentityofthebelt.
*Anenvironmentalsystemcontrolstheheatingventilatingandaircondi-tioninginoneo
rmorelargebuildingstominimizepeakenergydemands.
*Asystemthatmeasuresandcontrolstheprocessofetchingawaytheunwantedportions
ofmaterialfromthesurfaceofanintegratedcircuitbeingmanufactured.
*Thefarecollectionsystemusedtomonitorandcontrolentrytoarapidtransitsystemb
asedontheaccountbalancestoredonthemagneticstripeonacard.
*Determinationofexactgeographicpositionontheearthbymeasuringthetimeofarriva
Iofradiosignalsreceivedfromnavigationalbeacons.
*Anintelligentphonethatreceivesradiosignalsfromsmokealarms,intru-sionsensors,
andpanicswitchestoalertacentralmonitoringstationtopotentialemergencysituations.
*Afuelcontrolsystemthatmonitorsandcontrolstheilowoffueltoaturbinejetengin
e.
Selectingaparticularprocessorforagivenapplicationisusuallyafunctionofthedesigne
r'sfamiliaritywithaparticulararchitecture.Whiletherearemanyvariationsinthedetails
andspecificfeatures,therearetwogeneralcategoriesofdevices:microprocessorsandmi
crocontrollers.Thekeydifferencebetweenamicroprocessorandamicrocontrolleristhata
microprocessorcontainsonlyamoryandI/OonthechipinadditiontoaCPU.Microcont
rollersaregenerallyusedtbrdedicatedtasks.Microcomputerisageneraltermthatapplies
tocompletecom-putersystemsimplementedwitheitheramicroprocessorormicrocontrol
Icr.
MicrocomputerandMicrocontrollerArchitectures
Microprocessorsaregenerallyutilizedforrelativelyhighperformanceappli-cationswhere
costandsizearenotcriticalselectioncriteria.Becausemicro-processorchipshavetheire
ndrefunctiondedicatedtotheCPUandthushaveroomformorecircuitrytoincreaseexe
cutionspeed,theycanachieveveryhigh-levelsofprocessingpower.However,microproces
sorsrequireexternal
memoryandI/Ohardware.MicroprocessorchipsareusedindesktopPCsandworkstations
wheresoftwarecompatibility,performance,generality,andflexibilityareimportant.
Bycontrast,microcontrollerchipsareusuallydesignedtominimizethetotalchipcountan
dcostbyincorporatingmemoryandI/Oonthechip.Theyarcoftcn"'applicationspccializ
ed“attheexpenseofflexibility.Insomecases,themicrocontrollerhasenoughresources
on-chipthatitistheonlyICrequiredforaproduct.Examplesofasingle-chipapplication
includethekeyfobusedtoarmasecuritysystem,atoaster,orhand-heldgames.Theh
ardwareinterfacesofbothdeviceshavemuchincommon,andthoseofthemicrocontroller
saregenerallyasimplifiedsubsetofthemicroprocessor.Theprimarydesigngoalsforeach
typeofchipcanbesummarizedthisway:
*microprocessorsaremostflexible
*microcontrollersaremostcompact
TherearealsodifferencesinthebasicCPUarchitecturesused,andthesetendtoreflectth
eapplication.MicroprocessorbasedmachinesusuallyhaveavonNeumannarchitecturewit
hasinglememoryforbothprogramsanddatatoallowmaximumflexibilityinallocation
ofmemory.Microcontrollerchips,ontheotherhand,frequentlyembodytheHarvardarch
itccturc,whichhasseparatcmemoriesforprogramsanddata.Figure1-1illustratesthisdif
ference.
Figure1-1:AtleftisthevonNeumannarchitecture;atrightistheHarvardarchitecture.
OneadvantagetheHarvardarchitecturehasforembeddedapplicationsisduetothetwot
ypesofmemoryusedinembeddedsystems.Afixedprogramandconstantscanbestored
innon-volatileROMmemorywhileworkingvariabledatastoragecanresideinvolatile
RAM.Volatilememorylosesitscontentswhenpowerisremoved,butnon-volatileROM
memoryalwaysmaintainsitscontentsevenafterpowerisremoved.TheHarvardarchitectur
ealsohasthepotentialadvantageofaseparateinter-faceallowingtwicethememorytra
nsferratebyallowinginstructionfetchestooccurinparallelwithdatatransfers.Unfortuna
tely,inmostHarvardarchi-tecturemachines,thememoryisconnectedtotheCPUusing
abusthatlimitstheparallelismtoasinglebus.Atypicalembeddedcomputerconsistsof
theCPU,memory,andI/O.Theyaremostoftenconnectedbymeansofasharedbusfor
communication,asshowninFigure1-2.
TheReeil
World
L________________________________________________
Theperipheralsonamicrocon-trollerchiparetypicallytimers,counters,serialorparallel
data
ports,andanalog-to-digitalanddigital-lo-analogconvertersthatareintegrateddirectlyonthe
chip.Theperformanceoftheseperipheralsisgenerallylessthanthatofdedicatedperipheral
chips,whicharcfrequentlyusedwithmicroprocessorchips.However,havingthebusco
nnec-tions,CPU,memory,andI/Ofunctionsononechiphasseveraladvantages:
*Fewerchipsarerequiredsincemostfunctionsarealreadypresentontheprocessorchip.
*Lowercostandsmallersizeresultfromasimplerdesign.
*Lowerpowerrequirementsbecauseon-chippowerrequirementsaremuchsmallerthane
xternalloads.
*Fewerexternalconnectionsarerequiredbecausemostaremadeon-chip,andmostofth
cchipconnectionscanbeusedfbrI/O.
*MorepinsonthechipareavailablefbruserI/Osincetheyaren'tneededfbrthebus.
*Overallreliabilityishighersincetherearefewercomponentsandinterconnections.Ofc
oursetherearedisadvantagestoo,including:
*Reducedflexibilitysinceyoucan*leasilychangethefunctionsdesignedintothechip.
*ExpansionofmemoryorI/Oislimitedorimpossible.
*Limiteddatatransferratesduetopracticalsizeandspeedlimitsforasingle-chip.
*LzowerperformanceI/Obecauseofdesigncompromisestofiteverythingononechip.
DigitalHardwareConcepts
InadditiontotheCPU,memory,andI/Obuildingblocks,otherlogiccircuitsmayalsobe
equired.Suchlogiccircuitsarefrequentlyreferredtoasgluelogicbecausetheyareused
toconnectthevariousbuildingblockstogether.Themostdifficultandimportanttaskth
ehardwaredesignerfacesistheproperselectionandspecificationofthis“gluelogic."D
evicessuchasregisters,buffers,driversanddecodersarefrequentlyusedtoadaptthecont
rolsignalsprovidedbytheCPUtothoseoftheotherdevices.WhileTTLgatelevellog
icisstillinuseforthispurpose,theprogrammablelogicdevice(PLD)hasbe-comean
importantdeviceinconnectingthebuildingblocks.Contemporarymicrocontrollerdesigner
sneedtoacquirethefollowingskills:
*Interpretationofmanufacturersspecifications
*Detailed,worstcasetiminganalysisanddesign
*Worstcasesignalloadinganalysis
*Designofappropriatesignalandlevelconversioncircuits
*Componentevaluationandselection
*Programmablelogicdeviceselectionanddesign
Thegluelogicusedtojointheprocessor,memories,andI/Oisultimatelycomposedof1
ogicgates,whicharethemselvescomposedalmostentirelyoftransistors,diodes,resistors,
andinterconnectingwires.Inordertounder-standthebasicoperationofthegluelogic,
wearegoingtobeginatthecom-ponentlevelwithareviewofbasicelectronicsconcept
s.Theseconceptswill
bepresentedasfluidflowanalogies.
Voltage,Current,andResistance
InFigure1-3,abatteryprovidesavoltagesourceforelectricity,muchlikeapumpprovide
sapressuresourceforafluid.Voltage,orpressure,isrequiredtoproducccurrcntflowint
hecircuit.
VoltageSourcePressureis
analagous
toVoltage
Figure1-3:Voltageinanelectricalcircuitis
analogoustopressureinafluid.
Thevoltagesourceprovidesthepressure“motivation,“ifyouwill,fbrcurrentflow.Resista
neepro-videsalimitingconstraintontheamountofcurrentthatwillactuallyflow.The
resistorwillallowacurrenttoflowthroughitthatisproportionaltothevoltageacrossi
t,andinverselyproportionaltotheresistancevalue.Higherresistanceislikeasmallerap
ertureforthefluidtoflowthrough.Theresistanceresultsinavoltage,orpressuredrop,
acrosstheresistanceaslongascurrentisflowingintheresistor.Figure1-4illustratesth
is.
Restricts
ResistorCurrent
Restrictionof
CurrentFlow
Figure1-4:Resistanceinanelectricalcircuitis
analogoustoarestrictioninthe"owofafluid.
Thewiringconnectingthecom-ponentsinacircuitislikethepipingconnectingplumbin
g
componentsthatletafluidflow.Theflowofcurrentinthecircuitiscontrolledbythem
agnitudeofthevoltage(pressure)andtheresistance(pressuredrop)inthecircuit.InFigur
e1-5,thebatteryprovidesavoltagetoforcecurrentthroughtheresistor.Themagnitude
ofthevoltage(V)generatedbythebatteryisdevelopedacrosstheresistor,andthemag
nitudeoftheresis-tance(R),determinethecurrent(I),Notethe“return“currentpathi
softenshownas“ground,“whichisthereferencevoltageusedastheuzerovolts”p
oint.Inthiscase,currentflowsfromthepositivebatteryterminal,throughthewire,then
theresistor,thenthroughthe“ground”connectiontotheminusterminalofthebatter
y.Thisisusuallynotthesameasearthground,
whichprovidesaconnectiontoastakeorpipeliterallystuckintheground.Thcmagnitud
eofthecurrentinthiscaseisI=V/Rbyre-arrangingtheequationV=I*R,ass
howninFigure1-5.ThisisknownasOhm'slaw.Anotherwaytolookatitisthatwh
cncvcrcurrentflowsthrougharesistonthcrcisadropinvoltageacrosstheresistorduet
otherestrictionincurrent..
Cixrent(0
through
R?$t$tor(K)
cases
voila,
drop(V)
V=IR
PowerdtssipakdinKesKtor
isp=PR=VI=¥
Figure}-5.Vo/faqcacrossRisequaltocurrentnmitfjlicdbyresistance.
theirperformanceintherealworldandaresubjecttootherlimitations,suchasoperating
temperature,powerlimits,etc.Currentflowsonlythroughacompletecircuit,andinmost
cases(forapositivepowersupply)currentflowsfromthepowersourcethroughthecirc
uitryandreturnstothepowersupplythroughthecommon“ground”connection.Current
flowingthroughanyresistanceresultsinthedissipationofpowerasheat.Thepowerdi
ssiatedisP=IA2R=V*I=VA2/R.Notethatvoltageissometimesdenotedbytheva
riableVandsometimesbyE,forelectromotiveforce.
Allpracticalcomponentshavesomeresistance.Realbatterieshaveaninternalresistance,
forexample,whichprovidesanupperlimittothecurrentthebatterycansupplytoane
xternalcircuit.Realwireshaveresistanceaswell,sotheactualperformanceofacircuit
willdeviatesomewhatfromtheidcaLTheseeffectsarcobviousinsomecases,butnotin
others.Inanautomobilestartingcircuit,it'snotsurprisingthatthebattery,supplying1
2voltstoastarterwithinternalresistanceontheorderof0.01to0.1ohms,wiJresult
incurrentsofhundredsofamperesinordertostarttheengine.Ontheotherhand,while
consultingwithaprominentnotebookcomputermanufacturer,
Iuncoveredadesignerrorresultinginaninternalcurrentofhundredsofamperesflowin
ginthecircuitforafewnanoseconds.Obviously,thiswreakedhavocontheoperationo
fthecomputer,andgeneratedagreatdealofclcctro-magncticnoise!
Oneofthethingsyouwilllearninthisbookishowtoavoidthosekindsofmistakes.It
'salsoimportanttorememberthatpowerisdissipatedinanyresistancepresentintheci
rcuit.Thepowerisproportionaltothevoltagetimesthecurrentacrosstheresistance,wh
ichisdissipatingthepower.Inthelasttwoexamples,theamountofpowerdissipatedin
stantancouslyisquitehighwhilethecurrentisflowing.Whenthecurrentpulseisonlya
fewnanosecondslong,however,itmaynotbeobvious,sincetherewon'tbemuchheat
generated.
Diodes
Thediodeisasimpleseiniconductordeviceactingasa“oneway”currentvalve.Itonly
letscurrentflowinonedirection.Figure1-6illustrateshowthediodeoperateslikea
“one-way“fluidvalve.(Puristspleasenote:Thisbookdoesnotuseelectroncurrentflow.
Allelectricalcurrent
flowwillbeupositivevoruconventionalnCurrentflow,meaningcurrent)
CurrentDiodeisanalqous
.____toaone-wayvalve.
/、Currentcanonly
flowinonedirection.
CurrentFl6V$
Valve
-Closed"
NoCurrent
Rows
riigurr)-6.Adiodetocicctricityisa^aioqoustoavafvcinthe
(lowotatkiid.
Transistors
Theflowanalogycanalsobeusedtomodelhowatransistoroperatesinalogiccircuit.
Thetransistorisanamplifier.Itusesasmallamountofenergytocontrolalargerener
gysource,justasavalvecontrolsahigh-pressurewatersource.Therearetwokindsof
transistors:bipolarandfield-effecttransistors(FETs).Wewilllookatbipolartransistorsfir
st;theseamplifycurrent.Asmallamountofcurrentflowsinthecontrolcircuit(thetran
sistorbase-emittercircuit)toturnthetran-sistoron.Thiscontrolcurrentisamplified(mu
Itipliedbythegainorbetaofthetransistor)andallowsalargercurrenttoflowintheo
utputcircuit(thecollector-emittercircuit).Onceagain,thedeviceisnotperfectbecauseo
ftheresistance,current,gain,andleakagelimitationsofrealtransistors.Bipolartransistor
scomeintwopolari-ties,NPNandPNP,withthedifferencebeingthedirectioninwhic
hcurrentflowsfornormaloperation.AbipolarPNPtransistorisshownandmodeledin
Figure1-7.
FigureJ?8.CjperafiocotabipolarNPNtramiitor.
FigureJ?7:Opcrohor?ofabipolarPNPiransistor.
MechanicalSwitches
Mechanicalswitchesareusefulfordirectinputtodigitalcircuits.Oneofthemoreconven
ientversionsisabankofrockerswitchespackagedintoamodulethatcanfitintothesa
melocationasastandardchip.Thedualin-linepackage,orDIRswitchisoneofthee
asiestwaystoaddmultipleswitchestoamicro-controllerdesign.Themechanicalswitch
hasextremelylow“on"Resistanceandhigh“off"resistance,unlikemostsemicondu
ctorswitches.Figure1-9showsatypicalDIPswitchandtheschematicsymbolforit.
figureb欠8-posrttonD(Psmfchandschematicequivdent.
TransistorSwitchON
Transistorscanbeconfiguredtofunctionasswitches.AscanbeseeninFigureI-10,an
NPNtransistoroperatingasacurrentcontrolledswitchcanbeusedtobuildasimplein
vcrtcr.Itchangesalogiconeonitsinputtoalogiczeroatitsoutput,andviceversa.I
nthiscase,logiconeisrepresentedasapositivevoltage,andalogiczeroisrepresented
byzerovolts.Thelogicone
input(positiveinputvoltage)issuppliedthrougharesistorfromthepowersupplyvoltag
etothetransistorbaseterminal,resultinginasmallbasecontrolcurrentintothebase.
TransistorInverterTransistorInverter
InputI->Output0EquivalentCircuit
TranilstorSwitch"ON"EquivalentCircuit
riqiirrI-10.Thetransistorinverter;irput=JandtransistorON.Thetransistor
ONconfigurationisatidtandtherouivafoifctrcuifisatnqnf.
Thetransistorisusedbecauseithasgainallowingalargeroutputcurrenttoflowascon
trolledbyaweakerinput.Whenthetransistoristurnedonasmuchasitcanbe,theco
Hectoremittercircuitlooksalmostlikeashortcircuit,effectivelyconnectingtheoutputt
ogroundorzerovolts.Thisgivesalogiczeroonthecollectoroutput.Whenthetransist
orcollectorisshortedtoground,currentflowsfromthesupplythroughtheresistorandi
ntothetransistorcollectortoground.Thetransistorissaidtosinktheresistorcurrentint
oground.Ifthereisanexternalload,suchasanotherinverterorgate,connectedtothe
collectoroutp
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 勞動合同違約責(zé)任及典型案例分析
- 家庭用工合同模板參考范本
- 篇二:購房合同范本規(guī)范
- 室內(nèi)防水改造合同范本
- 定制旅行服務(wù)協(xié)議合同
- 房地產(chǎn)開發(fā)施工合同樣本
- 金融市場中銀行承兌質(zhì)押合同的法律效力
- 兼職市場拓展合同樣本
- 發(fā)射設(shè)備在極端環(huán)境下的穩(wěn)定性檢測考核試卷
- 塑膠跑道材料的生產(chǎn)工藝與質(zhì)量控制考核試卷
- 《智慧旅游認知與實踐》課件-第九章 智慧旅行社
- 馬工程《刑法學(xué)(下冊)》教學(xué)課件 第16章 刑法各論概述
- 唐詩三百首(楷書)
- (新版)公用設(shè)備工程師《專業(yè)知識》(給排水)考試題庫及答案
- 01-第一章運動學(xué)緒論PPT課件
- 電動車智能充電器的設(shè)計與制作畢業(yè)論文
- 軟件系統(tǒng)部署方案
- 第九套廣播體操動作要領(lǐng)及圖解.
- JWF1312B中文說明書-2017-3-2(1)(1)
- 系統(tǒng)命名法[教學(xué)參考]
評論
0/150
提交評論