{"id":2425,"date":"2019-05-14T07:50:30","date_gmt":"2019-05-14T07:50:30","guid":{"rendered":""},"modified":"2019-05-14T15:51:01","modified_gmt":"2019-05-14T07:51:01","slug":"at89s51%e5%8d%95%e7%89%87%e6%9c%ba%e6%8a%a5%e8%ad%a6%e5%99%a8%e7%9a%84%e8%ae%be%e8%ae%a1","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2425","title":{"rendered":"AT89S51\u5355\u7247\u673a\u62a5\u8b66\u5668\u7684\u8bbe\u8ba1"},"content":{"rendered":"

\n\t1\uff0e\u5b9e\u9a8c\u4efb\u52a1<\/p>\n

\n\t\u7528P1.0\u8f93\u51fa1KHz\u548c500Hz\u7684\u97f3\u9891\u4fe1\u53f7\u9a71\u52a8\u626c\u58f0\u5668\uff0c\u4f5c\u62a5\u8b66\u4fe1\u53f7\uff0c\u8981\u6c421KHz\u4fe1\u53f7\u54cd100ms\uff0c500Hz\u4fe1\u53f7\u54cd200ms\uff0c\u4ea4\u66ff\u8fdb\u884c\uff0cP1.7\u63a5\u4e00\u5f00\u5173\u8fdb\u884c\u63a7\u5236\uff0c\u5f53\u5f00\u5173\u5408\u4e0a\u54cd\u62a5\u8b66\u4fe1\u53f7\uff0c\u5f53\u5f00\u5173\u65ad\u5f00\u544a\u8b66\u4fe1\u53f7\u505c\u6b62\uff0c\u7f16\u51fa\u7a0b\u5e8f\u3002<\/p>\n

\n\t <\/div>\n

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

\n\t\"AT89S51\u5355\u7247\u673a\u62a5\u8b66\u5668\u7684\u8bbe\u8ba1\"<\/p>\n

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

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

\n\t\uff081\uff09\uff0e\u628a“\u5355\u7247\u673a<\/u>\u7cfb\u7edf”\u533a\u57df\u4e2d\u7684P1.0\u7aef\u53e3\u7528\u5bfc\u7ebf\u8fde\u63a5\u5230“\u97f3\u9891\u653e\u5927\u6a21\u5757”\u533a\u57df\u4e2d\u7684SPK IN\u7aef\u53e3\u4e0a\uff1b<\/p>\n

\n\t\uff082\uff09\uff0e\u5728“\u97f3\u9891\u653e\u5927\u6a21\u5757”\u533a\u57df\u4e2d\u7684SPK OUT\u7aef\u53e3\u4e0a\u63a5\u4e0a\u4e00\u4e2a8\u6b27\u7684\u6216\u8005\u662f16\u6b27\u7684\u5587\u53ed\uff1b<\/p>\n

\n\t\uff083\uff09\uff0e\u628a“\u5355\u7247\u673a\u7cfb\u7edf”\u533a\u57df\u4e2d\u7684P1.7\/RD\u7aef\u53e3\u7528\u5bfc\u7ebf\u8fde\u63a5\u5230“\u56db\u8def\u62e8\u52a8\u5f00\u5173”\u533a\u57df\u4e2d\u7684K1\u7aef\u53e3\u4e0a\uff1b<\/p>\n

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

\n\t\uff081\uff09\uff0e\u4fe1\u53f7\u4ea7\u751f\u7684\u65b9\u6cd5<\/p>\n

\n\t500Hz\u4fe1\u53f7\u5468\u671f\u4e3a2ms\uff0c\u4fe1\u53f7\u7535\u5e73\u4e3a\u6bcf1ms\u53d8\u53cd1\u6b21\uff0c1KHz\u7684\u4fe1\u53f7\u5468\u671f\u4e3a1ms\uff0c\u4fe1\u53f7\u7535\u5e73\u6bcf500us\u53d8\u53cd1\u6b21\uff1b<\/p>\n

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

\n\t\"AT89S51\u5355\u7247\u673a\u62a5\u8b66\u5668\u7684\u8bbe\u8ba1\"<\/p>\n

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

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

\n\tFLAG BIT 00H<\/p>\n

\n\tORG 00H<\/p>\n

\n\tSTART\uff1a JB P1.7\uff0cSTART<\/p>\n

\n\tJNB FLAG\uff0cNEXT<\/p>\n

\n\tMOV R2\uff0c#200<\/p>\n

\n\tDV\uff1a CPL P1.0<\/p>\n

\n\tLCALL DELY500<\/p>\n

\n\tLCALL DELY500<\/p>\n

\n\tDJNZ R2\uff0cDV<\/p>\n

\n\tCPL FLAG<\/p>\n

\n\tNEXT\uff1a MOV R2\uff0c#200<\/p>\n

\n\tDV1\uff1a CPL P1.0<\/p>\n

\n\tLCALL DELY500<\/p>\n

\n\tDJNZ R2\uff0cDV1<\/p>\n

\n\tCPL FLAG<\/p>\n

\n\tSJMP START<\/p>\n

\n\tDELY500\uff1a MOV R7\uff0c#250<\/p>\n

\n\tLOOP\uff1a NOP<\/p>\n

\n\tDJNZ R7\uff0cLOOP<\/p>\n

\n\tRET<\/p>\n

\n\tEND<\/p>\n

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

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

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

\n\tbit flag;<\/p>\n

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

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

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

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

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

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

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

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

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

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

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

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

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

\n\tif\uff08P1_7==0\uff09<\/p>\n

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

\n\tfor\uff08count=200;count\u300b0;count--\uff09<\/p>\n

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

\n\tP1_0=~P1_0;<\/p>\n

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

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

\n\tfor\uff08count=200;count\u300b0;count--\uff09<\/p>\n

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

\n\tP1_0=~P1_0;<\/p>\n

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

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

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

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

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

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

1\uff0e\u5b9e\u9a8c\u4efb\u52a1 \u7528P1.0\u8f93\u51fa1KHz\u548c500Hz\u7684\u97f3\u9891\u4fe1\u53f7\u9a71\u52a8\u626c\u58f0\u5668\uff0c\u4f5c\u62a5\u8b66\u4fe1\u53f7\uff0c\u8981\u6c421KHz\u4fe1\u53f7\u54cd100ms\uff0c500Hz\u4fe1\u53f7\u54cd200ms\uff0c\u4ea4\u66ff\u8fdb\u884c\uff0cP1.7\u63a5\u4e00\u5f00\u5173\u8fdb\u884c\u63a7\u5236\uff0c\u5f53\u5f00\u5173\u5408\u4e0a\u54cd\u62a5\u8b66\u4fe1\u53f7\uff0c\u5f53\u5f00\u5173\u65ad\u5f00\u544a\u8b66<\/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\/2425"}],"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=2425"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2425\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2425"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}