外文翻译Word文档下载推荐.docx
《外文翻译Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《外文翻译Word文档下载推荐.docx(9页珍藏版)》请在冰豆网上搜索。
年级班级12-05
学生姓名于潇翔
指导老师朱艺锋
2016年6月8日
AT89C51In-CircuitProgramming
T.Islam,S.Ghosh,H.Saha
Thisapplicationnoteillustratesthein-circuitprogrammabilityoftheAtmelAT89C51Flash-basedmicrocontroller.Guidelinesfortheadditionofin-circuitprogrammabilitytoAT89C51applicationsarepresentedalongwithanapplicationexampleandthemodificationstoitrequiredtosupportin-circuitprogramming.AmethodisthenshownbywhichtheAT89C51microcontrollerintheapplicationcanbereprogrammedremotely,overacommercialtelephoneline.Thecircuitrydescribedinthisapplicationnotesupportsfivevoltprogrammingonly,requiringtheuseofanAT89C51-XX-5.ThestandardAT89C51requires12voltsforprogramming.ThesoftwareforthisapplicationmaybeobtainedbydownloadingfromAtmel’s
GeneralConsiderations
CircuitryaddedtosupportAT89C51incircuitprogrammingshouldappeartransparenttotheapplicationwhenprogrammingisnottakingplace.
EA/VPPmustbeheldhighduringprogramming.Inapplicationswhichdonotutilizeexternalprogrammemory,thispinmaybepermanentlystrappedtoVCC.Applicationsutilizingexternalprogrammemoryrequirethatthispinbeheldlowduringnormaloperation.
RSTmustbeheldactiveduringprogramming.Ameansmustbeprovidedforoverridingtheapplicationresetcircuit,whichtypicallyassertsRSTonlybrieflyafterpowerisapplied.
PSENmustbeheldlowduringprogramming,butmustnotbedrivenduringnormaloperation.
ALE/PROGispulsedlowduringprogramming,butmustnotbedrivenduringnormaloperation.
Duringprogramming,AT89C51I/Oportsareusedfortheapplicationofmodeselect,addressesanddata,possiblyrequiringthatthecontrollerbeisolatedfromtheapplicationcircuitry.Howthisisdoneisapplicationdependentandwillbeaddressedhereonlyingeneralterms.
PortUsedforInput
Duringprogramming,thecontrollermustbeisolatedfromsignalssourcedbytheapplicationcircuitry.Abufferwiththreestateoutputsmightbeinsertedbetweentheapplicationcircuitryandthecontroller,withthebufferoutputsthree-statedwhenprogrammingisenabled.Alternately,amultiplexermightbeusedtoselectbetweensignalsources,withsignalsappliedtothecontrollerbyeithertheapplicationcircuitryortheprogrammercircuitry.
PortUsedforOutput
Nocircuitchangesarerequirediftheapplicationcircuitrycantoleratethestatechangeswhichoccurattheportduringprogramming.Ifthepriorstateoftheapplicationcircuitrymustbemaintainedduringprogramming,alatchmightbeinsertedbetweenthecontrollerandtheapplicationcircuitry.Thelatchisenabledduringprogramming,preservingthestateoftheapplicationcircuitry.
AnApplicationExample
TheAT89C51applicationshowninFigure1isanimplementationofamovingdisplay.Thisapplicationwasselectedforitssimplicityandabilitytoshowgraphicallytheresultsofin-circuitreprogramming.Thetexttobedisplayedisprogrammedintothecontrolleraspartofitsfirmware,andcannotbechangedwithoutreprogrammingthedevice.
Thedisplayedtextispresentedinoneoftwomodesselectedbythefour-positionDIPswitch.Inthefirstmode,onecharacteratatimeentersthedisplayfromtherightandmovesquicklytotheleftthrougheachelementofthedisplaytoitsfinalpositionintheassembledmessage.Inthesecondmode,themessagemovesthroughthedisplay,fromrighttoleft,withthedisplayactingasawindowontothemessage.Thismodeisfamiliarasthemethodoftenusedindisplaysofstockprices.
TheoutputconsistsoffourDL1414T,four-digit,17-segmentalphanumericdisplayswithintegraldecodersanddrivers.Thisyields16totaldisplayelements,eachcapableofdisplayingdigits0-9,theuppercasealphabet,andsomepunctuationcharacters.ThedisplayablecharactercodesareASCII20H-5FH.
Apower-onresetcircuitanda6-MHzcrystaloscillatorcompletetheapplication.Neitherexternalprogrammemorynorexternaldatamemoryisused.
ModificationstotheApplicationtoSupport
In-CircuitProgrammingFigure2showstheapplicationmodifiedforin-circuitprogramming.
Itisassumedthattheprogrammer,wheninactive,willneitherdrivenorexcessivelyloadtheapplication.Sincetheapplicationdoesnotuseexternalprogrammemory,EA/VPPonthecontrollerisconnectedtoVCC.Thismeetstherequirementforprogramming.
Theresetcircuithasbeenmodifiedbytheadditionoftwotransistors,whichallowRSTonthecontrollertobeforcedhighbytheprogrammer.
PSENandALE/PROG,unusedinthebasicapplication,areunderthedirectcontroloftheprogrammer.
ProgrammingrequiresprogrammeraccesstoallofthefourAT89C51I/Oports,asdocumentedinthedatasheet.Theprogrammerisconnecteddirectlytothosecontrollerpinswhichareunusedbytheapplication,whileaccesstopinsusedbytheapplicationrequiresspecialtreatment,asexplainedinthefollowingparagraphs.
TheleastsignificantfourbitsoftheaddressgeneratedbytheprogrammeraremultiplexedontoportoneofthecontrollerwiththedatafromtheDIPswitch.Notethatthefourresistorsaddedattheswitcharenotrequiredinthebasicapplication,sincetheAT89C51providesinternalpull-upsonportone.
Duringthenormaloperationoftheapplication,controllerportszeroandtwoprovidedataandcontrolsignals(respectively)tothedisplays.Duringprogrammingandprogramverification,theprogrammerassertscontrolofportzeroandpartofporttwo.Theprogrammerisconnectedtoportszeroandtwowithoutbuffering,since,wheninactive,itspresencedoesnotaffectthenormaloperationoftheapplication.
Atransparentlatchhasbeenaddedbetweenporttwoofthecontrollerandthedisplaycontrolinputs.Thelatchholdsthedisplaycontrolsignalsinactiveduringprogramming,whicheliminateserraticoperationofthedisplaysduetoprogrammeractivityonportszeroandtwo.Noisolationof
thedisplaydatainputsisrequired,sincedataappliedtotheinputsisignoredwhenthecontrolsignalsareinactive.
TheAT89C51resetcircuit,inputmultiplexerandoutputlatcharecontrolledbyasinglesignalgeneratedbytheprogrammer.Duringprogramming,resetisasserted,themultiplexerswitchesinputs,andthelatchfreezesthedisplaycontrollines.
Toensurethatthedisplaycontrollinesareinaknownstatebeforetheyarelatched,anAT89C51externalinterruptisusedtoallowtheprogrammertosignaltheapplicationbeforeassertingreset.Theapplicationfirmwarerespondstotheinterruptbydisplayingamessageanddeactivatingthedisplaycontrollines.
Afterprogramming,whenresetisdeasserted,thecontrollerportsarehighasthelatchbecomestransparent.Sincethedisplaycontrolinputsareinactivehigh,thedisplaycontentsarenotdisturbeduntilthenewprogramwritesthedisplay.Althoughnotessentialtothisapplication,itmightbeimperativeinsomeapplicationsthatthestateoftheperipheralcircuitrynotbedisturbedduringprogramming.
TheProgrammer
Theprogrammer(Figure3)generatestheaddresses,dataandcontrolsignalsnecessarytoprogramtheAT89C51embeddedintheapplication.
TheprogrammercircuitryconsistsofanAT89C51andanRS-232leveltranslator.Thecontrollerrunsat11.0592MHz,whichallowstheserialporttooperateatanumberofstandardbaudrates.AMaximMAX232linedriver/receiverproducesRS-232levelsattheserialinterfacewhilerequiringonlyafivevoltsupply.
Manyofthesignalsgeneratedbytheprogrammerareconnecteddirectly,withoutbuffering,totheAT89C51intheapplication.Thesesignals,wheninactive,arenotthreestated,butarepulledhigh.TheAT89C51hasinternalpull-upsofapproximatelythreeKohmsonportsone,twoandthree.Becauseportzerodoesnothaveinternalpull-ups,externalpull-upsoftenKohmshavebeenaddedtopermitproperoperationofprogramverificationmode.Thesampleapplicationoperatescorrectlyinthisenvironment.Ifrequiredforcompatibilitywithanapplication,programmersignalsmaybebufferedwiththree-statebufferssimilartothe74xx125.
TheAT89C51intheprogrammerdoesnotutilizeexternalprogramordatamemory,whichwouldrequiresacrificingneededI/Opins.ThisrequiresthatprogramcodeandI/Obuffersbekeptsmallenoughtofitinon-chipmemory.
RemoteProgrammingOveraCommercial
TelephoneLine
Theprogrammeranddisplayapplicationdescribedpreviouslyareconnectedtoaphonelineviaamodemataremotesite.Usingapersonalcomputerwithamodem,ausercanuploadanewprogramcontaininganewmessage,whichisprogrammedintotheAT89C51embeddedintheapplication.Whenprogrammingiscomplete,theapplicationexecutesthenewprogram,whichdisplaysthenewmessage.
LocalStation
ThelocalstationinthetestconfigurationconsistsofanIBMPCAT-classcomputerconnectedtoaHayes-compatible,Prometheus1200baudmodem.Themodemwasselectedbecauseitwasinexpensiveandavailable.Afastermodemmaybeusedifdesired,althoughoncethefiletransmissiontimeisreducedbelowoneminute,furtherreductionsintransmissiontimedonotfurtherreduceconnecttimecharges.Apossibleadvantagetohighertransmissionspeedsistheautomaticerrordetectionandcorrectionavailableinsomehighspeedmodems.
ProcommPlusversion2.01,acommercialdatacommunicationspackage,isusedtoconfigurethemodem,setupcommunicationsparameters,andestablishalinkwiththeremotemodem.ProcommPlusincludesamacrolanguagecalledASPECT,whichallowstheusertowriteandcompilescriptswhichimplementcustomfiletransferprotocols.AsimpleASPECTscriptwaswrittentoreadth