{"id":2820,"date":"2019-09-24T03:36:59","date_gmt":"2019-09-24T03:36:59","guid":{"rendered":""},"modified":"2019-09-24T11:37:29","modified_gmt":"2019-09-24T03:37:29","slug":"%e5%9f%ba%e4%ba%8e%e5%8d%95%e7%89%87%e6%9c%ba%e5%92%8cmodem%e6%8e%a5%e5%8f%a3%e7%94%b5%e8%b7%af%e5%ae%9e%e7%8e%b0%e8%bf%9c%e7%a8%8b%e6%95%b0%e6%8d%ae%e9%87%87%e9%9b%86%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2820","title":{"rendered":"\u57fa\u4e8e\u5355\u7247\u673a\u548cMODEM\u63a5\u53e3\u7535\u8def\u5b9e\u73b0\u8fdc\u7a0b\u6570\u636e\u91c7\u96c6\u7cfb\u7edf"},"content":{"rendered":"

\n\t\u968f\u7740\u81ea\u52a8\u5316\u7a0b\u5ea6\u7684\u4e0d\u65ad\u63d0\u9ad8\uff0c\u5bf9\u73b0\u573a\u6570\u636e\u8fdc\u7a0b\u91c7\u96c6\u4e0e\u4f20\u8f93\u7684\u8981\u6c42\u4e5f\u65e5\u76ca\u63d0\u9ad8\uff0c\u5728\u7535\u8bdd\u901a\u8baf\u7f51\u7edc\u76f8\u5f53\u666e\u53ca\u7684\u4eca\u5929\uff0c\u6700\u65b9\u4fbf\u6700\u7075\u6d3b\u7684\u65b9\u6cd5\u5c31\u662f\u91c7\u7528MODEM\uff08\u8c03\u5236\u89e3\u8c03\u5668\uff09\u5e76\u501f\u52a9\u4e8e\u73b0\u6709\u7684\u6a21\u62df\u516c\u7528\u7535\u8bdd\u4ea4\u6362\u7f51\u8fdb\u884c\u6570\u636e\u4f20\u8f93\uff0c\u7ecf\u8fc7\u51e0\u5e74\u7684\u7814\u7a76\uff0c\u7b14\u8005\u5f00\u53d1\u4e86\u4e00\u79cd\u5728\u5355\u7247\u673a<\/u>\u63a7\u5236\u4e0b\u901a\u8fc7\u516c\u7528\u7535\u8bdd\u4ea4\u6362\u673a<\/u>\u7f51\u7edc\u505a\u8f7d\u4f53\u7684\u6570\u636e\u4f20\u8f93\u7cfb\u7edf\uff0c\u8fd9\u79cd\u6570\u636e\u4f20\u8f93\u7cfb\u7edf\u4e0d\u53d7\u65f6\u95f4\u4e0e\u5730\u57df\u7684\u9650\u5236\uff0c\u5e76\u53ef\u968f\u65f6\u5b9e\u65f6\u8ffd\u8e2a\u73b0\u573a\u8d44\u6599\u7684\u53d8\u5316\u60c5\u51b5\uff0c\u4ece\u800c\u4e3a\u8fdc\u7a0b\u6545\u969c\u7684\u8bca\u65ad\u548c\u6392\u9664\u63d0\u4f9b\u4e86\u4fbf\u5229\u3002<\/p>\n

\n\t\u7531\u4e8e\u76ee\u524d\u56fd\u5185\u6709\u5173\u5355\u7247\u673a\u548cMODEM\u7684\u63a5\u53e3<\/u>\u8d44\u6599\u5f88\u5c11\uff0c\u6240\u4ee5\uff0c\u672c\u6587\u4e3b\u8981\u5c31\u5355\u7247\u673a\u548cMODEM\u63a5\u53e3\u53ca\u5982\u4f55\u5229\u7528AT\u547d\u4ee4\u6765\u63a7\u5236MODEM \u505a\u4e9b\u4ecb\u7ecd\u3002<\/p>\n

\n\t <\/div>\n

\n\t1 \u7cfb\u7edf\u7ec4\u6210<\/p>\n

\n\t\u56fe1 \u6240\u793a\u4e3a\u8be5\u8fdc\u7a0b\u6570\u636e\u91c7\u96c6<\/u>\u7cfb\u7edf\u7684\u7cfb\u7edf\u7ec4\u6210\u56fe\uff0c\u6574\u4e2a\u7cfb\u7edf\u4e3b\u8981\u7531\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u548c\u76d1\u63a7<\/u>\u4e2d\u5fc3\u4e24\u90e8\u5206\u7ec4\u6210\uff0c\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u8d1f\u8d23\u5c06\u6240\u91c7\u96c6\u5230\u7684\u6570\u636e\u8fdb\u884c\u9884\u5904\u7406\u540e\u6253\u5305\uff0c \u5e76\u901a\u8fc7\u73b0\u573a\u8c03\u5236\u89e3\u8c03\u5668MODEM\u3001\u516c\u7528\u7535\u8bdd\u7f51\u548c\u76d1\u63a7\u4e2d\u5fc3\u7684MODEM \u5c06\u6570\u636e\u53d1\u9001\u5230\u76d1\u63a7\u4e2d\u5fc3\u3002\u7136\u540e\u76d1\u63a7\u4e2d\u5fc3\u5c06\u63a5\u6536\u5230\u7684\u6570\u636e\u8fdb\u884c\u5904\u7406\u3001\u663e\u793a\u3001\u5b58\u50a8<\/u>\u548c\u5206\u6790\uff0c\u5e76\u6839\u636e\u9700\u8981\u5411\u73b0\u573a\u53d1\u9001\u63a7\u5236\u6307\u4ee4\uff0c\u7531\u4e8e\u76d1\u63a7\u4e2d\u5fc3\u91c7\u7528\u8ba1\u7b97\u673a<\/u>\u4e0eMODEM \u76f4\u63a5\u76f8\u8fde\u7684\u65b9\u5f0f\uff0c \u56e0\u6b64\u786c\u4ef6\u63a5\u53e3\u6bd4\u8f83\u7b80\u5355\uff0c \u800c\u8f6f\u4ef6\u7f16\u5199\u4e0d\u662f\u672c\u6587\u8ba8\u8bba\u7684\u91cd\u70b9\uff0c\u4e0d\u518d\u8d58\u8ff0\u3002\u7cfb\u7edf\u6709\u4e24\u79cd\u5de5\u4f5c\u65b9\u5f0f\uff1a\u5373\u76d1\u63a7\u4e2d\u5fc3\u547c\u53eb\u73b0\u573a\u8bf7\u6c42\u53d1\u9001\u6570\u636e\u548c\u73b0\u573a\u547c\u53eb\u76d1\u63a7\u4e2d\u5fc3\u4e3b\u52a8\u53d1\u9001\u6570\u636e\u3002<\/p>\n

\n\t\"\u57fa\u4e8e\u5355\u7247\u673a\u548cMODEM\u63a5\u53e3\u7535\u8def\u5b9e\u73b0\u8fdc\u7a0b\u6570\u636e\u91c7\u96c6\u7cfb\u7edf\u7684\u8bbe\u8ba1\"<\/p>\n

\n\t\u56fe1 \u7cfb\u7edf\u7ec4\u6210\u56fe<\/p>\n

\n\t2 MODEM \u547d\u4ee4<\/p>\n

\n\t\u7531\u4e8eMODEM \u662f\u5c06\u6570\u636e\u901a\u8fc7\u516c\u7528\u7535\u8bdd\u7f51\u8fdb\u884c\u8fdc\u7a0b\u53d1\u9001\u548c\u4f20\u8f93\u7684\u6865\u6881\uff0c\u8fd9\u91cc\u5148\u5c06MODEM \u7684\u529f\u80fd\u53ca\u7528\u6cd5\u505a\u4e00\u4ecb\u7ecd“MODEM \u662f“\u8c03\u5236\u89e3\u8c03\u5668”\u7684\u82f1\u6587\u7f29\u5199\uff0c\u6240\u8c13\u8c03\u5236\uff0c\u5c31\u662f\u5c06“0”\u548c“1”\u7684\u6570\u5b57\u4fe1\u53f7\u53d8\u6210\u4e0d\u540c\u7684\u9891\u7387\u4fe1\u53f7\uff0c\u8c03\u5236\u5230\u8f7d\u6ce2\u9891\u7387\u4e0a\uff0c\u5e76\u5229\u7528\u7535\u8bdd\u7ebf\u8fdb\u884c\u6a21\u62df\u4fe1\u53f7\u7684\u4f20\u9001\uff0c \u89e3\u8c03\u662f\u8c03\u5236\u7684\u53cd\u8fc7\u7a0b\uff0c \u5373\u5c06\u8f7d\u6ce2\u9891\u7387\u4e0a\u7684\u9891\u7387\u4fe1\u53f7\u89e3\u8c03\u6210\u4e0e\u5176\u5bf9\u5e94\u7684\u6570\u5b57\u4fe1\u53f7\uff0c\u4f20\u9001\u81f3\u7ec8\u7aef\u63a7\u5236\u5668\u3002<\/p>\n

\n\t\u76ee\u524d\uff0c\u6211\u4eec\u5728\u5e02\u573a\u4e0a\u6240\u89c1\u5230\u7684MODEM \u90fd\u7528\u8d3a\u6c0f\u517c\u5bb9\u7684\u6307\u4ee4\u96c6\u6765\u7ba1\u7406\u548c\u8bbe\u5b9aMODEM \u7684\u5404\u9879\u64cd\u4f5c\u548c\u901a\u8baf\u529f\u80fd\uff0c\u800c\u4e00\u822c\u8fd9\u4e9b\u6307\u4ee4\u7686\u4ee5AT\u4e3a\u524d\u7f6e\u7801\uff0c\u6240\u4ee5\u79f0\u8fd9\u4e9b\u6307\u4ee4\u4e3a“AT\u6307\u4ee4”\u3002\u4e0b\u9762\u4ecb\u7ecd\u51e0\u4e2a\u5e38\u89c1\u7684MODEM \u6307\u4ee4\uff0c\u8fd9\u4e9b\u6307\u4ee4\u90fd\u4ee5\u56de\u8f66\uff08RETURN\uff09\u7ed3\u5c3e\u3002<\/p>\n

\n\tATA\uff1a\u624b\u52a8\u5e94\u7b54\u6307\u4ee4\uff0c\u5f3a\u8febMODEM \u6458\u673a\u5e76\u68c0\u6d4b\u8f7d\u6ce2;<\/p>\n

\n\tATE<\/u>0\uff1a \u6307\u4ee4\u4e0d\u56de\u5e94\uff0c\u5373\u5411MODEM \u53d1\u9001\u7684\u6307\u4ee4\u4e0d\u5728\u7ec8\u7aef\u56de\u663e;<\/p>\n

\n\tATV0\uff1a MODEM \u4ee5\u6570\u5b57\u5f62\u5f0f\u56de\u5e94\u4fe1\u606f\uff0c\u5373MODEM \u6536\u5230\u6307\u4ee4\u540e\uff0c\u4ee5\u6570\u5b57\u5f62\u5f0f\u8fd4\u56de\u7ed3\u679c\u7801;<\/p>\n

\n\tAT&F\uff1a\u53c2\u6570\u6062\u590d\u4e3a\u51fa\u5382\u503c;<\/p>\n

\n\tAT&D0\uff1a\u5ffd\u7565DTR\u4fe1\u53f7;<\/p>\n

\n\tAT&S0\uff1a\u5c06DSR\u4fe1\u53f7\u8bbe\u5b9a\u4e3aON;<\/p>\n

\n\tATD\uff1a\u53d1\u51fa\u62e8\u53f7\u6307\u4ee4;<\/p>\n

\n\tAT&W0\uff1a\u5c06MODEM \u76ee\u524d\u7684\u53c2\u6570\u72b6\u6001\u5b58\u50a8\u5728\u53c2\u6570\u88680 \u4e2d;<\/p>\n

\n\tAT&Y0\uff1a\u5f53MODEM \u521d\u59cb\u4e0a\u7535\u65f6\uff0c\u8c03\u7528\u5b58\u50a8\u7684\u53c2\u6570\u88680;<\/p>\n

\n\tATZ0\uff1a \u590d\u4f4dMODEM \u5e76\u542f\u7528\u5b58\u50a8\u7684\u7b2c0\u7ec4\u53c2\u6570\u8868;<\/p>\n

\n\tAT&Z=X\uff1a\u5c06\u7535\u8bdd\u53f7\u7801X\u5b58\u50a8\u5728MODEM \u7684\u5185\u90e8\u5b58\u50a8\u5668<\/u>\u4e2d;<\/p>\n

\n\tATDS\uff1a\u62e8\u51faMODEM \u9884\u5b58\u50a8\u7684\u7535\u8bdd\u53f7\u7801\u3002<\/p>\n

\n\t\u90a3\u4e48\uff0c\u5355\u7247\u673a\u5982\u4f55\u5229\u7528\u8fd9\u4e9b\u6307\u4ee4\u6765\u64cd\u4f5cMODEM\u5462\uff1f\u4e0b\u9762\u4ee5\u53d1\u9001\u6307\u4ee4ATA\u4e3a\u4f8b\u6765\u52a0\u4ee5\u8bf4\u660e\uff0c\u7a0b\u5e8f\u91c7\u7528C51\u7f16\u5199\uff0c\u8be5\u7a0b\u5e8f\u53ea\u7ed9\u51fa\u4e86\u76f8\u5173\u7684\u90e8\u5206\uff0c<\/p>\n

\n\t#include \u300a P\u300b<\/p>\n

\n\t#include \u300a P\u300b<\/p>\n

\n\t#define U8251_C XBYTE\uff3b0xfd00\uff3d<\/p>\n

\n\t\/* \u5b9a\u4e498251 \u63a7\u5236\/\u72b6\u6001\u5b57\u5730\u5740*\/<\/p>\n

\n\t#define U8251_D XBYTE\uff3b0xfc00\uff3d<\/p>\n

\n\t\/*\u5b9a\u4e498251 \u6570\u636e\u7f13\u51b2\u533a\u5730\u5740*\/<\/p>\n

\n\tunsigned char code ATA\uff3b4\uff3d={‘A’\uff0c‘T’\uff0c‘A’\uff0c0x0d};<\/p>\n

\n\t\/*0x0d\u4e3a\u56de\u8f66\uff08return\uff09\u63a7\u5236\u7b26*\/<\/p>\n

\n\tvoid send-code \uff08unsigned char code *send_addr\uff0c<\/p>\n

\n\tunsigned char send_sum\uff09;<\/p>\n

\n\t\/*\u53d1\u9001\u51fd\u6570\u58f0\u660e\uff0c\u5f62\u5f0f\u53c2\u6570\u4e3a\u53d1\u9001<\/p>\n

\n\t\u9996\u5730\u5740\u548c\u53d1\u9001\u5b57\u7b26<\/u>\u4e2a\u6570*\/<\/p>\n

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

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

\n\t……<\/p>\n

\n\tsend_code\uff08ATA\uff0c4\uff09; \/*\u53d1\u9001ATA\u5e94\u7b54\u547d\u4ee4*\/<\/p>\n

\n\t……<\/p>\n

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

\n\tvoid send_code\uff08unsigned char code *send_addr\uff0c<\/p>\n

\n\tunsigned char send_sum\uff09<\/p>\n

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

\n\tdo{<\/p>\n

\n\twhile\uff08\uff08U8251_c&0x05\uff09\uff01=0x05\uff09;<\/p>\n

\n\tU8251_D=*send_addr;<\/p>\n

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

\n\t}while\uff08--send_sum\uff09;<\/p>\n

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

\n\t\u4e3a\u4e86\u5355\u7247\u673a\u5bf9MODEM \u7684\u63a7\u5236\u548c\u64cd\u4f5c\uff0c\u5bf9\u672c\u7cfb\u7edf\u8bbe\u8ba1\u4e2d\u7684MODEM \u505a\u4e86\u5982\u4e0b\u521d\u59cb\u5316\uff1a<\/p>\n

\n\tAT&FE0V0&D0&S0&Y0&W0<\/p>\n

\n\t3 \u63a5\u53e3\u7535\u8def<\/u><\/p>\n

\n\t\u56fe2 \u4e3a\u8be5\u73b0\u573a\u6570\u636e\u91c7\u96c6\u7cfb\u7edf\u4e2d\u5355\u7247\u673a\u548cMODEM\u7684\u63a5\u53e3\u7535\u8def\u56fe\uff0c \u5355\u7247\u673a\u9009\u7528Winbord\uff08\u534e\u5e2e\uff09\u516c\u53f8\u751f\u4ea7\u7684\u9ad8\u6027\u80fd\u4f4e\u529f\u8017\u5355\u7247\u673aW78E52B\uff0c\u5b83\u91c7\u752880C31\u5185\u6838\uff0c\u5728\u6307\u4ee4\u4e0a\u4e0eMCS-51\u5b8c\u5168\u517c\u5bb9\uff0c\u5185\u542b8k\u7684\u7535\u53ef\u64e6\u9664MTP ROM<\/u>\uff08Multi<\/u>ple-Time Program<\/u>mable ROM\uff09\u3002\u5176\u5185\u90e8\u4e32\u53e3\u80fd\u548c\u5176\u5b83\u6709\u4e32\u53e3\u7684\u901a\u8baf\u8bbe\u5907\u4e00\u8d77\u8fdb\u884c\u6570\u636e\u91c7\u96c6\uff08\u8fd9\u90e8\u5206\u5728\u56fe2\u4e2d\u6ca1\u753b\u51fa\uff09;<\/p>\n

\n\t\"\u57fa\u4e8e\u5355\u7247\u673a\u548cMODEM\u63a5\u53e3\u7535\u8def\u5b9e\u73b0\u8fdc\u7a0b\u6570\u636e\u91c7\u96c6\u7cfb\u7edf\u7684\u8bbe\u8ba1\"<\/p>\n

\n\t\u56fe2 \u5355\u7247\u673a\u548cMODEM \u7684\u63a5\u53e3\u7535\u8def<\/p>\n

\n\t\u8003\u8651\u5230\u6240\u91c7\u96c6\u7684\u6570\u636e\u8f83\u591a\uff0c\u6545\u6269\u5c55\u4e86\u4e00\u72478155 \u4f5c\u4e3a\u5916\u90e8\u6570\u636e\u5b58\u50a8\u5668\uff0c\u5e76\u517c\u505a\u5e76\u884c\u6570\u636e\u91c7\u96c6\u63a5\u53e3\uff0c\u5176\u5185\u90e814 \u4f4d\u5b9a\u65f6\u5668<\/u>\u4f5c\u4e3a\u5206\u9891\u5668\u4f7f\u7528;\u53e6\u6269\u5c55\u7684\u4e00\u72478251 \u7528\u6765\u548cMODEM \u63a5\u53e3\uff0c8251\u7684\u5185\u90e8\u5de5\u4f5c\u65f6\u5e8f\uff0c\u53d1\u9001\u5668\u65f6\u949f<\/u>\u548c\u63a5\u6536\u5668\u65f6\u949f\u9700\u8981\u5916\u90e8\u8f93\u5165\uff0c\u5728\u8bbe\u8ba1\u4e2d\uff0c\u5355\u7247\u673a\u63d0\u4f9b\u7684ALE\u4fe1\u53f7\u4f5c\u4e3a\u5176\u5916\u90e8\u8f93\u5165\uff0c\u56e0\u800c\u65e0\u9700\u5355\u72ec\u8bbe\u8ba1\u5206\u9891\u5668\uff0c\u7531\u4e8e\u5728\u5355\u7247\u673a\u8bbf\u95ee\u5916\u90e8\u5b58\u8d2e\u5668\u65f6\uff0c ALE\u8981\u4e22\u5931\u4e00\u4e2a\u5468\u671f\uff0c\u56e0\u800c\u91c7\u7528\u56fe2\u6240\u793a\u7684\u65b9\u6cd5\uff0c\u53ef\u5145\u5206\u5229\u7528\u7cfb\u7edf\u8d44\u6e90\uff0c\u6839\u636e\u63a5\u6536\u65f6\u949f\u8f93\u5165RXCLK\u548c\u53d1\u9001\u65f6\u949f\u8f93\u5165TXCLK\u7684\u4e0d\u540c\uff0c8251 \u7684\u53d1\u9001\u6ce2\u7279\u7387\u548c\u63a5\u6536\u6ce2\u7279\u7387\u53ef\u4ee5\u4e0d\u540c\uff0c\u5728\u672c\u7cfb\u7edf\u4e2d\uff0c\u53d1\u9001\u6ce2\u7279\u7387\u548c\u63a5\u6536\u6ce2\u7279\u7387\u76f8\u540c\uff0c\u90fd\u75318155\u5b9a\u65f6\u5668\u5206\u9891\u8f93\u51faTMROUT\u4f9b\u7ed9\u3002\u53d1\u9001\u6570\u636e\u53ef\u6839\u636e\u7cfb\u7edf\u8981\u6c42\u5728\u4e3b\u7a0b\u5e8f\u4e2d\u5b8c\u6210\uff0c\u63a5\u6536\u6570\u636e\u7f13\u51b2\u533a\u8bf7\u6c42\u8f93\u51faRXRDY\u7ecf74L<\/u>S02\u53cd\u5411\u540e\u63a578E52B\u7684\u4e2d\u65ad\u8f93\u5165INT0\uff0c\u63a5\u6536\u6570\u636e\u91c7\u7528\u4e2d\u65ad\u65b9\u5f0f\u63a7\u5236\uff0c\u7cfb\u7edf\u8bbe\u8ba1\u65f6<\/u>\u5ffd\u7565\u4e86DSR\u4fe1\u53f7\uff0c \u56e0\u800c\u5728\u56fe2 \u4e2d\u5c06\u5176\u76f4\u63a5\u63a5\u5730;<\/p>\n

\n\tRS<\/u>232 \u63a5\u53e3\u7535\u5e73\u8f6c\u6362\u7535\u8def\u91c7\u7528\u4e00\u7247\u5177\u6709\u4e94\u5bf9\u8f93\u5165\u548c\u8f93\u51fa\u7684MSX238\uff0c\u5b83\u81ea\u5e26\u7535\u8377\u6cf5\uff0c\u91c7\u7528\u53555\u4f0f\u7535\u6e90\uff0c\u53ea\u7528\u4e00\u7247\u4fbf\u53ef\u63d0\u4f9b\u672c\u7cfb\u7edf\u6240\u6709RS232\u7535\u5e73\u7684\u9a71\u52a8\u4e0e\u8f6c\u6362\u3002<\/p>\n

\n\t4 \u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u7684\u529f\u80fd\u53ca\u539f\u7406<\/p>\n

\n\t\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u6709\u4e24\u79cd\u5de5\u4f5c\u65b9\u5f0f\uff0c \u5373\u4e3b\u53eb\u65b9\u5f0f\u548c\u88ab\u53eb\u5e94\u7b54\u65b9\u5f0f\u3002\u4e3b\u53eb\u65b9\u5f0f\u5c31\u662f\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u4e3b\u52a8\u547c\u53eb\u76d1\u63a7\u4e2d\u5fc3;\u88ab\u53eb\u5e94\u7b54\u65b9\u5f0f\u662f\u5728\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u6536\u5230\u76d1\u63a7\u4e2d\u5fc3\u7684\u547c\u53eb\u632f\u94c3\u540e\u54cd\u5e94\u5e94\u7b54\u6307\u4ee4\u3002\u53e6\u5916\uff0c\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u5177\u6709\u8fdc\u7a0b\u8bbe\u7f6e\u4e3b\u53eb\u547c\u53eb\u53f7\u7801\u7684\u529f\u80fd\uff0c\u5176\u8f6f\u4ef6\u7f16\u5236\u6d41\u7a0b\u56fe\u5982\u56fe3 \u6240\u793a\u3002<\/p>\n

\n\t\"\u57fa\u4e8e\u5355\u7247\u673a\u548cMODEM\u63a5\u53e3\u7535\u8def\u5b9e\u73b0\u8fdc\u7a0b\u6570\u636e\u91c7\u96c6\u7cfb\u7edf\u7684\u8bbe\u8ba1\"<\/p>\n

\n\t\u56fe3 \u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u7684\u7a0b\u5e8f\u6d41\u7a0b\u56fe<\/p>\n

\n\t4.1 \u901a\u8baf\u6ce2\u7279\u7387<\/p>\n

\n\t8251 \u7684\u901a\u8baf\u6ce2\u7279\u7387\u53d6\u51b3\u4e8eRXCLK\u548cTXCLK\u7684\u65f6\u949f\u8f93\u5165\uff0c\u5728\u5f02\u6b65\u65b9\u5f0f\u4e2d\uff0cRXCLK\uff0cTXCLK\u53ef\u4ee5\u662f\u6ce2\u7279\u7387\uff0c\u4e5f\u53ef\u4ee5\u662f\u6ce2\u7279\u7387\u768416 \u621664\u500d\u3002\u8fd9\u75318251\u63a7\u5236\u5b57\u4e2d\u7684\u6ce2\u7279\u7387\u56e0\u5b50\u6765\u51b3\u5b9a\uff0c\u5728\u672c\u7cfb\u7edf\u8bbe\u8ba1\u4e2d\uff0c\u8bbe\u6ce2\u7279\u7387\u56e0\u5b50\u4e3a\u5f02\u6b65X16\uff0c\u5373RXCLK\uff0cTXCLK\u662f\u4f20\u8f93\u6ce2\u7279\u7387\u768416\u500d\u3002\u4ece\u56fe2\u53ef\u4ee5\u770b\u51fa\uff0cRXCLK\uff0cTXCLK\u75318155 \u7684TMROUT\u7ed9\u51fa\uff0c \u800c8155 \u7684TMRIN\u4e3a\u7cfb\u7edf\u65f6\u949ffosc\u76841\/6\uff0c\u56e0\u6b64\u9009\u62e9\u6ce2\u7279\u7387\u7684\u5173\u952e\u5c31\u662f\u786e\u5b9a8155\u5b9a\u65f6\u5668\u7684\u65f6\u95f4\u5e38\u6570\u3002\u5982\u679c\u5c068155 \u7684\u5b9a\u65f6\u5668\u8bbe\u4e3a\u8fde\u7eed\u65b9\u6ce2\u8f93\u51fa\uff0c\u90a3\u4e488155 \u5b9a\u65f6\u5668\u7684\u65f6\u95f4\u5e38\u6570N\u548c\u5b9a\u65f6\u5668\u8f93\u5165\u9891\u7387fTMRIN\uff0c\u8f93\u51fa\u9891\u7387fTMROUT\u7684\u5173\u7cfb\u4e3a\uff1afTMROUT=fTMRIN\/N\uff0c\u8bbe8251\u7684\u5206\u9891\u7cfb\u6570\u4e3a16\uff0c\u5219\u4f20\u8f93\u6ce2\u7279\u7387\u53ef\u6709\u4e0b\u5f0f\u8ba1\u7b97\uff1a<\/p>\n

\n\t\u6ce2\u7279\u7387=fTMROUT\/16=fTMRIN\/16N=fosc\/\uff086X16N\uff09<\/p>\n

\n\t\u672c\u7cfb\u7edf\u9009\u7528\u9891\u7387\u4e3a11.0592MHz \u7684\u6676\u632f<\/u>\uff0cfosc\u4e3a1.0592MHz\uff0c \u82e58251 \u91c7\u75282400Hz\u7684\u6ce2\u7279\u7387\u6765\u4f20\u8f93\u6570\u636e\uff0c\u52198155\u7684\u5b9a\u65f6\u5668\u5e38\u6570N\u4e3a\uff1a<\/p>\n

\n\tN=11.0592X106\/\uff082400X16X6\uff09=48=30H<\/p>\n

\n\t\u6309\u7167\u4ee5\u4e0a\u5206\u6790\uff0c\u52198155\uff0c8251 \u521d\u59cb\u5316\u7f16\u7a0b\u5982\u4e0b\uff1a<\/p>\n

\n\tvoid initialize rs\uff08void\uff09<\/p>\n

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

\n\tU8155_IO=0xc0; \/*8155\u547d\u4ee4\u5b57\u521d\u59cb\u5316*\/<\/p>\n

\n\tU8155_TO=0x30;\/*\u90018155\u5b9a\u65f6\u5668\u5e38\u6570\u4f4e\u5b57\u8282*\/<\/p>\n

\n\tU8155_TH=0x40; \/*\u90018155\u5b9a\u65f6\u5668\u5e38\u6570\u9ad8\u5b57\u8282*\/<\/p>\n

\n\tU8251_C=0x4e; \/* \u65b9\u5f0f\u63a7\u5236\u5b57\u521d\u59cb\u5316*\/<\/p>\n

\n\tU8251_C=0x37;<\/p>\n

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

\n\t4.2 \u8fdc\u7a0b\u8bbe\u7f6e\u4e3b\u53eb\u547c\u53eb\u53f7\u7801<\/p>\n

\n\t\u5728\u672c\u7cfb\u7edf\u4e2d\uff0c\u5f53\u5173\u952e\u6570\u636e\u53d1\u751f\u8d8a\u9650\u53d8\u5316\u65f6\uff0c\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u80fd\u591f\u81ea\u52a8\u547c\u53eb\u76d1\u63a7\u4e2d\u5fc3\uff0c\u800c\u88ab\u547c\u53eb\u7684\u7535\u8bdd\u53f7\u7801\u5374\u4e0d\u80fd\u591f\u5b58\u50a8\u5728\u7a0b\u5e8f\u7684ROM\u4e2d\uff0c \u539f\u56e0\u6709\u4e24\u6761\uff1a\u7b2c\u4e00\uff1a\u76d1\u63a7\u4e2d\u5fc3\u7684\u7535\u8bdd\u53f7\u7801\u53ef\u80fd\u4f1a\u53d8\u66f4;\u7b2c\u4e8c\uff1a\u4e0d\u540c\u7684\u7528\u6237\u88ab\u547c\u53eb\u7684\u7535\u8bdd\u53f7\u7801\u4e0d\u4e00\u6837; \u800c\u5728\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u4e0a\u8bbe\u8ba1\u4e00\u7247EEPROM \u4e5f\u4e0d\u662f\u6700\u597d\u7684\u65b9\u6848;\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\u7684\u6700\u4f73\u65b9\u6cd5\u662f\u5c06\u6b64\u7535\u8bdd\u53f7\u7801\u5b58\u50a8\u5728MODEM \u4e2d\uff0c \u90a3\u4e48\u5982\u4f55\u5b9e\u73b0\u5462\uff1f\u53ef\u7528\u524d\u9762\u63d0\u5230\u7684AT&Z=X\uff08X\u4e3a\u7535\u8bdd\u53f7\u7801\uff09 \u547d\u4ee4\u8fdb\u884c\u8fdc\u7a0b\u8bbe\u7f6e\uff0c\u5f53\u76d1\u63a7\u4e2d\u5fc3\u9700\u8981\u4fee\u6539\u8fd9\u4e2a\u7535\u8bdd\u53f7\u7801\u65f6\uff0c \u5c31\u547c\u53eb\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\uff0c\u5e76\u5c06\u6b64\u7535\u8bdd\u53f7\u7801\u4f20\u8f93\u7ed9\u6570\u636e\u91c7\u96c6\u5668\uff0c\u7136\u540e\u7531\u6570\u636e\u91c7\u96c6\u5668\u81ea\u52a8\u7528AT&Z=X\uff08X\u4e3a\u7535\u8bdd\u53f7\u7801\uff09\u547d\u4ee4\u5c06\u6b64\u53f7\u7801\u5b58\u50a8\u5728MODEM \u4e2d\u3002<\/p>\n

\n\t4.3 \u4e3b\u53eb\u65b9\u5f0f<\/p>\n

\n\t\u5f53\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u91c7\u96c6\u5230\u7684\u5173\u952e\u6570\u636e\u53d1\u751f\u8d8a\u9650\u53d8\u5316\u65f6\uff0c\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u4fbf\u5229\u7528AT\u6307\u4ee4ATDS\u4e3b\u52a8\u62e8\u6253\u5b58\u50a8\u5728MODEM \u4e2d\u7684\u7535\u8bdd\u53f7\u7801\u6765\u547c\u53eb\u76d1\u63a7\u4e2d\u5fc3\uff0c\u5e76\u5c06\u5173\u952e\u6570\u636e\u6253\u5305\u4f20\u9001\u7ed9\u76d1\u63a7\u4e2d\u5fc3\uff0c\u5728\u76d1\u63a7\u4e2d\u5fc3\u6536\u5230\u4fe1\u606f\u5305\u540e\uff0c\u7cfb\u7edf\u4fbf\u53ef\u8fdb\u884c\u5b58\u50a8\u548c\u5206\u6790\uff0c\u4ee5\u4f9b\u503c\u73ed\u4eba\u5458\u5224\u65ad\u5e76\u505a\u51fa\u5904\u7406\u3002<\/p>\n

\n\t4.4 \u88ab\u53eb\u65b9\u5f0f<\/p>\n

\n\t\u5f53\u76d1\u63a7\u4e2d\u5fc3\u9700\u8981\u83b7\u5f97\u73b0\u573a\u6570\u636e\u65f6\uff0c \u53ef\u4ee5\u4e3b\u52a8\u62e8\u53f7\u547c\u53eb\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\uff0c \u5728\u56fe2\u4e2d\uff0cW78E52 \u7684P1.1\u5728\u68c0\u6d4b\u5230\u9884\u5b9a\u6b21\u6570\u7684\u632f\u94c3\u4fe1\u53f7\u65f6\u53d1\u51faMODEM\u5e94\u7b54\u6307\u4ee4ATA\uff0c\u5e76\u5728\u5ef6\u65f6\u7b49\u5f85MODEM \u8fde\u901a\u4ee5\u53ca\u53cc\u65b9\u63e1\u624b\u6210\u529f\u540e\uff0c \u7531\u76d1\u63a7\u4e2d\u5fc3\u5411\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u53d1\u51fa\u8bf7\u6c42\u53d1\u9001\u6570\u636e\u6307\u4ee4\u3002\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u6536\u5230\u6307\u4ee4\u540e\u5c06\u5b9e\u65f6\u53d8\u5316\u7684\u52a8\u6001\u6570\u636e\u4f20\u9001\u7ed9\u76d1\u63a7\u4e2d\u5fc3\uff0c \u4ee5\u4f7f\u76d1\u63a7\u4e2d\u5fc3\u968f\u65f6\u4e2d\u65ad\u5bf9\u6570\u636e\u63a5\u6536\uff0c \u5e76\u5411\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u53d1\u51fa\u6302\u673a\u6307\u4ee4\u3002\u73b0\u573a\u6570\u636e\u91c7\u96c6\u5668\u5728\u6536\u5230\u6302\u673a\u6307\u4ee4\u540e\u505c\u6b62\u53d1\u9001\u6570\u636e\u5e76\u6302\u673a\u3002<\/p>\n

\n\t4.5 \u5b58\u5728\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6cd5<\/p>\n

\n\t\u672c\u7cfb\u7edf\u521a\u5f00\u59cb\u8bbe\u8ba1\u65f6\uff0c8251 \u7684\u590d\u4f4d\u8f93\u5165\u7aef\u548cCPU<\/u>\u7684\u590d\u4f4d\u8f93\u5165\u7aef\u662f\u8fde\u63a5\u5728\u4e00\u8d77\uff0c\u8fd9\u6837\u8bbe\u8ba1\u66fe\u51fa\u73b0\u8fc78251\u4e0d\u80fd\u53ef\u9760\u590d\u4f4d\u7684\u95ee\u9898\u3002 \u540e\u6539\u4e3a\u9760W78E52\u7684P1.0 \u7ed98251\u53d1\u590d\u4f4d\u8109\u51b2\uff0c\u56fe2 \u6240\u793a\uff0c\u8fd9\u6837\uff0c\u5c31\u53ef\u6839\u636e\u8f6f\u4ef6\u6297\u5e72\u6270\u7684\u9700\u8981\u968f\u65f6\u590d\u4f4d8251\uff0c\u7528C51\u7f16\u5199\u7684\u590d\u4f4d\u7a0b\u5e8f\u5982\u4e0b\uff1a<\/p>\n

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

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

\n\tP1^0=1;<\/p>\n

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

\n\twhile\uff08--ACC\uff09;<\/p>\n

\n\tP1^0=0;<\/p>\n

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

\n\t5 \u7ed3\u8bba<\/p>\n

\n\t\u5b9e\u8df5\u8bc1\u660e\uff0c\u8be5\u7cfb\u7edf\u548cMODEM \u63a5\u53e3\u5177\u6709\u7535\u8def\u7b80\u5355\uff0c\u6210\u672c\u4f4e\uff0c\u53ef\u9760\u6027\u9ad8\u7684\u7279\u70b9\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u53d6\u5f97\u4e86\u826f\u597d\u6548\u679c.
\n\t\u6765\u6e90\uff1b21ic<\/p>\n","protected":false},"excerpt":{"rendered":"

\u968f\u7740\u81ea\u52a8\u5316\u7a0b\u5ea6\u7684\u4e0d\u65ad\u63d0\u9ad8\uff0c\u5bf9\u73b0\u573a\u6570\u636e\u8fdc\u7a0b\u91c7\u96c6\u4e0e\u4f20\u8f93\u7684\u8981\u6c42\u4e5f\u65e5\u76ca\u63d0\u9ad8\uff0c\u5728\u7535\u8bdd\u901a\u8baf\u7f51\u7edc\u76f8\u5f53\u666e\u53ca\u7684\u4eca\u5929\uff0c\u6700\u65b9\u4fbf\u6700\u7075\u6d3b\u7684\u65b9\u6cd5\u5c31\u662f\u91c7\u7528MODEM\uff08\u8c03\u5236\u89e3\u8c03\u5668\uff09\u5e76\u501f\u52a9\u4e8e\u73b0\u6709\u7684\u6a21\u62df\u516c<\/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\/2820"}],"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=2820"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2820\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2820"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}