{"id":2513,"date":"2019-05-28T07:39:49","date_gmt":"2019-05-28T07:39:49","guid":{"rendered":""},"modified":"2019-05-28T15:40:15","modified_gmt":"2019-05-28T07:40:15","slug":"at89c2051%e5%8d%95%e7%89%87%e6%9c%ba%e5%af%b9%e7%82%b9%e9%92%9e%e6%9c%ba%e7%9a%84%e5%a4%96%e6%8e%a5%e6%98%be%e7%a4%ba%e5%b1%8f%e9%a9%b1%e5%8a%a8%e8%ae%be%e8%ae%a1","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2513","title":{"rendered":"AT89C2051\u5355\u7247\u673a\u5bf9\u70b9\u949e\u673a\u7684\u5916\u63a5\u663e\u793a\u5c4f\u9a71\u52a8\u8bbe\u8ba1"},"content":{"rendered":"

\n\t\u4ece\u56fe\u4e0a\u53ef\u4ee5\u6e05\u695a\u7684\u770b\u51fa\uff1a\u70b9\u949e\u673a\u7684\u5916\u63a5\u663e\u793a\u5c4f\u4e3b\u8981\u7531\u5355\u7247\u673a<\/u>Atmel<\/u>\u516c\u53f8\u751f\u4ea7\u7684AT89C2051\u3001\u4e09\u53ea\u4e03\u6bb5\u5171\u9633\u6570\u7801\u7ba1LED1~LED3\u3001\u6676\u4f53\u4e09\u6781\u7ba1<\/u>V1~V3\u548c\u76f8\u5e94\u7684\u7535\u963b<\/u>\u7535\u5bb9<\/u>\u53ca\u63d2\u5934\u6240\u7ec4\u6210\u3002<\/p>\n

\n\t\u5927\u5bb6\u77e5\u9053\uff0cLED\u6570\u7801\u7ba1\u662f\u7531\u53d1\u5149\u4e8c\u6781\u7ba1<\/u>\u4f5c\u4e3a\u663e\u793a\u5b57\u6bb5\u7684\u6570\u7801\u578b\u663e\u793a\u5668\u4ef6\u3002\u5728\u6570\u7801\u7ba1\u663e\u793a\u5668\u4e2d\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\u90fd\u91c7\u7528\u52a8\u6001\u626b\u63cf\u5f0f\u663e\u793a\u65b9\u5f0f\u3002\u6240\u8c13\u626b\u63cf\u5f0f\uff0c\u5c31\u662f\u5f53\u6709\u591a\u4e2a\u4e03\u6bb5\uff08\u5e26\u5c0f\u6570\u70b9\u7684\u4e3a\u516b\u6bb5\uff09\u663e\u793a\u5668\u8981\u663e\u793a\u65f6\uff0c\u5c06\u5176\u5404\u4e2a\u5bf9\u5e94\u5f15\u811a\u63a5\u5728\u4e00\u8d77\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u6240\u6709\u7684a\u6bb5\u63a5\u5728\u4e00\u8d77\uff0cb\u6bb5\u4e5f\u63a5\u5728\u4e00\u8d77\uff0c\u4f9d\u6b64\u7c7b\u63a8\u3002\u800c\u5229\u7528\u5404\u4e03\u6bb5\u663e\u793a\u5668\u7684\u5171\u9633\uff08\u6216\u5171\u9634\uff09\u6781\u6765\u786e\u5b9a\u54ea\u4e00\u4e2a\u4e03\u6bb5\u663e\u793a\u5668\u8981\u663e\u793a\u3002\u8fd9\u6837\u505a\u7684\u76ee\u7684\u6709\u4e8c\uff1a\uff081\uff09\u7701\u7535\uff1b\uff082\uff09\u8282\u7701\u8f93\u51fa\u7aef\u53e3\u3002<\/p>\n

\n\t <\/div>\n

\n\t\"AT89C2051\u5355\u7247\u673a\u5bf9\u70b9\u949e\u673a\u7684\u5916\u63a5\u663e\u793a\u5c4f\u9a71\u52a8\u8bbe\u8ba1\"<\/p>\n

\n\t\u672c\u7535\u8def<\/u>\u5229\u752889C2051\u7684\u7aef\u53e3\u4e0e\u6570\u7801\u7684\u7b14\u6bb5\u63a5\u6cd5\u4e3a\uff1a P1.1--\u300bC; P1.2--\u300bD; P1.3--\u300bE; P1.4--\u300bB; P1.5--\u300bA; P1.6--\u300bF; P1.7--\u300bG \uff0c\u4e14\u4e09\u53ea\u6570\u7801\u7ba1\u7684\u7b14\u6bb5a~g\u53c8\u662f\u5e76\u8054\u5728\u4e00\u8d77\u7684\u3002\u6570\u7801\u7ba1\u7684\u516c\u5171\u7aefcom\u5206\u522b\u7531 P3.5--\u300bV1; P3.4--\u300bV2; P3.7--\u300bV3 \u8fdb\u884c\u63a7\u5236\u3002<\/p>\n

\n\t\u8fd9\u91cc\u987a\u5229\u8bf4\u660e\u4e0b\uff0c\u4e0d\u77e5\u5927\u5bb6\u662f\u5426\u770b\u51fa\uff0c\u65e0\u8bba\u662f\u6bb5\u7801\u8fd8\u662f\u516c\u5171\u7aef\u90fd\u6ca1\u6709\u6309\u76f8\u5e94\u5f15\u811a\u987a\u5e8f\u6765\u63a5\uff0c\u8fd9\u662f\u4e3a\u4ec0\u4e48\uff1f\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u6709\u8fd9\u79cd\u63a5\u6cd5\uff0c\u8fd9\u5c31\u662f\u6211\u4eec\u901a\u5e38\u6240\u8bf4\u7684“\u786c\u4ef6\u52a0\u5bc6”\u6cd5\u3002<\/p>\n

\n\tP1\u53e3\u662f\u4e008\u4f4d\u53cc\u5411I\/O\u53e3\uff0c\u53e3\u5f15\u811aP1.2~P1.7\u63d0\u4f9b\u5185\u90e8\u4e0a\u62c9\u7535\u963b\u3002P1.0\u548cP1.2\u8981\u6c42\u5916\u4e0a\u63a5\u7535\u963b\u3002\u5c24\u5176\u662fP1.0\u8fd9\u4e2a\u4e0a\u63a5\u7535\u963b\u63a5\u5728\u4e86\u70b9\u949e\u673a\u7684\u4e3b\u63a7\u677f\u4e0a\uff0c\u82e5\u8981\u5355\u72ec\u4f7f\u7528\u8fd9\u4e2a\u663e\u793a\u5668\uff0c\u4e0d\u8981\u5fd8\u4e86\u52a0\u53ea5.1K\u7684\u4e0a\u63a5\u7535\u963b\u3002<\/p>\n

\n\t\u5de5\u4f5c\u539f\u7406\u8bf4\u660e\u5982\u4e0b\uff1a<\/p>\n

\n\t1. \u6b32\u4f7fLED1\u663e\u793a\u5668\u4eae\uff0c\u9700\u4f7fV1\u5bfc\u901a\uff0c\u5373P3.5=0\uff0c\u540c\u7406LED2\u6b32\u4eae\u65f6\uff0cP3.4=0\u3002<\/p>\n

\n\t2. \u7531\u4e8e\u5171\u4eaba~g\u5f15\u811a\uff0c\u56e0\u6b64\u4e00\u6b21\u53ea\u80fd\u5bfc\u901a\u4e00\u4e2a\u6676\u4f53\u7ba1<\/u>\uff0c\u5426\u5219\u4f1a\u540c\u65f6\u663e\u793a\u76f8\u540c\u7684\u6570\u5b57\u3002<\/p>\n

\n\t3. \u5229\u7528\u89c6\u89c9\u6682\u7559\u539f\u7406\uff0cV1~V3\u5bfc\u901a\u9891\u738716\u6b21\/\u79d2\u4ee5\u4e0a\uff0c\u6ce8\u610f\u9891\u7387\u592a\u4f4e\u6570\u5b57\u4f1a\u95ea\u70c1\uff0c\u9891\u7387\u592a\u9ad8\u6570\u5b57\u4f1a\u6a21\u7cca\u53d8\u6697\u3002<\/p>\n

\n\t4. \u663e\u793a\u6570\u5b57\u65f6\uff0c\u987b\u5148\u9001FFH\u5230P1\u53e3\u5173\u95edLED\uff0c\u518d\u9001\u663e\u793a\u7801\uff0c\u5426\u5219\u5bb9\u6613\u9020\u6210\u89c6\u89c9\u5e72\u62e2\u3002<\/p>\n

\n\t5. R3\u4e3a\u9650\u6d41\u7535\u963b\u3002<\/p>\n

\n\t\u901a\u8fc7\u5bf9LED\u6570\u7801\u7ba1\u663e\u793a\u539f\u7406\u7684\u4e86\u89e3\uff0c\u518d\u660e\u786e\u4e00\u4e0b\u70b9\u949e\u673a\u5916\u63a5\u663e\u793a\u5668\u7684\u529f\u80fd\uff0c\u4f60\u5230\u94f6\u884c\u5b58\u8fc7\u6b3e\u5417\uff1f\u5f53\u4f60\u5c06\u94b1\u4ea4\u7ed9\u8425\u4e1a\u5458\u540e\uff0c\u5979\u5c31\u4f1a\u5c06\u94b1\u653e\u5165\u70b9\u949e\u673a\uff0c\u4e00\u662f\u4e3a\u4e86\u70b9\u6570\uff0c\u4e8c\u662f\u4e3a\u4e86\u9274\u522b\u949e\u7968\u7684\u771f\u4f2a\u3002\u540c\u65f6\u5728\u67dc\u53f0\u4e0a\u4f1a\u6709\u4e00\u4e2a\u663e\u793a\u5668\uff0c\u4f7f\u4f60\u4e5f\u80fd\u770b\u5230\u4f60\u7684\u94b1\u5e01\u7684\u5f20\u6570\u3002\u8fd9\u4e2a\u663e\u793a\u5668\u5c31\u662f\u70b9\u949e\u673a\u7684\u5916\u63a5\u663e\u793a\u5668\uff0c\u5b83\u663e\u793a\u7684\u6570\u5b57\u4e0e\u70b9\u949e\u673a\u662f\u540c\u6b65\u7684\uff0c\u6e05\u70b9\u5b8c\u4e4b\u540e\uff0c\u6570\u5b57\u4f1a\u4e00\u76f4\u4fdd\u6301\uff0c\u5f85\u4e0b\u4e00\u6b21\u6e05\u70b9\u65f6\uff0c\u5b83\u4f1a\u81ea\u52a8\u590d\u4f4d\uff0c\u4ece\u96f6\u5f00\u59cb\u8fdb\u884c\u7d2f\u52a0\u3002<\/p>\n

\n\t\u6570\u7801\u7ba1\u7684\u663e\u793a\u539f\u7406\u548c\u70b9\u949e\u673a\u5916\u63a5\u663e\u793a\u5668\u7684\u57fa\u672c\u529f\u80fd\u641e\u6e05\u695a\u4e4b\u540e\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u5f00\u59cb\u7f16\u5199\u7a0b\u5e8f\u3002<\/p>\n

\n\t\u5916\u63a5\u663e\u793a\u5668\u5171\u9633LED\u6570\u7801\u7ba1\u663e\u793a\u6bb5\u7f16\u7801<\/p>\n

\n\t\u663e\u793a\u6570P1.7\uff08G\uff09P1.6\uff08F\uff09P1.5\uff08A\uff09P1.4\uff08B\uff09P1.3\uff08E\uff09P1.2\uff08D\uff09P1.1\uff08C\uff09P1.0\uff08\u7a7a\uff09\u5b57\u6bb5\u780101000000181H111101101EDH20100001143H30100100149H4001011012DH50001100119H60001000111H711001101CDH80000000101H90000100109H<\/p>\n

\n\t\u949e\u673a\u5916\u63a5\u663e\u793a\u5c4f\u7684\u6c47\u7f16\u7a0b\u5982\u4e0b\uff1a<\/p>\n

\n\t;*\u6807\u9898\uff1a\u70b9\u949e\u673a\u5916\u63a5\u663e\u793a\u5c4f<\/p>\n

\n\t;*\u63cf\u8ff0\uff1a\u91c7\u7528AT89C2051\u82af\u7247\uff0c\u6676\u632f\u9891\u7387\uff1a11.0592MHz\u3002<\/p>\n

\n\t;*\u521d\u59cb\u72b6\u6001\u6570\u7801\u7ba1\u4e2a\u4f4d\u663e\u793a“0”\uff0c\u6700\u5927\u8ba1\u6570\u8303\u56f4\uff1a999\u3002<\/p>\n

\n\tLED1BITP3.5;\u767e\u4f4d\uff08\u5b9a\u4e49\u6570\u7801\u7ba1\u516c\u5171\u7aef\uff09<\/p>\n

\n\tLED2BITP3.4;\u5341\u4f4d<\/p>\n

\n\tLED3BITP3.7;\u4e2a\u4f4d<\/p>\n

\n\tJSQ0DATA50H;\u8109\u51b2\u8ba1\u6570\u5355\u5143\u9ad8\u5b57\u8282<\/p>\n

\n\tJSQ1DATA51H;\u8109\u51b2\u8ba1\u6570\u5355\u5143\u4f4e\u5b57\u8282<\/p>\n

\n\tLED01DATA3AH;\u663e\u793a\u6bb5\u7801\u7f13\u5b58\u5668\uff08\u767e\u4f4d\uff09<\/p>\n

\n\tLED02DATA3BH;\u5341\u4f4d<\/p>\n

\n\tLED03DATA3CH;\u4e2a\u4f4d<\/p>\n

\n\tR31DATA1FH<\/p>\n

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

\n\tORG0000H<\/p>\n

\n\tAJMPS<\/u>TART;\u590d\u4f4d\u8f6c\u4e3b\u7a0b\u5e8f<\/p>\n

\n\tORG0003H;INT0\u7684\u5165\u53e3\u5730\u5740<\/p>\n

\n\tAJMPI<\/u>NT0_P32<\/p>\n

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

\n\t;\u4e3b\u7a0b\u5e8f0030H\u5355\u5143\u5f00\u59cb<\/p>\n

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

\n\tORG0030H;\u8df3\u8fc7\u4e2d\u65ad\u5411\u91cf\u533a<\/p>\n

\n\tSTART\uff1a MOV R0\uff0c#7FH<\/p>\n

\n\tCLRA<\/p>\n

\n\tDEL1\uff1a MOV @R0\uff0cA;\u9884\u4f7f\u7528\u5355\u5143\u6e050<\/p>\n

\n\tDJNZR0\uff0cDEL1<\/p>\n

\n\tMAI<\/u>N\uff1a MOV SP\uff0c#60H;60H\u4e3a\u6808\u9876\u4f4d\u7f6e\u521d\u503c<\/p>\n

\n\tSETBIT0;\u7f6eINT0\u4e3a\u8fb9\u6cbf\u89e6\u53d1\u65b9\u5f0f<\/p>\n

\n\tMOV IP\uff0c#00000001B;\u7f6eINT0\u4e3a\u9ad8\u4f18\u5148\u7ea7\u4e2d\u65ad<\/p>\n

\n\tMOV IE\uff0c#10000001B;INT0\u5f00\u4e2d<\/p>\n

\n\tMOV JSQ0\uff0c#0;\u8ba1\u6570\u5355\u5143\u6e050<\/p>\n

\n\tMOV JSQ1\uff0c#0<\/p>\n

\n\tCLRP1.0;\u6ce8\u610f\u5728\u8f6f\u4ef6\u6a21\u62df\u8c03\u8bd5\u65f6\uff0cP1.0\u7531\u4e8e\u6ca1\u6709\u63a5\u5916\u90e8\u4e0a\u62c9\u7535\u963b\uff0c<\/p>\n

\n\t;\u62c9\u4f4e\u540e\u5c31\u65e0\u6cd5\u62c9\u9ad8\u3002\u4e3a\u4e86\u8c03\u8bd5\u65b9\u4fbf\u53ef\u9009\u53d689C51\u8fdb\u8c03\u8bd5<\/p>\n

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

\n\tDIR0_0:JBP1.0\uff0cDIR0_01;\u5f53\u70b9\u949e\u673a\u5df2\u590d\u4f4d\uff0c\u4f46\u672a\u653e\u5165\u7eb8\u5e01\uff0c\u6240\u4ee5\u672a\u4e2d\u65ad<\/p>\n

\n\tMOV R31\uff0c#28<\/p>\n

\n\tACALLDELAY2;\u5ef6\u65f61ms\uff0c\u53bb\u6296\u52a8<\/p>\n

\n\tJBP1.0\uff0cDIR0_01<\/p>\n

\n\tSETBP1.0<\/p>\n

\n\tMOV JSQ0\uff0c#0;\u590d\u4f4d\u4fe1\u6b63\u786e\uff0c\u8ba1\u6570\u5355\u5143\u6e050<\/p>\n

\n\tMOV JSQ1\uff0c#0<\/p>\n

\n\tACALLHB2;\u5c0616\u8fdb\u5236\u6570\u8f6c\u6362\u4e3aBCD\u7801<\/p>\n

\n\tACALLTHIF0;\u8c03\u7528\u8f6c\u6362\u663e\u793a\u503c\u5b50\u7a0b\u5e8f<\/p>\n

\n\tDIR0_01\uff1a<\/p>\n

\n\tMOV A\uff0cLED01;\u5f53\u5341\u4f4d\uff0c\u767e\u4f4d\u6570=0\u65f6\uff0c\u5c06\u5176\u5c4f\u853d<\/p>\n

\n\tCJNEA\uff0c#81H\uff0cDIR0_02<\/p>\n

\n\tMOV LED01\uff0c#0FFH<\/p>\n

\n\tMOV A\uff0cLED02<\/p>\n

\n\tCJNEA\uff0c#81H\uff0cDIR0_02<\/p>\n

\n\tMOV LED02\uff0c#0FFH<\/p>\n

\n\tDIR0_02\uff1a<\/p>\n

\n\tSETBLED1;LED1\u4f4d\u663e\u793a\u505c<\/p>\n

\n\tMOV P1\uff0cLED03;\u8bfb\u4e2a\u4f4d\u6bb5\u7801<\/p>\n

\n\tCLRLED3;LED1\u4e2a\u4f4d\u663e\u793a<\/p>\n

\n\tMOV R31\uff0c#42<\/p>\n

\n\tACALLDELAY2;\u5ef6\u65f62ms<\/p>\n

\n\tSETBLED3;LED1\u4f4d\u663e\u793a\u505c<\/p>\n

\n\tMOV P1\uff0cLED02;\u8bfb\u5341\u4f4d\u6bb5\u7801<\/p>\n

\n\tCLRLED2;LED2\u5341\u4f4d\u663e\u793a<\/p>\n

\n\tMOV R31\uff0c#42<\/p>\n

\n\tACALLDELAY2<\/p>\n

\n\tSETBLED2;LED2\u5341\u4f4d\u663e\u793a\u505c<\/p>\n

\n\tMOV P1\uff0cLED01;\u8bfb\u767e\u4f4d\u6bb5\u7801<\/p>\n

\n\tCLRLED1;LED1\u767e\u4f4d\u663e\u793a<\/p>\n

\n\tMOV R31\uff0c#42<\/p>\n

\n\tACALLDELAY2<\/p>\n

\n\tAJMPDIR0_0;\u4e0d\u65ad\u5faa\u73af\u663e\u793a\uff0c\u5e76\u7b49\u5f85\u4e2d\u65ad<\/p>\n

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

\n\t;\u8ba1\u6570\u590d\u4f4d\u65f6\uff0c\u70b9\u949e\u673a\u4e3b\u7a0b\u5e8f\u4f1a\u5148\u7ed9\u51fa\u4e00\u4e2a\u590d\u4f4d\u4fe1\u53f7\uff0c\u5e76\u6301\u7eed\u4e00\u6bb5\u65f6\u95f4\uff0c<\/p>\n

\n\t;\u63a5\u7740\u7ed9\u51fa\u8ba1\u6570\u8109\u51b2<\/p>\n

\n\tINT0_P32\uff1a<\/p>\n

\n\tPUSHACC;\u4fdd\u62a4\u73b0\u573a<\/p>\n

\n\tPUSHDPH<\/p>\n

\n\tPUSHDPL<\/p>\n

\n\tJBP1.0\uff0cINT0_01;\u5f53\u70b9\u949e\u673a<\/p>\n

\n\tMOV R31\uff0c#28<\/p>\n

\n\tACALLDELAY2;\u5ef6\u65f61ms\uff0c\u53bb\u6296\u52a8<\/p>\n

\n\tJBP1.0\uff0cINT0_01<\/p>\n

\n\tSETBP1.0;\u6e05\u9664\u590d\u4f4d\u4fe1\u53f7<\/p>\n

\n\tMOV JSQ0\uff0c#0;\u590d\u4f4d\u4fe1\u6b63\u786e\uff0c\u8ba1\u6570\u5355\u5143\u6e050<\/p>\n

\n\tMOV JSQ1\uff0c#0<\/p>\n

\n\tINT0_01\uff1a<\/p>\n

\n\tMOV A\uff0cJSQ1;\u4f4e\u5b57\u8282\u8ba1\u6570\u5355\u5143\u52a01<\/p>\n

\n\tINCA<\/p>\n

\n\tMOV JSQ1\uff0cA<\/p>\n

\n\tJNZINT0_02<\/p>\n

\n\tINCJSQ0;\u5f53\u6709\u8fdb\u4f4d\u65f6\uff0c\u9ad8\u5b57\u8282\u5355\u5143\u52a01<\/p>\n

\n\tINT0_02\uff1a<\/p>\n

\n\tACALLHB2;\u5c0616\u8fdb\u5236\u6570\u8f6c\u6362\u4e3aBCD\u7801<\/p>\n

\n\tACALLTHIF0;\u8c03\u7528\u8f6c\u6362\u663e\u793a\u503c\u5b50\u7a0b\u5e8f<\/p>\n

\n\tPOPDPL;\u6062\u590d\u73b0\u573a<\/p>\n

\n\tPOPDPH<\/p>\n

\n\tPOPACC<\/p>\n

\n\tRETI<\/u>;\u4e2d\u65ad\u8fd4\u56de<\/p>\n

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

\n\t;*\u53cc\u5b57\u8282\u5341\u516d\u8fdb\u5236\u6574\u6570\u8f6c\u6362\u6210\u53cc\u5b57\u8282\uff22\uff23\uff24\u7801\u6574\u6570<\/p>\n

\n\t;\u5165\u53e3\u6761\u4ef6\uff1a\u5f85\u8f6c\u6362\u7684\u53cc\u5b57\u8282\u5341\u516d\u8fdb\u5236\u6574\u6570\u5728R6\u3001R7\u4e2d\u3002<\/p>\n

\n\t;\u51fa\u53e3\u4fe1\u606f\uff1a\u8f6c\u6362\u540e\u7684\u4e09\u5b57\u8282\uff22\uff23\uff24\u7801\u6574\u6570\u5728R3\u3001R4\u3001R5\u4e2d\u3002<\/p>\n

\n\t;\u5f71\u54cd\u8d44\u6e90\uff1aPSW\u3001A\u3001R2\uff5eR7\u5806\u6808\u9700\u6c42\uff1a\uff12\u5b57\u8282<\/p>\n

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

\n\tHB2\uff1a<\/p>\n

\n\tMOV R6\uff0cJSQ0;\u9ad8\u5b57\u8282\u5355\u5143\u9001\u5165R6<\/p>\n

\n\tMOV R7\uff0cJSQ1;\u4f4e\u5b57\u8282\u5355\u5143\u9001\u5165R7<\/p>\n

\n\tCLRA;BCD\u7801\u521d\u59cb\u5316<\/p>\n

\n\tMOV R3\uff0cA<\/p>\n

\n\tMOV R4\uff0cA<\/p>\n

\n\tMOV R5\uff0cA<\/p>\n

\n\tMOV R2\uff0c#10H;\u8f6c\u6362\u53cc\u5b57\u8282\u5341\u516d\u8fdb\u5236\u6574\u6570<\/p>\n

\n\tHB3\uff1a<\/p>\n

\n\tMOV A\uff0cR7;\u4ece\u9ad8\u7aef\u79fb\u51fa\u5f85\u8f6c\u6362\u6570\u7684\u4e00\u4f4d\u5230CY\u4e2d<\/p>\n

\n\tRLCA<\/p>\n

\n\tMOV R7\uff0cA<\/p>\n

\n\tMOV A\uff0cR6<\/p>\n

\n\tRLCA<\/p>\n

\n\tMOV R6\uff0cA<\/p>\n

\n\tMOV A\uff0cR5;BCD\u7801\u5e26\u8fdb\u4f4d\u81ea\u8eab\u76f8\u52a0\uff0c\u76f8\u5f53\u4e8e\u4e582<\/p>\n

\n\tADDCA\uff0cR5<\/p>\n

\n\tDAA;\u5341\u8fdb\u5236\u8c03\u6574<\/p>\n

\n\tMOV R5\uff0cA<\/p>\n

\n\tMOV A\uff0cR4<\/p>\n

\n\tADDCA\uff0cR4<\/p>\n

\n\tDAA<\/p>\n

\n\tMOV R4\uff0cA<\/p>\n

\n\tMOV A\uff0cR3<\/p>\n

\n\tADDCA\uff0cR3<\/p>\n

\n\tMOV R3\uff0cA;\u53cc\u5b57\u8282\u5341\u516d\u8fdb\u5236\u6570\u7684\u4e07\u4f4d\u6570\u4e0d\u8d85\u8fc76\uff0c\u4e0d\u7528\u8c03\u6574<\/p>\n

\n\tDJNZR2\uff0cHB3;\u5904\u7406\u5b8c16bit<\/p>\n

\n\tRET<\/p>\n

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

\n\t;*\u5c06BCD\u7801\u89e3\u538b\u540e\uff0c\u8f6c\u6362\u4e3a\u5341\u8fdb\u5236\u663e\u793a\u7b26<\/p>\n

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

\n\tTHIF0\uff1a;\u5c06\u538b\u7f29BCD\u7801\u89e3\u538b\uff08\u56e0\u6700\u5927\u6570\u4e3a999\uff0c\u6240\u4ee5\uff3bR3\uff3d=0\uff09<\/p>\n

\n\tMOV A\uff0cR5;\u53d6\u6570\u636e<\/p>\n

\n\tANLA\uff0c#0FH;\u5c4f\u853d\u9ad84\u4f4d\uff0c\u53d6\u51fa\u4f4e4\u4f4d<\/p>\n

\n\tMOV 32H\uff0cA;\u5b58\u4e2a\u4f4d<\/p>\n

\n\tMOV A\uff0cR5<\/p>\n

\n\tSWAPA;\u4ea4\u6362<\/p>\n

\n\tANLA\uff0c#0FH<\/p>\n

\n\tMOV 31H\uff0cA;\u5b58\u5341\u4f4d<\/p>\n

\n\tMOV A\uff0cR4;\u53d6\u6570\u636e<\/p>\n

\n\tANLA\uff0c#0FH;\u5c4f\u853d\u9ad84\u4f4d\uff0c\u53d6\u51fa\u4f4e4\u4f4d<\/p>\n

\n\tMOV 30H\uff0cA;\u5b58\u767e\u4f4d<\/p>\n

\n\t;*\u5c06BCD\u8f6c\u6362\u4e3a\u5341\u8fdb\u5236\u663e\u793a\u7b26<\/p>\n

\n\tMOV DPTR\uff0c#TABD;\u7f6e\u6570\u7801\u8868\u9996\u5740<\/p>\n

\n\tMOV R0\uff0c#30H;\u7f6e\u663e\u793a\u6570\u9996\u5740<\/p>\n

\n\tMOV R1\uff0c#LED01;\u7f6e\u5b57\u6bb5\u7801\u6682\u5b58\u5668\u9996\u5740<\/p>\n

\n\tMOV R2\uff0c#03H;\u7f6e\u5faa\u73af\u6570<\/p>\n

\n\tTHIF1\uff1a<\/p>\n

\n\tMOV A\uff0c@R0;\u53d6\u663e\u793a\u6570<\/p>\n

\n\tMOV CA\uff0c@A+DPTR;\u8bfb\u5b57\u6bb5\u7801<\/p>\n

\n\tMOV @R1\uff0cA;\u5b58\u5b57\u6bb5\u7801<\/p>\n

\n\tINCR0;\u4fee\u6539\u663e\u793a\u6570\u5730\u5740<\/p>\n

\n\tINCR1;\u4fee\u6539\u5b57\u6bb5\u7801\u6682\u5b58\u5668\u5730\u5740<\/p>\n

\n\tDJNZR2\uff0cTHIF1;\u5224\u65ad\u5faa\u73af\u662f\u5426\u7ed3\u675f<\/p>\n

\n\tRET<\/p>\n

\n\tTABD\uff1a<\/p>\n

\n\tDB81H\uff0c0EDH\uff0c43H\uff0c49H\uff0c2DH\uff0c19H;\u5171\u9633\u5b57\u6bb5\u8868\uff0c0\uff5e5\u663e\u793a\u7b26<\/p>\n

\n\tDB11H\uff0c0CDH\uff0c01H\uff0c09H;6\uff5e9\u663e\u793a\u7b26<\/p>\n

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

\n\t;*\u5ef6\u65f6\u5b50\u7a0b\u5e8f<\/p>\n

\n\tDELAY2\uff1a<\/p>\n

\n\tL2:PUSHR31<\/p>\n

\n\tL3:DJNZR31\uff0cL3<\/p>\n

\n\tPOPR31<\/p>\n

\n\tDJNZR31\uff0cL2<\/p>\n

\n\tRET<\/p>\n

\n\tEND<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4ece\u56fe\u4e0a\u53ef\u4ee5\u6e05\u695a\u7684\u770b\u51fa\uff1a\u70b9\u949e\u673a\u7684\u5916\u63a5\u663e\u793a\u5c4f\u4e3b\u8981\u7531 \u5355\u7247\u673a Atmel \u516c\u53f8\u751f\u4ea7\u7684AT89C2051\u3001\u4e09\u53ea\u4e03\u6bb5\u5171\u9633\u6570\u7801\u7ba1LED1~LED3\u3001\u6676\u4f53 \u4e09\u6781\u7ba1 V1~V3\u548c\u76f8\u5e94\u7684 \u7535\u963b \u7535\u5bb9 \u53ca\u63d2\u5934\u6240\u7ec4\u6210\u3002 \u5927\u5bb6\u77e5\u9053\uff0cLE<\/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\/2513"}],"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=2513"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2513\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2513"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}