{"id":2302,"date":"2019-04-08T13:19:23","date_gmt":"2019-04-08T13:19:23","guid":{"rendered":""},"modified":"2019-04-08T21:19:39","modified_gmt":"2019-04-08T13:19:39","slug":"51%e5%8d%95%e7%89%87%e6%9c%ba%e4%b8%b2%e8%a1%8c%e5%8f%a3%e7%9a%84%e5%b7%a5%e4%bd%9c%e6%96%b9%e5%bc%8f%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2302","title":{"rendered":"51\u5355\u7247\u673a\u4e32\u884c\u53e3\u7684\u5de5\u4f5c\u65b9\u5f0f\u89e3\u6790"},"content":{"rendered":"
\n\t1\uff09\u65b9\u5f0f0<\/p>\n
\n\t\u65b9\u5f0f0\u662f\u5916\u63a5\u4e32\u884c\u79fb\u4f4d\u5bc4\u5b58\u5668<\/u>\u65b9\u5f0f\u3002\u5de5\u4f5c\u65f6\uff0c\u6570\u636e\u4eceRXD\u4e32\u884c\u5730\u8f93\u5165\/\u8f93\u51fa\uff0cTXD\u8f93\u51fa\u79fb\u4f4d\u8109\u51b2\uff0c\u4f7f\u5916\u90e8\u7684\u79fb\u4f4d\u5bc4\u5b58\u5668\u79fb\u4f4d\u3002\u6ce2\u7279\u7387\u56fa\u5b9a\u4e3afosc\/12\uff08\u5373\uff0cTXD\u6bcf\u673a\u5668\u5468\u671f\u8f93\u51fa\u4e00\u4e2a\u540c\u4f4d\u8109\u51b2\u65f6\uff0cRXD\u63a5\u6536\u6216\u53d1\u9001\u4e00\u4f4d\u6570\u636e\uff09\u3002\u6bcf\u5f53\u53d1\u9001\u6216\u63a5\u6536\u5b8c\u4e00\u4e2a\u5b57\u8282\uff0c\u786c\u4ef6\u7f6eTI<\/u>=1\u6216RI=1\uff0c\u7533\u8bf7\u4e2d\u65ad\uff0c\u4f46\u5fc5\u987b\u7528\u8f6f\u4ef6\u6e05\u9664\u4e2d\u65ad\u6807\u5fd7\u3002<\/p>\n \n\t\u5b9e\u9645\u5e94\u7528\u5728\u4e32\u884cI\/O\u53e3\u4e0e\u5e76\u884cI\/O\u53e3\u4e4b\u95f4\u7684\u8f6c\u6362\u3002<\/p>\n \n\t2\uff09\u65b9\u5f0f1<\/p>\n \n\t\u65b9\u5f0f1\u662f\u70b9\u5bf9\u70b9\u7684\u901a\u4fe1\u65b9\u5f0f\u30028\u4f4d\u5f02\u6b65\u4e32\u884c\u901a\u4fe1\u53e3\uff0cTXD\u4e3a\u53d1\u9001\u7aef\uff0cRXD\u4e3a<\/p>\n \n\t\u63a5\u6536\u7aef\u3002\u4e00\u5e27\u4e3a10\u4f4d\uff0c1\u4f4d\u8d77\u59cb\u4f4d\u30018\u4f4d\u6570\u636e\u4f4d\uff08\u5148\u4f4e\u540e\u9ad8\uff09\u30011\u4f4d\u505c\u6b62\u4f4d\u3002\u6ce2\u7279\u7387\u7531T1\u6216T2\u7684\u6ea2\u51fa\u7387\u786e\u5b9a\u3002<\/p>\n \n\t\u5728\u53d1\u9001\u6216\u63a5\u6536\u5230\u4e00\u5e27\u6570\u636e\u540e\uff0c\u786c\u4ef6\u7f6eTI=1\u6216RI=1\uff0c\u5411CPU<\/u>\u7533\u8bf7\u4e2d\u65ad\uff1b\u4f46\u5fc5\u987b\u7528\u8f6f\u4ef6\u6e05\u9664\u4e2d\u65ad\u6807\u5fd7\uff0c\u5426\u5219\uff0c\u4e0b\u4e00\u5e27\u6570\u636e\u65e0\u6cd5\u53d1\u9001\u6216\u63a5\u6536\u3002<\/p>\n \n\t<\/p>\n \n\t\uff081\uff09\u53d1\u9001\uff1aCPU\u6267\u884c\u4e00\u6761\u5199SBUF\u6307\u4ee4\uff0c\u542f\u52a8\u4e86\u4e32\u884c\u53e3\u53d1\u9001\uff0c\u540c\u65f6\u5c061\u5199\u5165<\/p>\n \n\t\u8f93\u51fa\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u7b2c9\u4f4d\u3002\u53d1\u9001\u8d77\u59cb\u4f4d\u540e\uff0c\u5728\u6bcf\u4e2a\u79fb\u4f4d\u8109\u51b2\u7684\u4f5c\u7528\u4e0b\uff0c\u8f93\u51fa\u79fb\u4f4d\u5bc4\u5b58\u5668\u53f3\u79fb\u4e00\u4f4d\uff0c\u5de6\u8fb9\u79fb\u51650\uff0c\u5728\u6570\u636e\u6700\u9ad8\u4f4d\u79fb\u5230\u8f93\u51fa\u4f4d\u65f6\uff0c\u539f\u5199\u5165\u7684\u7b2c9\u4f4d1\u7684\u5de6\u8fb9\u5168\u662f0\uff0c\u68c0\u6d4b\u7535\u8def<\/u>\u68c0\u6d4b\u5230\u8fd9\u4e00\u6761\u4ef6\u540e\uff0c\u4f7f\u63a7\u5236\u7535\u8def\u4f5c\u6700\u540e\u4e00\u6b21\u79fb\u4f4d\uff0c\/SEND\u548cDATA\u65e0\u6548\uff0c\u53d1\u9001\u505c\u6b62\u4f4d\uff0c\u4e00\u5e27\u7ed3\u675f\uff0c\u7f6eTI=1\u3002<\/p>\n \n\t\uff082\uff09\u63a5\u6536\uff1aREN=1\u540e\uff0c\u5141\u8bb8\u63a5\u6536\u3002\u63a5\u6536\u5668\u4ee5\u6240\u9009\u6ce2\u7279\u7387\u768416\u500d\u901f\u7387\u91c7\u6837RXD<\/p>\n \n\t\u7aef\u7535\u5e73\uff0c\u5f53\u68c0\u6d4b\u5230\u4e00\u4e2a\u8d1f\u8df3\u53d8\u65f6\uff0c\u542f\u52a8\u63a5\u6536\u5668\uff0c\u540c\u65f6\u628a1FFH\u5199\u5165\u8f93\u5165\u79fb\u4f4d\u5bc4\u5b58\u5668\uff089\u4f4d\uff09\u3002\u7531\u4e8e\u63a5\u3001\u53d1\u53cc\u65b9\u65f6\u949f<\/u>\u9891\u7387\u6709\u5c11\u8bb8\u8bef\u5dee\uff0c\u4e3a\u6b64\u63a5\u6536\u63a7\u5236\u5668\u628a\u4e00\u4f4d\u4f20\u9001\u65f6\u95f416\u7b49\u5206\u91c7\u6837RXD\uff0c\u4ee5\u5176\u4e2d7\u30018\u30019\u4e09\u6b21\u91c7\u6837\u4e2d\u81f3\u5c112\u6b21\u76f8\u540c\u7684\u503c\u4e3a\u63a5\u6536\u503c\u3002\u63a5\u6536\u4f4d\u4ece\u79fb\u4f4d\u5bc4\u5b58\u5668\u53f3\u8fb9\u8fdb\u5165\uff0c1\u5de6\u79fb\u51fa\uff0c\u5f53\u6700\u5de6\u8fb9\u662f\u8d77\u59cb\u4f4d0\u65f6\uff0c\u8bf4\u660e\u5df2\u63a5\u65368\u4f4d\u6570\u636e\uff0c\u518d\u4f5c\u6700\u540e\u4e00\u6b21\u79fb\u4f4d\uff0c\u63a5\u6536\u505c\u6b62\u4f4d\u3002\u6b64\u540e\uff1a<\/p>\n \n\tA\u3001\u82e5RI=0\u3001SM2=0\uff0c\u52198\u4f4d\u6570\u636e\u88c5\u5165SBUF\uff0c\u505c\u6b62\u4f4d\u5165RB8\uff0c\u7f6eRI=1\u3002<\/p>\n \n\tB\u3001 \u82e5RI=0\u3001SM2=1\uff0c\u5219\u53ea\u6709\u505c\u6b62\u4f4d\u4e3a1\u65f6\uff0c\u624d\u6709\u4e0a\u8ff0\u7ed3\u679c\u3002<\/p>\n \n\tC\u3001\u82e5RI=0\u3001SM2=1\uff0c\u4e14\u505c\u6b62\u4f4d\u4e3a0\uff0c\u5219\u6240\u63a5\u6570\u636e\u4e22\u5931\u3002<\/p>\n \n\tD\u3001\u82e5RI=1\uff0c\u5219\u6240\u63a5\u6536\u6570\u636e\u4e22\u5931\u3002<\/p>\n \n\t\u65e0\u8bba\u51fa\u73b0\u90a3\u79cd\u60c5\u51b5\uff0c\u68c0\u6d4b\u5668\u90fd\u91cd\u65b0\u68c0\u6d4bRXD\u7684\u8d1f\u8df3\u53d8\uff0c\u4ee5\u4fbf\u63a5\u6536\u4e0b\u4e00\u5e27\u3002<\/p>\n \n\t3\uff09\u65b9\u5f0f2\u3001\u65b9\u5f0f3<\/p>\n \n\t\u65b9\u5f0f2\u548c\u65b9\u5f0f3\u662f9\u4f4d\u5f02\u6b65\u4e32\u884c\u901a\u4fe1\uff0c\u4e00\u822c\u7528\u5728\u591a\u673a\u901a\u4fe1\u7cfb\u7edf\u4e2d\u6216\u5947\u5076\u6821\u9a8c\u7684\u901a\u4fe1\u8fc7\u7a0b\u3002\u5728\u901a\u8baf\u4e2d\uff0cTB8\u548cRB8\u4f4d\u4f5c\u4e3a\u6570\u636e\u7684\u7b2c9\u4f4d\uff0c\u4f4dSM2\u4e5f\u8d77\u4f5c\u7528\u3002\u65b9\u5f0f2\u4e0e\u65b9\u5f0f3\u7684\u533a\u522b\u53ea\u662f\u6ce2\u7279\u7387\u7684\u8bbe\u7f6e\u65b9\u5f0f\u4e0d\u540c\u3002<\/p>\n \n\t\uff081\uff09\u53d1\u9001<\/p>\n \n\t\u5411SBUF\u5199\u5165\u4e00\u4e2a\u6570\u636e\u5c31\u542f\u52a8\u4e32\u53e3\u53d1\u9001\uff0c\u540c\u65f6\u5c06TB8\u5199\u5165\u8f93\u51fa\u79fb\u4f4d\u5bc4\u5b58\u5668\u7b2c9\u4f4d\u3002\u5f00\u59cb\u65f6\uff0cSEND\u548cDATA\u90fd\u662f\u4f4e\u7535\u5e73\uff0c\u628a\u8d77\u59cb\u4f4d\u8f93\u51fa\u5230TXD\u3002DATA\u4e3a\u9ad8\uff0c\u7b2c\u4e00\u6b21\u79fb\u4f4d\u65f6\uff0c\u5c06‘1’\u79fb\u5165\u8f93\u51fa\u79fb\u4f4d\u5bc4\u5b58\u5668\u7684\u7b2c9\u4f4d\uff0c\u4ee5\u540e\u6bcf\u6b21\u79fb\u4f4d\uff0c\u5de6\u8fb9\u79fb\u5165‘0’\uff0c\u5f53TB8\u79fb\u5230\u8f93\u51fa\u4f4d\u65f6\uff0c\u5176\u5de6\u8fb9\u662f\u4e00\u4e2a‘1’\u548c\u5168‘0’\u3002\u68c0\u6d4b\u5230\u6b64\u6761\u4ef6\uff0c\u518d\u8fdb\u884c\u6700\u540e\u4e00\u6b21\u79fb\u4f4d\uff0c\/SEND=1\uff0cDATA=0\uff0c\u8f93\u51fa\u505c\u6b62\u4f4d\uff0c\u7f6eTI=1\u3002<\/p>\n \n\t\uff082\uff09\u63a5\u6536<\/p>\n \n\t\u7f6eREN=1\uff0c\u4e0e\u65b9\u5f0f1\u7c7b\u4f3c\uff0c\u63a5\u6536\u5668\u4ee5\u6ce2\u7279\u7387\u768416\u500d\u901f\u7387\u91c7\u6837RXD\u7aef\u3002<\/p>\n \n\t\u8d77\u59cb\u4f4d0\u79fb\u5230\u8f93\u5165\u5bc4\u5b58\u5668\u7684\u6700\u5de6\u8fb9\u65f6\uff0c\u8fdb\u884c\u6700\u540e\u4e00\u6b21\u79fb\u4f4d\u3002\u5728RI=0\uff0cSM2=0\u6216\u63a5\u6536\u5230\u7684\u7b2c9\u4f4d=1\u65f6\uff0c\u6536\u5230\u7684\u4e00\u5b57\u8282\u6570\u636e\u88c5\u5165SBUF\uff0c\u7b2c9\u4f4d\u8fdb\u5165RB8\uff0c\u7f6eRI=1\uff1b\u7136\u540e\u53c8\u5f00\u59cb\u68c0\u6d4bRXD\u7aef\u8d1f\u8df3\u53d8\u3002<\/p>\n \n\t3\u3001 \u591a\u673a\u901a\u4fe1<\/p>\n \n\t\u5728\u8fd9\u91cc\uff0c\u591a\u673a\u7cfb\u7edf\u662f\u6307‘\u4e00\u4e3b\u591a\u4ece’\u300251\u7cfb\u5217\u5355\u7247\u673a<\/u>\u4e2d\uff0c\u5229\u7528\u7b2c9\u4f4dTB8\/RB8<\/p>\n \n\t\u6765\u533a\u5206\u5730\u5740\u4e0e\u6570\u636e\u4fe1\u606f\uff0c\u7528\u4f4dSM2\u786e\u5b9a\u63a5\u6536\u65b9\u662f\u5426\u5bf9\u5730\u5740\u6216\u6570\u636e\u5e27\u654f\u611f\u3002\u5176\u539f\u5219\u662f\uff1a<\/p>\n \n\t1\uff09\u53d1\u9001\u65b9\u7528\u7b2c9\u4f4dTB8=1\u6807\u5fd7\u5730\u5740\u5e27\uff0cTB8=0\u6807\u5fd7\u6570\u636e\u5e27\u3002<\/p>\n \n\t2\uff09\u63a5\u6536\u65b9\u82e5\u8bbe\u7f6eSM2=1\uff0c\u5219\u53ea\u80fd\u63a5\u6536\u5230\u5730\u5740\u4fe1\u606f\uff0c\u82e5\u8bbeSM2=0\uff0c\u5219\u4e0d\u7ba1\u662f\u5730\u5740\u8fd8\u662f\u6570\u636e\u5e27\uff0c\u90fd\u80fd\u63a5\u6536\u5230\u3002<\/p>\n \n\t\u5229\u7528\u65b9\u5f0f2\u30013\u7684\u7279\u70b9\uff0c\u5728\u70b9\u5bf9\u70b9\u7684\u901a\u8baf\u4e2d\uff0c\u5728\u53d1\u9001\u65b9\u53ef\u4ee5\u7528\u7b2c9\u4f4dTB8<\/p>\n \n\t\u4f5c\u4e3a\u5947\u5076\u6821\u9a8c\u4f4d\u3002\u5728\u63a5\u6536\u65b9\uff0cSM2\u4f4d\u5fc5\u987b\u6e050\u3002<\/p>\n \n\t4\u3001\u6ce2\u7279\u7387<\/p>\n \n\t1\uff09\u65b9\u5f0f0\u7684\u6ce2\u7279\u7387=fosc\/12<\/p>\n \n\t2\uff09\u65b9\u5f0f2\u7684\u6ce2\u7279\u7387=2^smod*fosc\/64<\/p>\n \n\t3\uff09\u65b9\u5f0f1\u30013\u7684\u6ce2\u7279\u7387\u7531T1\u6216T2\u7684\u6ea2\u51fa\u7387\u548cSMOD\u4f4d\u786e\u5b9a\uff1a<\/p>\n \n\t\uff081\uff09\u7528T1\uff1a\u6ce2\u7279\u7387=2^smod*T1\u5b9a\u65f6\u5668<\/u>\u7684\u6ea2\u51fa\u7387\/32\uff0cT1\u4e3a\u65b9\u5f0f2<\/p>\n \n\tT1\u5b9a\u65f6\u5668\u6ea2\u51fa\u7387=1\/\uff08\uff0812\/fosc\uff09*\uff08256-X\uff09\uff09<\/p>\n \n\t\u4f8b\uff1a\u5df2\u77e5fosc=6MHz\uff0cSMOD=0\uff0c\u8bbe\u7f6e\u6ce2\u7279\u7387\u4e3a2400\uff0c\u6c42T1\u7684\u8ba1\u6570\u521d\u503cX\u3002<\/p>\n \n\t\u6ce2\u7279\u7387=1\/\uff08\uff0812\/fosc\uff09*\uff08256-X\uff09\uff09\/32=fosc\/12*32\uff08256-X\uff09<\/p>\n \n\t\uff08256-X\uff09=fosc\/2400\/384=6M\/2400\/384\uff1b256-X~=6.5104<\/p>\n \n\tX~=250=FAH \u53ea\u80fd\u8fd1\u4f3c\u8ba1\u7b97\u3002<\/p>\n \n\t\u82e5fosc=11.0592MHz\uff0c \u5219256-X=11.0592M\/2400\/384=4068\/384=12 X=F4H\uff1b\u53ef\u7cbe\u786e\u7b97\u51fa\uff0c\u5bf9\u5176\u5b83\u5e38\u7528\u7684\u6807\u51c6\u6ce2\u7279\u7387\u4e5f\u662f\u80fd\u6b63\u786e\u7b97\u51fa\u3002\u6240\u4ee5\u8fd9\u4e2a\u6676\u632f\u9891\u7387\u662f\u6700\u5e38\u7528\u7684\u3002<\/p>\n \n\t\u5982\u679cSMOD=1\uff0c\u5219\u540c\u6837\u7684X\u521d\u503c\u5f97\u51fa\u7684\u6ce2\u7279\u7387\u52a0\u500d\u3002<\/p>\n \n\t\uff083\uff09\u7528T2\uff1a<\/p>\n \n\t\u572852\u578b\u5355\u7247\u673a\u4e2d\uff0c\u4e32\u53e3\u65b9\u5f0f1\u30013\u7684\u6ce2\u7279\u7387\u53d1\u751f\u5668\u9009\u62e9\u7531TCLK\u3001RCLK\u4f4d<\/p>\n \n\t\u786e\u5b9a\u662fT1\u8fd8\u662fT2\u3002\u82e5TCLK=1\uff0c\u5219\u53d1\u9001\u5668\u6ce2\u7279\u7387\u6765\u81eaT2\uff0c\u5426\u5219\u6765\u81eaT1\u3002\u82e5RCLK=1\uff0c\u5219\u63a5\u6536\u5668\u6ce2\u7279\u7387\u6765\u81eaT2\uff0c\u5426\u5219\u6765\u81eaT1\u3002<\/p>\n \n\t\u7531T2\u4ea7\u751f\u7684\u6ce2\u7279\u7387\u4e0eSMOD\u65e0\u5173\u3002T2\u5b9a\u65f6\u7684\u6700\u5c0f\u5355\u5143=2\/fosc\u3002T2\u7684\u6ea2\u51fa\u8109\u51b216\u5206\u9891\u540e\u4f5c\u4e3a\u4e32\u53e3\u7684\u53d1\u9001\u6216\u63a5\u6536\u8109\u51b2\u3002<\/p>\n \n\t\u6ce2\u7279\u7387=\uff081\/\uff08\uff082\/fosc\uff09\uff0865536-X\uff09\uff09\uff09\/16=fosc\/\uff0832\uff0865536-X\uff09\uff09<\/p>\n \n\t\u4f8b\uff1a\u5df2\u77e5fosc=11.0592MHz\uff0c\u6c42\u6ce2\u7279\u7387=2400\u65f6\u7684X<\/p>\n \n\t2400=11059200\/\uff0832\uff0865536-X\uff09\uff09 65536-X=144 X=65392=FF70H<\/p>\n \n\t\u8ba1\u6570\u5668\u521d\u503c\u5bc4\u5b58\u5668\uff1aRCAP2H=0FFH\uff0cRCAP2L=70H\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" 1\uff09\u65b9\u5f0f0 \u65b9\u5f0f0\u662f\u5916\u63a5\u4e32\u884c\u79fb\u4f4d \u5bc4\u5b58\u5668 \u65b9\u5f0f\u3002\u5de5\u4f5c\u65f6\uff0c\u6570\u636e\u4eceRXD\u4e32\u884c\u5730\u8f93\u5165\/\u8f93\u51fa\uff0cTXD\u8f93\u51fa\u79fb\u4f4d\u8109\u51b2\uff0c\u4f7f\u5916\u90e8\u7684\u79fb\u4f4d\u5bc4\u5b58\u5668\u79fb\u4f4d\u3002\u6ce2\u7279\u7387\u56fa\u5b9a\u4e3afosc\/12\uff08\u5373\uff0cTXD\u6bcf\u673a\u5668\u5468\u671f\u8f93\u51fa\u4e00\u4e2a\u540c\u4f4d\u8109<\/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\/2302"}],"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=2302"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2302\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2302"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}