LCD显示的温度表的设计.docx
《LCD显示的温度表的设计.docx》由会员分享,可在线阅读,更多相关《LCD显示的温度表的设计.docx(8页珍藏版)》请在优知文库上搜索。
1、-bGN三16D2LC12 3 4 5 6 7Ddddddde-oC=33pfJ-JIL.C_C32.768kHzRA2RAIRA3RAORA40SC1MCLR0SC2VssVddRBORB7RB1RB6RB2RB5RB3RB4PIC16F84TemperatureDisplay8TLC555165LCDdisplayOfTemperatureTHERM.ASMShowsTemperaturefromThermistoronLCDLIST P=l6F84;16F84 Runs at 4 MHzINCLUDE pl6f84.inc_CONFIG _PWRTE_0N & _LP_OSC & _WD
2、T_0FF ; uses 32.768 kHz crystalERRORLEVEL -224ERRORLEVEL -302; supress annoying message because of tris ; supress message because of page change;Define Information#DEFINE RS PORTA, 0#DEFINE E PORTA, 1;Macro;RAO is RS line of LCD;RAl is E line OfLCD;RB0-RB3 are D4-D7 of LCDEStrobeMACRO;StrobetheErBit
3、bsfEbcfEENDMCBLOCKOCHTemp;atemporaryvariablecount;counterbin;binarynumbertobeconvertedtoBCDhundreds;BCDhundredsresultlens_and_ones;BCDtensandonesresultsavetmr;usedtosavevalueoftmrdispvalue;usedtoholdtemperaturetobedisplayedtableindex;pointstotablevaluetodisplayENDCORGO;startatlocation0goto main;jump
4、overtomainroutineDataformessagetobeoutputshomsg:addwfPCL,fmdtTMROValue:,OmldtTemperature,O;MessagetoOutput;OutputtheCharactersRatiosofPrescalerpreratio:addwfPCL,f;selectoffsetusingWdtD,2D,4,D,8,D,16,D,32,D64D,128;InitializetheponsInit:cirfPORTAclrfPORTBmovlwB,00010000,trisPORTAmovlwBWilOOOOtrisPORTB
5、movlwB1OOl(X)Oir;RA4input,othersoutputs;RB4.RB5input,othersoutputs;pull-upsenabled;prescalerassignedtoRA4;prescalersetto1:16optionreturn;InitializetheLCDinitlcd:movlwD40callnmsecbcfRSmovlw0x03callNybbleOutcallDlay5EStrobenopnopEStrobenopnopbcfRSmovlw0x02callNybbleOut;Wait40msecsbeforeReset;sendan8bi
6、linstruction;ResetCommand;SendtheNybble;Wait5msecsbeforeSendingAgain;Wait244useesbeforeSendingtheSecondTime;Wait244useesbeforeSendingtheThirdTime;sendan8bitinstruction;Set4BitModenopnopmovlw0x028callSendINSmovlwOxOlOcallSendINSmovlwOxOOlcallSendINScallDlay5movlw0x006callSendINSmovlwOx(X)C;4bit,2Line
7、,5x7font;displayshiftoff;CleartheDisplayRAM;Note,Cantakeupto4.1msecs;incrementcursor;displayoncursoroffcallSendINSreturnSendthecharacterinWouttotheLCDSendASCIIaddlw0,SendCHARmovwfTempswapfTemp,wbsfRScallNybbleOutmovfTemp,w;SendnbrasASCIIcharacter;SendtheCharactertotheLCD;SavetheTemporaryValue;Sendth
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- LCD 显示 温度表 设计