{"id":2315,"date":"2019-04-09T12:19:29","date_gmt":"2019-04-09T12:19:29","guid":{"rendered":""},"modified":"2019-04-09T20:19:49","modified_gmt":"2019-04-09T12:19:49","slug":"mega8%e5%8d%95%e7%89%87%e6%9c%ba%e5%af%b9lcd1602%e6%b6%b2%e6%99%b6%e5%b1%8f%e7%9a%84%e9%a9%b1%e5%8a%a8","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2315","title":{"rendered":"MEGA8\u5355\u7247\u673a\u5bf9LCD1602\u6db2\u6676\u5c4f\u7684\u9a71\u52a8"},"content":{"rendered":"

\n\t\u8c03\u8bd5\u8fc7\u7a0b\u603b\u7ed3\u4e00\u4e0b\uff1a<\/p>\n

\n\t1\uff09\u7531\u4e8e\u627e\u4e0d\u5230\u76841620\u8d44\u6599\uff0c\u4e0d\u77e5\u9053\u5b83\u7684\u64cd\u4f5c\u65f6\u5e8f\u3002\u770b\u5230\u4e00\u4e9b\u5e16\u5b50\u8bf41620\u548c1602\u6ca1\u533a\u522b\uff0c\u8fd8\u662f\u6709\u70b9\u5c06\u4fe1\u5c06\u7591\u3002\u540e\u9762\u7528\u7f51\u53cb\u7f16\u5199\u76841602\u7a0b\u5e8f\u8bd5\u9a8c\uff0c\u624d\u77e5\u9053\u5b83\u4eec\u4fe9\u6ca1\u5565\u533a\u522b<\/p>\n

\n\t <\/div>\n

\n\t2\uff09\u5173\u4e8e\u662f\u5426\u68c0\u6d4bLCD\u5904\u4e8e\u7a7a\u95f2\uff0c\u89c9\u5f97\u8fd8\u662f\u6700\u597d\u5728\u5199\u6307\u4ee4\u548c\u5199\u6570\u636e\u65f6\u90fd\u52a0\u4e0a\u3002\u4e0d\u68c0\u6d4b\uff0c\u4f1a\u5bfc\u81f4\u663e\u793a\u7ed3\u679c\u4e0d\u6b63\u5e38\u3002<\/p>\n

\n\t3\uff09\u7531\u4e8e\u8fde\u7ebf\u5f88\u591a14\u6839\uff08\u52a0\u4e0a\u80cc\u5149\u5c31\u662f16\u6839\uff09\uff0c\u5982\u679c\u6709\u4e00\u6839\u9664\u4e86\u95ee\u9898\u5c31\u4f1a\u5f71\u54cd\u5230\u663e\u793a\u3002\u6240\u4ee5\u6211\u662f\u7528\u4e07\u7528\u8868<\/u>\u4e00\u6839\u7ebf\u4e00\u6839\u7ebf\u91cf\u4e86\u4e4b\u540e\u624d\u901a\u7535\u8bd5\u9a8c\u7684\u3002<\/p>\n

\n\t4\uff09\u770b\u5230\u5f88\u591a\u5e16\u5b50\u90fd\u5efa\u8bae\u5728\u521d\u59cb\u5316LCD\u524d\u5ef6\u65f6\u51e0\u5341\u6beb\u79d2\u3002\u672c\u4f8b\u4e2d\u5e76\u6ca1\u6709\u5ef6\u65f6\uff0c\u663e\u793a\u4e5f\u6b63\u5e38\u3002<\/p>\n

\n\t5\uff09\u603b\u7684\u8bf4\u6765\uff0c\u4e0d\u662f\u5f88\u96be\u3002\u5728\u9047\u5230\u95ee\u9898\u65f6\u53ea\u8981\u80fd\u591f\u4ed4\u7ec6\u5206\u6790\uff0c\u5c31\u80fd\u627e\u51fa\u539f\u56e0\u548c\u89e3\u51b3\u65b9\u6cd5\u3002\u81ea\u5df1\u524d\u51e0\u5929\u5728\u8bd5\u7a0b\u5e8f\u65f6\u5c31\u662f\u663e\u793a\u7ed3\u679c\u4e0d\u5bf9\uff0c\u4e00\u76f4\u5728\u68c0\u67e5\u81ea\u5df1\u7684\u7a0b\u5e8f\uff0c\u6ca1\u60f3\u5230\u539f\u6765\u662f\u5355\u7247\u673a<\/u>\u7684Flash\u5230\u5bff\u547d\u4e86\u90a3\u4e2a\u90c1\u95f7\u554a\u3002<\/p>\n

\n\t\"MEGA8\u5355\u7247\u673a\u5bf9LCD1602\u6db2\u6676\u5c4f\u7684\u9a71\u52a8\"<\/p>\n

\n\t\u5934\u6587\u4ef6\u4e2d\u6709\u4e94\u4e2a\u51fd\u6570\uff1a<\/p>\n

\n\tFuncti<\/u>on1.unsigned char AskBusy\uff08void\uff09 \u8be2\u95eeLCD1620\u662f\u5426\u7a7a\u95f2\uff0c \u8fd4\u56de\u503c“1”\u7a7a\u95f2\uff0c “0”\u4e3a\u5fd9;<\/p>\n

\n\tFuncTIon2.WritE<\/u>DAta\uff08char data\uff09 \u5199\u6570\u636e\u5230LCD1620;<\/p>\n

\n\tFuncTIon3.WriteCommand\uff08char command\uff09 \u5199\u6307\u4ee4\u5230LCD1620;<\/p>\n

\n\tFuncTIon4.PutOneCharLCD\uff08x\uff0cy\uff0c*Disp\uff09 \u5728LCD1620\u4e0a\u663e\u793a\u4e00\u4e2a\u5b57\u7b26\uff0c x\uff0cy\u5b9a\u4e49\u4f4d\u7f6e<\/p>\n

\n\tFuncTIon5.PutStringLCD\uff08a\uff0cb\uff0c*DispString\uff09 \u5728LCD1620\u4e0a\u663e\u793a\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c a\uff0cb\u5b9a\u4e49\u521d\u59cb\u4f4d\u7f6e\u3002 Function6.LCD_Init\uff08\uff09 \u521d\u59cb\u5316LCD<\/p>\n

\n\t\u5728\u4f7f\u7528\u6b64\u5934\u6587\u4ef6\u4e4b\u524d\uff0c\u5fc5\u987b\u6709\u4ee5\u4e0b\u5b8f\u5b9a\u4e49\uff1a<\/p>\n

\n\t#define DataPortPullup PORTx<\/p>\n

\n\t#define DataPortDirection DDRx<\/p>\n

\n\t#define ReadLCDPI<\/u>NPINx<\/p>\n

\n\t#defineCTRlPortPullup PORTx<\/p>\n

\n\t#define CtrlPortDirection DDRx<\/p>\n

\n\t#define RS<\/u>_Bit Px\uff1f<\/p>\n

\n\t#define RW_Bit Px\uff1f<\/p>\n

\n\t#define E_Bit Px\uff1f<\/p>\n

\n\t\u5176\u4e2d“x”\u4ee3\u8868B\uff0cC\uff0cD\uff08mega8\u4e2d\u65e0A\u53e3\uff09\uff0c“\uff1f”\u4ee3\u8868“0~1”<\/p>\n

\n\t\u5b8c\u6574\u5934\u6587\u4ef6\u5982\u4e0b\uff08\u89e3\u91ca\u641e\u4e86\u4e00\u5927\u5806\uff0c\u4e5f\u5b66\u5b66\u7528\u82f1\u8bed……\uff09\uff1a<\/p>\n

\n\t\/*******************************************************\/<\/p>\n

\n\t\/* Project \uff1a1620 Display Headfile *\/<\/p>\n

\n\t\/* Date \uff1a2008\uff0c3\uff0c11 *\/<\/p>\n

\n\t\/* Author \uff1alhy *\/<\/p>\n

\n\t\/* Version \uff1av1.1 *\/<\/p>\n

\n\t\/* Rework \uff1alhy *\/<\/p>\n

\n\t\/* Rework Date \uff1a2008.4.28 *\/<\/p>\n

\n\t\/* *\/<\/p>\n

\n\t\/* Comments \uff1a *\/<\/p>\n

\n\t\/* 1 Function Description *\/<\/p>\n

\n\t\/* Function1.unsigned char AskBusy\uff08void\uff09 *\/<\/p>\n

\n\t\/* --Calls this Fun to ask if LCD is busy\uff0c *\/<\/p>\n

\n\t\/* 1--free\uff0c0--busy; *\/<\/p>\n

\n\t\/* Function2.WritEDAta\uff08char data\uff09 *\/<\/p>\n

\n\t\/* --Write data to LCD *\/<\/p>\n

\n\t\/* Function3.WriteCommand\uff08char command\uff09 *\/<\/p>\n

\n\t\/* --write command to LCD *\/<\/p>\n

\n\t\/* Function4.PutOneCharLCD\uff08x\uff0cy\uff0c*Disp\uff09 *\/<\/p>\n

\n\t\/* --Put one char to LCD. *\/<\/p>\n

\n\t\/* Function5.PutStringLCD\uff08a\uff0cb\uff0c*DispString\uff09 *\/<\/p>\n

\n\t\/* --Put String to LCD. Max length 32bits. *\/<\/p>\n

\n\t\/* *\/<\/p>\n

\n\t\/* 2 How to use *\/<\/p>\n

\n\t\/* Before use this HeadFile\uff0c *\/<\/p>\n

\n\t\/* need to define as below\uff1a *\/<\/p>\n

\n\t\/* #define DataPortPullup PORTx *\/<\/p>\n

\n\t\/* #define DataPortDirection DDRx *\/<\/p>\n

\n\t\/* #define ReadLCDPin PINx *\/<\/p>\n

\n\t\/* #define CtrlPortPullup PORTx *\/<\/p>\n

\n\t\/* #define CtrlPortDirection DDRx *\/<\/p>\n

\n\t\/* #define RS_Bit Px\uff1f *\/<\/p>\n

\n\t\/* #define RW_Bit Px\uff1f *\/<\/p>\n

\n\t\/* #define E_Bit Px\uff1f *\/<\/p>\n

\n\t\/* ‘x’ -\u300b A\uff0cB\uff0cC\uff0cD.\u3002. *\/<\/p>\n

\n\t\/* ‘\uff1f’ -\u300b 0\uff0c1\uff0c2\uff0c3\uff0c4\uff0c5\uff0c6\uff0c7 *\/<\/p>\n

\n\t\/* And set control port output\uff0clike this\uff1a *\/<\/p>\n

\n\t\/* CtrlPortDirection |= *\/<\/p>\n

\n\t\/* \uff081\u300a\/* 3 Add the Function “LCD_Init\uff08void\uff09” *\/<\/p>\n

\n\t\/* Before this Fun\uff0c you must set control port *\/<\/p>\n

\n\t\/* output. *\/<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8c03\u8bd5\u8fc7\u7a0b\u603b\u7ed3\u4e00\u4e0b\uff1a 1\uff09\u7531\u4e8e\u627e\u4e0d\u5230\u76841620\u8d44\u6599\uff0c\u4e0d\u77e5\u9053\u5b83\u7684\u64cd\u4f5c\u65f6\u5e8f\u3002\u770b\u5230\u4e00\u4e9b\u5e16\u5b50\u8bf41620\u548c1602\u6ca1\u533a\u522b\uff0c\u8fd8\u662f\u6709\u70b9\u5c06\u4fe1\u5c06\u7591\u3002\u540e\u9762\u7528\u7f51\u53cb\u7f16\u5199\u76841602\u7a0b\u5e8f\u8bd5\u9a8c\uff0c\u624d\u77e5\u9053\u5b83\u4eec\u4fe9\u6ca1\u5565\u533a\u522b 2\uff09<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2315"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2315"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2315\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2315"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}