{"id":2752,"date":"2019-08-09T00:59:55","date_gmt":"2019-08-09T00:59:55","guid":{"rendered":""},"modified":"2019-08-09T09:00:48","modified_gmt":"2019-08-09T01:00:48","slug":"at89s51%e5%8d%95%e7%89%87%e6%9c%ba00%ef%bc%8d59%e7%a7%92%e8%ae%a1%e6%97%b6%e5%99%a8%e8%ae%be%e8%ae%a1","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2752","title":{"rendered":"AT89S51\u5355\u7247\u673a00\uff0d59\u79d2\u8ba1\u65f6\u5668\u8bbe\u8ba1"},"content":{"rendered":"

\n\t1. \u5982\u4e0b\u56fe\u6240\u793a\uff0c\u5728AT89S51\u5355\u7247\u673a<\/u>\u7684P0\u548cP2\u7aef\u53e3\u5206\u522b\u63a5\u6709\u4e24\u4e2a\u5171\u9634\u6570\u7801\u7ba1\uff0cP0\u53e3\u9a71\u52a8\u663e\u793a\u79d2\u65f6\u95f4\u7684\u5341\u4f4d\uff0c\u800cP2\u53e3\u9a71\u52a8\u663e\u793a\u79d2\u65f6\u95f4\u7684\u4e2a\u4f4d\u3002<\/p>\n

\n\t2. \u7535\u8def<\/u>\u539f\u7406\u56fe<\/p>\n

\n\t <\/div>\n

\n\t\"AT89S51\u5355\u7247\u673a00\uff0d59\u79d2\u8ba1\u65f6\u5668\u8bbe\u8ba1\"<\/p>\n

\n\t\u56fe4.11.1<\/p>\n

\n\t3. \u7cfb\u7edf\u677f\u4e0a\u786c\u4ef6\u8fde\u7ebf<\/p>\n

\n\t\uff081. \u628a“\u5355\u7247\u673a\u7cfb\u7edf”\u533a\u57df\u4e2d\u7684P0.0\/AD0-P0.7\/AD7\u7aef\u53e3\u75288\u82af\u6392\u7ebf\u8fde\u63a5\u5230“\u56db\u8def\u9759\u6001\u6570\u7801\u663e\u793a\u6a21\u5757”\u533a\u57df\u4e2d\u7684\u4efb\u4e00\u4e2aa-h\u7aef\u53e3\u4e0a;\u8981\u6c42\uff1aP0.0\/AD0\u5bf9\u5e94\u7740a\uff0cP0.1\/AD1\u5bf9\u5e94\u7740b\uff0c……\uff0cP0.7\/AD7\u5bf9\u5e94\u7740h\u3002<\/p>\n

\n\t\uff082. \u628a“\u5355\u7247\u673a\u7cfb\u7edf”\u533a\u57df\u4e2d\u7684P2.0\/A8-P2.7\/A15\u7aef\u53e3\u75288\u82af\u6392\u7ebf\u8fde\u63a5\u5230“\u56db\u8def\u9759\u6001\u6570\u7801\u663e\u793a\u6a21\u5757”\u533a\u57df\u4e2d\u7684\u4efb\u4e00\u4e2aa-h\u7aef\u53e3\u4e0a;\u8981\u6c42\uff1aP2.0\/A8\u5bf9\u5e94\u7740a\uff0cP2.1\/A9\u5bf9\u5e94\u7740b\uff0c……\uff0cP2.7\/A15\u5bf9\u5e94\u7740h\u3002<\/p>\n

\n\t4. \u7a0b\u5e8f\u8bbe\u8ba1\u5185\u5bb9<\/p>\n

\n\t\uff081. \u5728\u8bbe\u8ba1\u8fc7\u7a0b\u4e2d\u6211\u4eec\u7528\u4e00\u4e2a\u5b58\u50a8<\/u>\u5355\u5143\u4f5c\u4e3a\u79d2\u8ba1\u6570\u5355\u5143\uff0c\u5f53\u4e00\u79d2\u949f\u5230\u6765\u65f6\uff0c\u5c31\u8ba9\u79d2\u8ba1\u6570\u5355\u5143\u52a01\uff0c\u5f53\u79d2\u8ba1\u6570\u8fbe\u523060\u65f6\uff0c\u5c31\u81ea\u52a8\u8fd4\u56de\u52300\uff0c\u4ece\u65b0\u79d2\u8ba1\u6570\u3002<\/p>\n

\n\t\uff082. \u5bf9\u4e8e\u79d2\u8ba1\u6570\u5355\u5143\u4e2d\u7684\u6570\u636e\u8981\u628a\u5b83\u5341\u4f4d\u6570\u548c\u4e2a\u6570\u5206\u5f00\uff0c\u65b9\u6cd5\u4ecd\u91c7\u7528\u5bf910\u6574\u9664\u548c\u5bf910\u6c42\u4f59\u3002<\/p>\n

\n\t\uff083. \u5728\u6570\u7801\u4e0a\u663e\u793a\uff0c\u4ecd\u901a\u8fc7\u67e5\u8868\u7684\u65b9\u5f0f\u5b8c\u6210\u3002<\/p>\n

\n\t\uff084. \u4e00\u79d2\u65f6\u95f4\u7684\u4ea7\u751f\u5728\u8fd9\u91cc\u6211\u4eec\u91c7\u7528\u8f6f\u4ef6\u7cbe\u786e\u5ef6\u65f6\u7684\u65b9\u6cd5\u6765\u5b8c\u6210\uff0c\u7ecf\u8fc7\u7cbe\u786e\u8ba1\u7b97\u5f97\u52301\u79d2\u65f6\u95f4\u4e3a1.002\u79d2\u3002<\/p>\n

\n\tDELY1S\uff1a MOV R5\uff0c#100<\/p>\n

\n\tD2\uff1a MOV R6\uff0c#20<\/p>\n

\n\tD1\uff1a MOV R7\uff0c#248<\/p>\n

\n\tDJNZ R7\uff0c$<\/p>\n

\n\tDJNZ R6\uff0cD1<\/p>\n

\n\t\"AT89S51\u5355\u7247\u673a00\uff0d59\u79d2\u8ba1\u65f6\u5668\u8bbe\u8ba1\"<\/p>\n

\n\tDJNZ R5\uff0cD2<\/p>\n

\n\tRET<\/p>\n

\n\t5. \u7a0b\u5e8f\u6846\u56fe<\/p>\n

\n\t\u56fe4.11.2<\/p>\n

\n\t6. \u6c47\u7f16\u6e90\u7a0b\u5e8f<\/p>\n

\n\tSecond EQU 30H<\/p>\n

\n\tORG 0<\/p>\n

\n\tSTART\uff1a MOV Second\uff0c#00H<\/p>\n

\n\tNEXT\uff1a MOV A\uff0cSecond<\/p>\n

\n\tMOV B\uff0c#10<\/p>\n

\n\tDIV AB<\/p>\n

\n\tMOV DPTR\uff0c#TABLE<\/p>\n

\n\tMOVC A\uff0c@A+DPTR<\/p>\n

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

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

\n\tMOVC A\uff0c@A+DPTR<\/p>\n

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

\n\tLCALL DELY1S<\/p>\n

\n\tINC Second<\/p>\n

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

\n\tCJNE A\uff0c#60\uff0cNEXT<\/p>\n

\n\tLJMP START<\/p>\n

\n\tDELY1S\uff1a MOV R5\uff0c#100<\/p>\n

\n\tD2\uff1a MOV R6\uff0c#20<\/p>\n

\n\tD1\uff1a MOV R7\uff0c#248<\/p>\n

\n\tDJNZ R7\uff0c$<\/p>\n

\n\tDJNZ R6\uff0cD1<\/p>\n

\n\tDJNZ R5\uff0cD2<\/p>\n

\n\tRET<\/p>\n

\n\tTABLE\uff1a DB 3FH\uff0c06H\uff0c5BH\uff0c4FH\uff0c66H\uff0c6DH\uff0c7DH\uff0c07H\uff0c7FH\uff0c6FH<\/p>\n

\n\tEND<\/p>\n

\n\t7. C\u8bed\u8a00\u6e90\u7a0b\u5e8f<\/p>\n

\n\t#include<\/p>\n

\n\tunsigned char code table\uff3b\uff3d={0x3f\uff0c0x06\uff0c0x5b\uff0c0x4f\uff0c0x66\uff0c<\/p>\n

\n\t0x6d\uff0c0x7d\uff0c0x07\uff0c0x7f\uff0c0x6f};<\/p>\n

\n\tunsigned char Second;<\/p>\n

\n\tvoid delay1s\uff08void\uff09<\/p>\n

\n\t{<\/p>\n

\n\tunsigned char i\uff0cj\uff0ck;<\/p>\n

\n\tfor\uff08k=100;k\u300b0;k--\uff09<\/p>\n

\n\tfor\uff08i=20;i\u300b0;i--\uff09<\/p>\n

\n\tfor\uff08j=248;j\u300b0;j--\uff09;<\/p>\n

\n\t}<\/p>\n

\n\tvoid mai<\/u>n\uff08void\uff09<\/p>\n

\n\t{<\/p>\n

\n\tSecond=0;<\/p>\n

\n\tP0=table\uff3bSecond\/10\uff3d;<\/p>\n

\n\tP2=table\uff3bSecond%10\uff3d;<\/p>\n

\n\twhile\uff081\uff09<\/p>\n

\n\t{<\/p>\n

\n\tdelay1s\uff08\uff09;<\/p>\n

\n\tSecond++;<\/p>\n

\n\tif<\/u>\uff08Second==60\uff09<\/p>\n

\n\t{<\/p>\n

\n\tSecond=0;<\/p>\n

\n\t}<\/p>\n

\n\tP0=table\uff3bSecond\/10\uff3d;<\/p>\n

\n\tP2=table\uff3bSecond%10\uff3d;<\/p>\n

\n\t}<\/p>\n

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

1. \u5982\u4e0b\u56fe\u6240\u793a\uff0c\u5728AT89S51 \u5355\u7247\u673a \u7684P0\u548cP2\u7aef\u53e3\u5206\u522b\u63a5\u6709\u4e24\u4e2a\u5171\u9634\u6570\u7801\u7ba1\uff0cP0\u53e3\u9a71\u52a8\u663e\u793a\u79d2\u65f6\u95f4\u7684\u5341\u4f4d\uff0c\u800cP2\u53e3\u9a71\u52a8\u663e\u793a\u79d2\u65f6\u95f4\u7684\u4e2a\u4f4d\u3002 2. \u7535\u8def \u539f\u7406\u56fe \u56fe4.11.1 3. \u7cfb\u7edf\u677f\u4e0a\u786c\u4ef6\u8fde\u7ebf \uff081. \u628a\u5355<\/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\/2752"}],"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=2752"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2752\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2752"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}