LCD显示的温度表的设计.docx
《LCD显示的温度表的设计.docx》由会员分享,可在线阅读,更多相关《LCD显示的温度表的设计.docx(8页珍藏版)》请在第一文库网上搜索。
1、-bGN16D2LC12 3 4 5 6 7Ddddddde-oC=33pfJ-JI1.C_C32.768kHzRA2RAIRA3RAORA40SC1MC1R0SC2VssVddRBORB7RB1RB6RB2RB5RB3RB4PIC16F84TemperatureDisp1ay8T1C5551651CDdisp1ayOfTemperatureTHERM.ASMShowsTemperaturefromThermistoron1CDINC1UDEp16f84.inc_CONFIG_PWRTE_0N&_1P_OSC&_WDT_0FF;uses32.768kHzcrysta1ERROR1EVE1-22
2、4ERROR1EVE1-302;supressannoyingmessagebecauseoftris;supressmessagebecauseofpagechange;DefineInformation#DEFINERSPORTA,0#DEFINEEPORTA,1;Macro;RAOisRS1ineof1CD;RA1isE1ineOf1CD;RB0-RB3areD4-D7of1CDEStrobeMACRO;StrobetheErBitbsfEbcfEENDMCB1OCKOCHTemp;atemporaryvariab1ecount;counterbin;binarynumbertobeco
3、nvertedtoBCDhundreds;BCDhundredsresu1t1ens_and_ones;BCDtensandonesresu1tsavetmr;usedtosaveva1ueoftmrdispva1ue;usedtoho1dtemperaturetobedisp1ayedtab1eindex;pointstotab1eva1uetodisp1ayENDCORGO;startat1ocation0gotomain;jumpovertomainroutineDataformessagetobeoutputshomsg:addwfPC1,fmdtTMROVa1ue:,Om1dtTem
4、perature,O;MessagetoOutput;OutputtheCharactersRatiosofPresca1erpreratio:addwfPC1,f;se1ectoffsetusingWdtD,2D,4,D,8,D,16,D,32,D64D,128;Initia1izetheponsInit:cirfPORTAc1rfPORTBmov1wB,00010000,trisPORTAmov1wBWi1OOOOtrisPORTBmov1wB1OO1(X)Oir;RA4input,othersoutputs;RB4.RB5input,othersoutputs;pu11-upsenab1
5、ed;presca1erassignedtoRA4;presca1ersetto1:16optionreturn;Initia1izethe1CDinit1cd:mov1wD40ca11nmsecbcfRSmov1w0x03ca11Nybb1eOutca11D1ay5EStrobenopnopEStrobenopnopbcfRSmov1w0x02ca11Nybb1eOut;Wait40msecsbeforeReset;sendan8bi1instruction;ResetCommand;SendtheNybb1e;Wait5msecsbeforeSendingAgain;Wait244usee
6、sbeforeSendingtheSecondTime;Wait244useesbeforeSendingtheThirdTime;sendan8bitinstruction;Set4BitModenopnopmov1w0x028ca11SendINSmov1wOxO1Oca11SendINSmov1wOxOO1ca11SendINSca11D1ay5mov1w0x006ca11SendINSmov1wOx(X)C;4bit,21ine,5x7font;disp1ayshiftoff;C1eartheDisp1ayRAM;Note,Cantakeupto4.1msecs;incrementcu
7、rsor;disp1ayoncursoroffca11SendINSreturnSendthecharacterinWouttothe1CDSendASCIIadd1w0,SendCHARmovwfTempswapfTemp,wbsfRSca11Nybb1eOutmovfTemp,w;SendnbrasASCIIcharacter;SendtheCharactertothe1CD;SavetheTemporaryVa1ue;SendtheHighNybb1e;RS=1;Sendthe1owNybb1ebsfRSca11Nybb1eOutreturnSendaninstructioninWout
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- LCD 显示 温度表 设计