{"id":2887,"date":"2019-11-13T02:06:31","date_gmt":"2019-11-13T02:06:31","guid":{"rendered":""},"modified":"2019-11-13T10:06:55","modified_gmt":"2019-11-13T02:06:55","slug":"pic%e5%8d%95%e7%89%87%e6%9c%ba%e7%9a%84%e5%90%84%e7%a7%8d%e6%b1%87%e7%bc%96%e8%af%ad%e8%a8%80%e6%8c%87%e4%bb%a4%e7%9a%84%e7%94%a8%e6%b3%95%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2887","title":{"rendered":"PIC\u5355\u7247\u673a\u7684\u5404\u79cd\u6c47\u7f16\u8bed\u8a00\u6307\u4ee4\u7684\u7528\u6cd5\u89e3\u6790"},"content":{"rendered":"

\n\t\u5de5\u4f5c\u4ee5\u6765\u4e00\u76f4\u4f7f\u7528ST\u7684\u5355\u7247\u673a<\/u>\uff0c\u5176\u4ed6\u7684\u5355\u7247\u673a\u867d\u5927\u81f4\u4e86\u89e3\u4f46\u4ece\u672a\u8ba4\u771f\u770b\u8fc7\uff0c\u8fd1\u51e0\u65e5\u6070\u597d\u65e0\u4e8b\uff0c\u51b3\u5b9a\u719f\u6089\u4e00\u4e0bPI<\/u>C\u7684\u5355\u7247\u673a\uff0c\u4e8e\u662f\u60f3\u5c06\u81ea\u5df1\u4ece\u7f51\u4e0a\u6216\u8fd9\u4e66\u672c\u4e0a\u7684\u4e1c\u897f\u8f6c\u4e0b\u6765\uff0c\u4e88\u4ee5\u540c\u4e00\u6837\u7684\u521d\u5b66\u8005\u5171\u540c\u53c2\u8003\u3002<\/p>\n

\n\tPIC\u7684\u6307\u4ee4\u7cfb\u7edf<\/p>\n

\n\t <\/div>\n

\n\tPIC 8\u4f4d\u5355\u7247\u673a\u5171\u6709\u4e09\u4e2a\u7ea7\u522b\uff0c\u6709\u76f8\u5bf9\u5e94\u7684\u6307\u4ee4\u96c6\u3002\u57fa\u672c\u7ea7PIC\u7cfb\u5217\u82af\u7247\u5171\u6709\u6307\u4ee433\u6761\uff0c\u6bcf\u6761\u6307\u4ee4\u662f12\u4f4d\u5b57\u957f\uff1b\u4e2d\u7ea7PIC\u7cfb\u5217\u82af\u7247\u5171\u6709\u6307\u4ee435\u6761\uff0c\u6bcf\u6761\u6307\u4ee4\u662f14\u4f4d\u5b57\u957f\uff1b\u9ad8\u7ea7PIC\u7cfb\u5217\u82af\u7247\u5171\u6709\u6307\u4ee458\u6761\uff0c\u6bcf\u6761\u6307\u4ee4\u662f16\u4f4d\u5b57\u957f\u3002\u5176\u6307\u4ee4\u5411\u4e0b\u517c\u5bb9\u3002<\/p>\n

\n\t\"PIC\u5355\u7247\u673a\u7684\u5404\u79cd\u6c47\u7f16\u8bed\u8a00\u6307\u4ee4\u7684\u7528\u6cd5\u89e3\u6790\"<\/p>\n

\n\t\u4e00\u3001PIC\u6c47\u7f16\u8bed\u8a00\u6307\u4ee4\u683c\u5f0f<\/p>\n

\n\tPIC\u7cfb\u5217\u5fae\u63a7\u5236\u5668\u6c47\u7f16\u8bed\u8a00\u6307\u4ee4\u4e0eMCS\uff0d51\u7cfb\u5217\u5355\u7247\u673a\u6c47\u7f16\u8bed\u8a00\u4e00\u6837\uff0c\u6bcf\u6761\u6c47\u7f16\u8bed\u8a00\u6307\u4ee4\u75314\u4e2a\u90e8\u5206\u7ec4\u6210\uff0c\u5176\u4e66\u5199\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

\n\t\u6807\u53f7\u3000\u64cd\u4f5c\u7801\u52a9\u8bb0\u7b26\u3000\u64cd\u4f5c\u65701\uff0c\u64cd\u4f5c\u65702\uff1b\u6ce8\u91ca<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\u8bf4\u660e\u5982\u4e0b\uff1a\u6307\u4ee4\u76844\u4e2a\u90e8\u5206\u4e4b\u95f4\u7531\u7a7a\u683c\u4f5c\u9694\u79bb\u7b26\uff0c\u7a7a\u683c\u53ef\u4ee5\u662f1\u683c\u6216\u591a\u683c\uff0c\u4ee5\u4fdd\u8bc1\u4ea4\u53c9\u6c47\u7f16\u65f6\uff0cPC\u673a\u80fd\u8bc6\u522b\u6307\u4ee4\u3002<\/p>\n

\n\t1\ue010\u6807\u53f7\u3000\u4e0eMCS\uff0d51\u7cfb\u5217\u5355\u7247\u673a\u529f\u80fd\u76f8\u540c\uff0c\u6807\u53f7\u4ee3\u8868\u6307\u4ee4\u7684\u7b26\u53f7\u5730\u5740\u3002\u5728\u7a0b\u5e8f\u6c47\u7f16\u65f6\uff0c\u5df2\u8d4b\u4ee5\u6307\u4ee4\u5b58\u50a8\u5668<\/u>\u5730\u5740\u7684\u5177\u4f53\u6570\u503c\u3002\u6c47\u7f16\u8bed\u8a00\u4e2d\u91c7\u7528\u7b26\u53f7\u5730\u5740\uff08\u5373\u6807\u53f7\uff09\u662f\u4fbf\u4e8e\u67e5\u770b\u3001\u4fee\u6539\uff0c\u5c24\u5176\u662f\u4fbf\u4e8e\u6307\u4ee4\u8f6c\u79fb\u5730\u5740\u7684\u8868\u793a\u3002\u6807\u53f7\u662f\u6307\u4ee4\u683c\u5f0f\u4e2d\u7684\u53ef\u9009\u9879\uff0c\u53ea\u6709\u5728\u88ab\u5176\u5b83\u8bed\u53e5\u5f15\u7528\u65f6\u624d\u9700\u6d3e\u4e0a\u6807\u53f7\u3002\u5728\u65e0\u6807\u53f7\u7684\u60c5\u51b5\u4e0b\uff0c\u6307\u4ee4\u52a9\u8bb0\u7b26\u524d\u9762\u5fc5\u987b\u4fdd\u7559\u4e00\u4e2a\u6216\u4e00\u4e2a\u4ee5\u4e0a\u7684\u7a7a\u683c\u518d\u5199\u6307\u4ee4\u52a9\u8bb0\u7b26\u3002\u6307\u4ee4\u52a9\u8bb0\u7b26\u4e0d\u80fd\u5360\u7528\u6807\u53f7\u7684\u4f4d\u7f6e\uff0c\u5426\u5219\u8be5\u52a9\u8bb0\u7b26\u4f1a\u88ab\u6c47\u7f16\u7a0b\u5e8f\u4f5c\u6807\u53f7\u8bef\u5904\u7406\u3002<\/p>\n

\n\t\u4e66\u5199\u6807\u53f7\u65f6\uff0c\u89c4\u5b9a\u7b2c\u4e00\u5b57\u7b26<\/u>\u5fc5\u987b\u662f\u5b57\u6bcd\u6216\u534a\u89d2\u4e0b\u5212\u7ebf“—”\uff0c\u5b83\u540e\u9762\u53ef\u4ee5\u8ddf\u82f1\u6587\u548c\u6570\u5b57\u5b57\u7b26\u3001\u5192\u53f7\uff08\uff1a\uff09\u5236\u7b26\u8868\u7b49\uff0c\u5e76\u53ef\u4efb\u610f\u7ec4\u5408\u3002\u518d\u6709\u6807\u53f7\u4e0d\u80fd\u7528\u64cd\u4f5c\u7801\u52a9\u8bb0\u7b26\u548c\u5bc4\u5b58\u5668<\/u>\u7684\u4ee3\u53f7\u8868\u793a\u3002\u6807\u53f7\u4e5f\u53ef\u4ee5\u5355\u72ec\u5360\u4e00\u884c\u3002<\/p>\n

\n\t2\ue010\u64cd\u4f5c\u7801\u52a9\u8bb0\u7b26\u3000\u8be5\u5b57\u6bb5\u662f\u6307\u4ee4\u7684\u5fc5\u9009\u9879\u3002\u8be5\u9879\u53ef\u4ee5\u662f\u6307\u4ee4\u52a9\u8bb0\u7b26\uff0c\u4e5f\u53ef\u4ee5\u7531\u4f2a\u6307\u4ee4\u53ca\u5b8f\u547d\u4ee4\u7ec4\u6210\uff0c\u5176\u4f5c\u7528\u662f\u5728\u4ea4\u53c9\u6c47\u7f16\u65f6\uff0c“\u6307\u4ee4\u64cd\u4f5c\u7801\u52a9\u8bb0\u7b26”\u4e0e“\u64cd\u4f5c\u7801\u8868”\u8fdb\u884c\u9010\u4e00\u6bd4\u8f83\uff0c\u627e\u51fa\u5176\u76f8\u5e94\u7684\u673a\u5668\u7801\u4e00\u4e00\u4ee3\u4e4b\u3002<\/p>\n

\n\t3\ue010\u64cd\u4f5c\u6570\u3000\u7531\u64cd\u4f5c\u6570\u7684\u6570\u636e\u503c\u6216\u4ee5\u7b26\u53f7\u8868\u793a\u7684\u6570\u636e\u6216\u5730\u5740\u503c\u7ec4\u6210\u3002\u82e5\u64cd\u4f5c\u6570\u6709\u4e24\u4e2a\uff0c\u5219\u4e24\u4e2a\u64cd\u4f5c\u6570\u4e4b\u95f4\u7528\u9017\u53f7\uff08\uff0c\uff09\u5206\u5f00\u3002\u5f53\u64cd\u4f5c\u6570\u662f\u5e38\u6570\u65f6\uff0c\u5e38\u6570\u53ef\u4ee5\u662f\u4e8c\u8fdb\u5236\u3001\u516b\u8fdb\u5236\u3001\u5341\u8fdb\u5236\u6216\u5341\u516d\u8fdb\u5236\u6570\u3002\u8fd8\u53ef\u4ee5\u662f\u88ab\u5b9a\u4e49\u8fc7\u7684\u6807\u53f7\u3001\u5b57\u7b26\u4e32\u548cASC\u2161\u7801\u7b49\u3002\u5177\u4f53\u8868\u793a\u65f6\uff0c\u89c4\u5b9a\u5728\u4e8c\u8fdb\u5236\u6570\u524d\u51a0\u4ee5\u5b57\u6bcd“B”\uff0c\u4f8b\u5982B10011100\uff1b\u516b\u8fdb\u5236\u6570\u524d\u51a0\u4ee5\u5b57\u6bcd“O”\uff0c\u4f8b\u5982O257\uff1b\u5341\u8fdb\u5236\u6570\u524d\u51a0\u4ee5\u5b57\u6bcd“D”\uff0c\u4f8b\u5982D122\uff1b\u5341\u516d\u8fdb\u5236\u6570\u524d\u51a0\u4ee5“H”\uff0c\u4f8b\u5982H2F\u3002\u5728\u8fd9\u91ccPIC 8\u4f4d\u5355\u7247\u673a\u9ed8\u8ba4\u8fdb\u5236\u662f\u5341\u516d\u8fdb\u5236\uff0c\u5728\u5341\u516d\u8fdb\u5236\u6570\u4e4b\u524d\u52a0\u4e0aOx\uff0c\u5982H2F\u53ef\u4ee5\u5199\u6210Ox2F\u3002<\/p>\n

\n\t\u6307\u4ee4\u7684\u64cd\u4f5c\u6570\u9879\u4e5f\u662f\u53ef\u9009\u9879\u3002<\/p>\n

\n\tPIC\u7cfb\u5217\u4e0eMCS\uff0d51\u7cfb\u52178\u4f4d\u5355\u7247\u673a\u4e00\u6837\uff0c\u5b58\u5728\u5bfb\u5740\u65b9\u6cd5\uff0c\u5373\u64cd\u4f5c\u6570\u7684\u6765\u6e90\u6216\u53bb\u5411\u95ee\u9898\u3002\u56e0PIC\u7cfb\u5217\u5fae\u63a7\u5236\u5668\u91c7\u7528\u4e86\u7cbe\u7b80\u6307\u4ee4\u96c6\uff08RISC<\/u>\uff09\u7ed3\u6784\u4f53\u7cfb\uff0c\u5176\u5bfb\u5740\u65b9\u5f0f\u548c\u6307\u4ee4\u90fd\u65e2\u5c11\u800c\u53c8\u7b80\u5355\u3002\u5176\u5bfb\u5740\u65b9\u5f0f\u6839\u636e\u64cd\u4f5c\u6570\u6765\u6e90\u7684\u4e0d\u540c\uff0c\u53ef\u5206\u4e3a\u7acb\u5373\u6570\u5bfb\u5740\u3001\u76f4\u63a5\u5bfb\u5740\u3001\u5bc4\u5b58\u5668\u95f4\u63a5\u5bfb\u5740\u548c\u4f4d\u5bfb\u5740\u56db\u79cd\u3002\u6240\u4ee5PIC\u7cfb\u5217\u5355\u7247\u673a\u6307\u4ee4\u4e2d\u7684\u64cd\u4f5c\u6570\u5e38\u5e38\u51fa\u73b0\u6709\u5173\u5bc4\u5b58\u5668\u7b26\u53f7\u3002\u6709\u5173\u7684\u5bfb\u5740\u5b9e\u4f8b\uff0c\u5747\u53ef\u5728\u672c\u6587\u7684\u540e\u9762\u627e\u5230\u3002<\/p>\n

\n\t4\ue010\u6ce8\u91ca\u3000\u7528\u6765\u5bf9\u7a0b\u5e8f\u4f5c\u4e9b\u8bf4\u660e\uff0c\u4fbf\u4e8e\u4eba\u4eec\u9605\u8bfb\u7a0b\u5e8f\u3002\u6ce8\u91ca\u5f00\u59cb\u4e4b\u524d\u7528\u5206\u53f7\uff08\uff1b\uff09\u4e0e\u5176\u5b83\u90e8\u5206\u76f8\u9694\u3002\u5f53\u6c47\u7f16\u7a0b\u5e8f\u68c0\u6d4b\u5230\u5206\u53f7\u65f6\uff0c\u5176\u540e\u9762\u7684\u5b57\u7b26\u4e0d\u518d\u5904\u7406\u3002\u503c\u5f97\u6ce8\u610f\uff1a\u5728\u7528\u5230\u5b50\u7a0b\u5e8f\u65f6\u5e94\u8bf4\u660e\u7a0b\u5e8f\u7684\u5165\u53e3\u6761\u4ef6\u3001\u51fa\u53e3\u6761\u4ef6\u4ee5\u53ca\u8be5\u7a0b\u5e8f\u5e94\u5b8c\u6210\u7684\u529f\u80fd\u548c\u4f5c\u7528\u3002<\/p>\n

\n\t\u4e8c\u3001\u6e05\u96f6\u6307\u4ee4\uff08\u51714\u6761\uff09<\/p>\n

\n\t1\ue010\u5bc4\u5b58\u5668\u6e05\u96f6\u6307\u4ee4<\/p>\n

\n\t\u5b9e\u4f8b\uff1aCLRW\uff1b\u5bc4\u5b58\u5668W\u88ab\u6e05\u96f6<\/p>\n

\n\t\u8bf4\u660e\uff1a\u8be5\u6761\u6307\u4ee4\u5f88\u7b80\u5355\uff0c\u5176\u4e2dW\u4e3aPIC\u5355\u7247\u673a\u7684\u5de5\u4f5c\u5bc4\u5b58\u5668\uff0c\u76f8\u5f53\u4e8eMCS\uff0d51\u7cfb\u5217\u5355\u7247\u673a\u4e2d\u7684\u7d2f\u52a0\u5668A\uff0cCLR\u662f\u82f1\u8bedClear\u7684\u7f29\u5199\u5b57\u6bcd\u3002<\/p>\n

\n\t2\ue010\u770b\u95e8\u72d7<\/u>\u5b9a\u65f6\u5668<\/u>\u6e05\u96f6\u6307\u4ee4\u3002<\/p>\n

\n\t\u5b9e\u4f8b\uff1aCLRWDT\uff1b\u770b\u95e8\u72d7\u5b9a\u65f6\u5668\u6e05\u96f6\uff08\u82e5\u5df2\u8d4b\u503c\uff0c\u540c\u65f6\u6e05\u9884\u5206\u9891\u5668\uff09<\/p>\n

\n\t\u8bf4\u660e\uff1aWDT\u662f\u82f1\u8bedWatchdog Ti<\/u>mer\u7684\u7f29\u5199\u5b57\u6bcd\u3002CLR\u89c1\u4e0a\u8ff0\u8bf4\u660e\u3002\u6ce8\u610f\u8be5\u4e24\u6761\u6307\u4ee4\u65e0\u64cd\u4f5c\u6570\u3002<\/p>\n

\n\t3\ue010\u5bc4\u5b58\u5668f\u6e05\u96f6\u6307\u4ee4\u3002\u6307\u4ee4\u683c\u5f0f\uff1aCLRF<\/u> f<\/p>\n

\n\t\u5b9e\u4f8b\uff1aCLRF TMRO\uff1b\u5bf9TMRO\u6e05\u96f6<\/p>\n

\n\t\u8bf4\u660e\uff1a\u5728PIC\u7cfb\u52178\u4f4d\u5355\u7247\u673a\u4e2d\uff0c\u5e38\u7528\u7b26\u53f7F\uff08\u6216f\uff09\u4ee3\u8868\u7247\u5185\u7684\u5404\u79cd\u5bc4\u7a0b\u5668\u548cF\u7684\u5e8f\u53f7\u5730\u5740\u3002F\u53d6\u503c\u6309PIC\u7cfb\u5217\u4e0d\u540c\u578b\u53f7\u800c\u4e0d\u540c\uff0c\u4e00\u822c\u4e3aOx00\uff5eOx1F\/7F\/FF\u3002TMRO\u4ee3\u8868\u5b9a\u65f6\u5668\/\u8ba1\u6570\u5668TMRO\uff0c\u6240\u4ee5CLRF\u5bf9\u5bc4\u7a0b\u5668\u6e05\u96f6\uff0c\u91c7\u7528\u4e86\u76f4\u63a5\u5bfb\u5740\u65b9\u5f0f\u76f4\u63a5\u7ed9\u51fa\u8981\u8bbf\u95ee\u7684\u5bc4\u5b58\u5668TMRO\u3002<\/p>\n

\n\t4\ue010\u4f4d\u6e05\u96f6\u6307\u4ee4\u3002\u6307\u4ee4\u683c\u5f0f BCF f\uff0cb<\/p>\n

\n\t\u5b9e\u4f8b\uff1aBCF REG1\uff0c2\uff1b\u628a\u5bc4\u5b58\u5668REG1\u7684D2\u4f4d\u6e05\u96f6<\/p>\n

\n\t\u8bf4\u660e\uff1aBCF\u662f\u82f1\u8bedBit Clear F\u7684\u7f29\u5199\u3002\u6307\u4ee4\u683c\u5f0f\u4e2d\u7684F\uff0c\u540c\u4e0a\u8bf4\u660e\uff1b\u7b26\u53f7b\u662f\u8868\u793aPIC\u7247\u5185\u67d0\u4e2a8\u4f4d\u6570\u636e\u5bc4\u5b58\u5668F\u7684\u4f4d\u53f7\uff08\u6216\u4f4d\u5730\u5740\uff09\uff0c\u6240\u4ee5b\u7684\u53d6\u503c\u4e3a0\uff5e7\u6216D0\uff5eD7\u3002\u5b9e\u4f8b\u4e2dREG\u662fRegiste<\/u>r\u7684\u7f29\u5199\u3002\u5b9e\u4f8b\u4e2d\u76842\u4ee3\u8868\u6307\u4ee4\u683c\u5f0f\u4e2d\u7684b=2\u5373\u5bc4\u5b58\u5668REG1\u7684D2\u4f4d\u3002<\/p>\n

\n\t\u901a\u8fc7\u4e0a\u8ff0\u56db\u6761\u6e05\u96f6\u6307\u4ee4\u683c\u5f0f\u548c\u5b9e\u4f8b\uff0c\u53ef\u4ee5\u8bf4\u660e\uff0c\u5b66\u4e60PIC\u7cfb\u52178\u4f4d\u5355\u7247\u673a\u7684\u6307\u4ee4\u65f6\u5e94\u9996\u5148\u4e86\u89e3\u6307\u4ee4\u7684\u52a9\u8bb0\u7b26\u610f\u4e49\uff08\u529f\u80fd\uff09\uff0c\u518d\u6709\u5c31\u662f\u5b83\u7684\u8868\u8fbe\u65b9\u5f0f\u3002\u521d\u5b66\u8005\u6ca1\u6709\u5fc5\u8981\u6b7b\u8bb0\u6307\u4ee4\uff0c\u91cd\u8981\u662f\u7406\u89e3\u548c\u5b9e\u8df5\u3002<\/p>\n

\n\t\u4e09\u3001\u9762\u5411\u5b57\u8282\u3001\u5e38\u6570\u4e0e\u63a7\u5236\u64cd\u4f5c\u7684\u6307\u4ee4<\/p>\n

\n\t1\ue010\u4f20\u9001\u7acb\u5373\u6570\u81f3\u5de5\u4f5c\u5bc4\u5b58\u5668W\u6307\u4ee4<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\uff1aMOVLW k\uff1bk\u8868\u793a\u5e38\u6570\u3001\u7acb\u5373\u6570\u548c\u6807\u53f7<\/p>\n

\n\t\u8bf4\u660e\uff1aMOVLW\u662fMove Literal to w\u7684\u7f29\u5199<\/p>\n

\n\t\u5b9e\u4f8b\uff1aMOVL 0x1E\uff1b\u5e38\u657030\u9001W<\/p>\n

\n\t2\ue010I\/O<\/u>\u53e3\u63a7\u5236\u5bc4\u5b58\u5668TRIS\u8bbe\u7f6e\u6307\u4ee4<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\uff1bTRIS\u3000f<\/p>\n

\n\t\u8bf4\u660e\uff1bTRIS f\u662fLoad TRIS Register\u7684\u7f29\u5199\u3002\u5176\u529f\u80fd\u662f\u628a\u5de5\u4f5c\u5bc4\u5b58\u5668W\u7684\u5185\u5bb9\u9001\u5165I\/O\u53e3\u63a7\u5236\u5bc4\u5b58\u5668f\u3002\u5f53W=0\u65f6\uff0c\u7f6e\u5bf9\u5e94I\/O\u53e3\u4e3a\u8f93\u51fa\uff1bW=1\uff0c\u7f6eI\/O\u53e3\u4e3a\u8f93\u5165\u3002<\/p>\n

\n\t\u5b9e\u4f8b\uff1aMOVLW 0x00 \uff1b\u628a00H\u9001\u5165W<\/p>\n

\n\tTRIS RA \uff1b\u7f6ePIC RA\u53e3\u4e3a\u8f93\u51fa<\/p>\n

\n\tMOVLW 0xFF \uff1b\u628aFFH\u9001\u5165W<\/p>\n

\n\tTRIS RB \uff1b\u7f6ePIC RB\u53e3\u4e3a\u8f93\u5165<\/p>\n

\n\t\u8bf4\u660e\uff1a\u8fd9\u662fPIC\u6c47\u7f16\u8bed\u8a00\u4e2d\u5e38\u7528\u7684\u51e0\u6761\u6307\u4ee4\uff0c\u5373\u8bbe\u7f6e\u67d0\u4e2aI\/O\u53e3\uff08\u8fd9\u91cc\u662fRA\u53e3\u548cRB\u53e3\uff09\u4e3a\u8f93\u5165\u6216\u8f93\u51fa\u7684\u8bed\u53e5\u3002\u53ef\u89c1\uff0c\u8bc6\u8bfb\u6307\u4ee4\u65f6\uff0c\u4e00\u5e94\u5145\u5206\u7406\u89e3\u8bed\u53e5\u683c\u5f0f\u7684\u529f\u80fd\uff0c\u4e8c\u5e94\u524d\u540e\u8054\u7cfb\u9605\u8bfb\u3002<\/p>\n

\n\t3\ue010W\u5bc4\u5b58\u5668\u5185\u5bb9\u9001\u5bc4\u5b58\u5668f\uff08W\u5185\u5bb9\u4fdd\u6301\u4e0d\u53d8\uff09\u6307\u4ee4<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\uff1aMOVWF f<\/p>\n

\n\t\u8bf4\u660e\uff1aMOVWF\u662fMove W to f\u7684\u7f29\u5199<\/p>\n

\n\t\u5b9e\u4f8b\uff1aMOVLW 0x0B\uff1b\u90010BH\u9001W<\/p>\n

\n\tMOVWF 6 \uff1b\u9001W\u5185\u5bb9\u5230RB\u53e3<\/p>\n

\n\t\u8bf4\u660e\uff1a\u7b2c\u4e00\u6761\u6307\u4ee40x0B\uff08\u5e38\u657011\uff09\u9001\u5de5\u4f5c\u5bc4\u5b58\u5668W\uff0c\u7b2c\u4e8c\u6761\u6307\u4ee4\uff0c\u628aW\u5185\u5bb9\u5e38\u657011\u9001\u5230\u5bc4\u5b58\u5668F6\u4e2d\uff0c\u67e5\u8868F6\u5373\u4e3aRB\u53e3\uff0c\u6240\u4ee5PORT_B\uff08B\u53e3\uff09=0BH=D11<\/p>\n

\n\t4\ue010\u5bc4\u5b58\u5668f\u4f20\u9001\u6307\u4ee4<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\uff1aMOVF f\uff0cd<\/p>\n

\n\t\u8bf4\u660e\uff1aMOVF\u662fMove f\u7684\u7f29\u5199\u3002F\u4ee3\u8868PIC\u4e2d\u7684\u67d0\u4e2a\u5bc4\u5b58\u5668\u3002\u6307\u4ee4\u4e2d\u7684d\u89c4\u5b9a\uff1ad=0\u65f6\uff0cf\u5185\u5bb9\u9001W\uff1bd=1\u65f6\uff0cf\u5185\u5bb9\u9001\u5bc4\u5b58\u5668\u3002<\/p>\n

\n\t\u5b9e\u4f8b\uff1aMOVF 6\uff0c0 \uff1bRB\u53e3\u5185\u5bb9\u9001W<\/p>\n

\n\tMOVWF 8\u3000 \uff1bRB\u53e3\u5185\u5bb9\u9001f8<\/p>\n

\n\t\u8bf4\u660e\uff1a\u7b2c\u4e00\u6761\u6307\u4ee4\u4e2d\u76846\u4ee3\u8868\u5bc4\u5b58\u5668f=6\uff0c\u67e5\u5bc4\u5b58\u5668\u8868f=6\u4e3aRB\u53e3\uff1b0\u4ee3\u8868d=0\uff0c\u4ee3\u8868\u9009\u62e9\u7684\u76ee\u6807\u4e3a\u5bc4\u5b58\u5668W\u3002\u7b2c\u4e8c\u6761\u6307\u4ee4\u4e2d\u76848\u4ee3\u8868\u5bc4\u5b58\u5668f=8\u3002\u6240\u4ee5\u4e24\u6761\u6307\u4ee4\u7ed3\u679c\u662f\u628aRB\u53e3\u7684\u5185\u5bb9\u9001f8\u3002\u81f3\u4e8ef8\u5185\u5bb9\u662f\u591a\u5c11\uff1f\u8fd8\u5e94\u5728\u6c47\u7f16\u8bed\u8a00\u5f00\u59cb\u65f6\u9644\u52a0\u6307\u4ee4\uff0c\u8fd9\u91cc\u4ece\u7565\u3002<\/p>\n

\n\t5\ue010\u7a7a\u64cd\u4f5c\u6307\u4ee4<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\uff1aNOP<\/p>\n

\n\t\u8bf4\u660e\uff1aNOP\u662f\u82f1\u8bedNo OperaTIon\u7684\u7f29\u5199\u3002NOP\u65e0\u64cd\u4f5c\u6570\uff0c\u6240\u4ee5\u79f0\u4e3a\u7a7a\u64cd\u4f5c\u3002\u6267\u884cNOP\u6307\u4ee4\u53ea\u4f7f\u7a0b\u5e8f\u8ba1\u6570\u5668PC\u52a01\uff0c\u6240\u4ee5\u5360\u7528\u4e00\u4e2a\u673a\u5668\u5468\u671f\u3002<\/p>\n

\n\t\u5b9e\u4f8b\uff1aMOVLW 0xOF\u3000\u3000 \uff1b\u9001OFH\u5230W<\/p>\n

\n\tMOVWF PORT_B \uff1bW\u5185\u5bb9\u5199\u5165B\u53e3<\/p>\n

\n\tNOP\u3000\u3000\u3000\u3000\u3000 \uff1b\u7a7a\u64cd\u4f5c<\/p>\n

\n\tMOVF PORT_B\uff0cW \uff1b\u8bfb\u64cd\u4f5c<\/p>\n

\n\t\u8bf4\u660e\uff1a\u8be5\u4e09\u6761\u6307\u4ee4\u662f\u4e00\u79cd\u5bf9I\/O\u53e3\u7684B\u53e3\u8fde\u7eed\u64cd\u4f5c\u7684\u5b9e\u4f8b\uff0c\u5176\u76ee\u7684\u8fbe\u5230\u5199\u5165B\u53e3\u7684\u5185\u5bb9\u8981\u8bfb\u51fa\u65f6\uff0c\u5e94\u4fdd\u8bc1\u5199\u3001\u8bfb\u4e4b\u95f4\u6709\u4e2a\u7a33\u5b9a\u65f6\u95f4\uff0c\u56e0\u6b64\u52a0\u5165\u4e86\u7a7a\u64cd\u4f5c\u6307\u4ee4NOP\u3002<\/p>\n

\n\t6\ue010\u65e0\u6761\u4ef6\u8df3\u8f6c\u6307\u4ee4<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\uff1aGOTO k<\/p>\n

\n\t\u8bf4\u660e\uff1a\u6267\u884c\u8be5\u6761\u6307\u4ee4\u65f6\uff0c\u5c06\u6307\u4ee4\u8f6c\u79fb\u5230\u6307\u5b9a\u7684\u5730\u5740\uff08\u8df3\u8f6c\uff09\u3002\u6307\u4ee4\u4e2d\u7684k\uff0c\u5e38\u4e0e\u7a0b\u5e8f\u4e2d\u7684\u6807\u53f7\u8054\u7cfb\u8d77\u6765\u3002<\/p>\n

\n\t\u5b9e\u4f8b\uff1a\u89c1\u7b2c9\u6761\u6307\u4ee4\u4e2d<\/p>\n

\n\t7\ue010\u5bc4\u5b58\u5668\u5185\u5bb9\u51cf1\uff0c\u7ed3\u679c\u4e3a\u96f6\u7684\u95f4\u8df3\u6307\u4ee4<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\uff1aDECFSZ f\uff0cd<\/p>\n

\n\t\u8bf4\u660e\uff1aDECFSZ\u662f\u82f1\u8bedDecrement f\uff0cSkip of not 0\u7684\u7f29\u5199\u3002\u7b26\u53f7f\uff0cd\u4ee3\u8868\u7684\u610f\u4e49\uff0c\u524d\u8ff0\u5df2\u4f5c\u8bf4\u660e\u3002\u8be5\u6761\u6307\u4ee4\u662f\u6307\u5bc4\u5b58\u5668\u7684\u5185\u5bb9\u51cf1\u5b58\u5165W\uff08d=0\uff09\u6216f\uff08d=1\uff09\u4e2d\u3002\u82e5\u6307\u4ee4\u6267\u884c\u7ed3\u679c\u51cf1\u4e0d\u4e3a\u96f6\uff0c\u6307\u4ee4\u987a\u5e8f\u6267\u884c\uff1b\u4e3a\u96f6\u65f6\uff0c\u5c31\u95f4\u8df3\u4e0b\u4e00\u6761\u6307\u4ee4\u540e\u518d\u6267\u884c\uff08\u7b49\u6548\u987a\u5e8f\u6267\u884c\u4e00\u6761\u7a7a\u6307\u4ee4NOP\uff09\uff0c\u5b9e\u9645\u6307\u4ee4\u4e2d\uff0c\u5f53d=1\u65f6\uff0c\u8be5\u9879\u5e38\u88ab\u7565\u53bb\u3002<\/p>\n

\n\t8\ue010\u5bc4\u5b58\u5668\u5185\u5bb9\u52a01\uff0c\u7ed3\u679c\u4e3a\u96f6\u95f4\u8df3\u6307\u4ee4<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\uff1aINCFSZ f\uff0cd<\/p>\n

\n\t\u8bf4\u660e\uff1aINCFSZ\u662f\u82f1\u8bedIncrement f\uff0cSkip of 0\u7684\u7f29\u5199\u3002\u8be5\u6761\u6307\u4ee4\u4e0e\u4e0a\u4e00\u6761\uff087\uff09\u6307\u4ee4\u5dee\u522b\u4ec5\u5728\u4e8e“1”\u4e0a\uff0c\u5373\u6267\u884c\u8fd9\u6761\u6307\u4ee4\u65f6\uff0c\u5bc4\u5b58\u5668f\u5185\u5bb9\u52a01\uff0c\u82e5\u7ed3\u679c\u4e0d\u4e3a\u96f6\uff0c\u5219\u6307\u4ee4\u987a\u5e8f\u6267\u884c\uff1b\u4e3a\u96f6\u5219\u6307\u4ee4\u95f4\u8df3\u6267\u884c\u3002\u6267\u884c\u8fd9\u6761\u6307\u4ee4\u7684\u5176\u5b83\u903b\u8f91\u5173\u7cfb\u4e0e\u4e0a\u6761\u76f8\u540c\u3002<\/p>\n

\n\t9\ue010\u5b50\u7a0b\u5e8f\u8fd4\u56de\u6307\u4ee4<\/p>\n

\n\t\u6307\u4ee4\u683c\u5f0f\uff1aRETLW k<\/p>\n

\n\t\u8bf4\u660e\uff1aRETLW\u662fReturn Literal to W\u7684\u7f29\u5199\u3002\u8be5\u6307\u4ee4\u4ee3\u8868\u5b50\u7a0b\u5e8f\u8fd4\u56de\uff0c\u8fd4\u56de\u524d\u5148\u628a8\u4f4d\u7acb\u5373\u6570\u9001W\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5de5\u4f5c\u4ee5\u6765\u4e00\u76f4\u4f7f\u7528ST\u7684 \u5355\u7247\u673a \uff0c\u5176\u4ed6\u7684\u5355\u7247\u673a\u867d\u5927\u81f4\u4e86\u89e3\u4f46\u4ece\u672a\u8ba4\u771f\u770b\u8fc7\uff0c\u8fd1\u51e0\u65e5\u6070\u597d\u65e0\u4e8b\uff0c\u51b3\u5b9a\u719f\u6089\u4e00\u4e0b PI C\u7684\u5355\u7247\u673a\uff0c\u4e8e\u662f\u60f3\u5c06\u81ea\u5df1\u4ece\u7f51\u4e0a\u6216\u8fd9\u4e66\u672c\u4e0a\u7684\u4e1c\u897f\u8f6c\u4e0b\u6765\uff0c\u4e88\u4ee5\u540c\u4e00\u6837\u7684<\/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\/2887"}],"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=2887"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2887\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2887"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}