{"id":2799,"date":"2019-09-11T01:53:15","date_gmt":"2019-09-11T01:53:15","guid":{"rendered":""},"modified":"2019-09-11T09:53:43","modified_gmt":"2019-09-11T01:53:43","slug":"cc2531%e8%8a%af%e7%89%87%e7%9a%84%e5%85%a8%e9%80%9fusb%e6%8e%a5%e5%8f%a3%e8%ae%be%e8%ae%a1","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2799","title":{"rendered":"CC2531\u82af\u7247\u7684\u5168\u901fUSB\u63a5\u53e3\u8bbe\u8ba1"},"content":{"rendered":"
\n\t1 CDC\u7c7b\u7b80\u4ecb<\/p>\n
\n\t\u5728USB<\/u>\u7684\u6587\u4ef6\u4e2d\uff0c\u5b9a\u4e49\u4e86\u5c06\u67d0\u79cd\u76f8\u540c\u5c5e\u6027\u7684\u8bbe\u5907\u6574\u5408\u5728\u4e00\u8d77\u7684\u7fa4\u4f53\uff0c\u79f0\u4e4b\u4e3a\u7c7b\u3002\u8fd9\u6837\u505a\u53ef\u4ee5\u540c\u65f6\u5f00\u53d1\u8be5\u7c7b\u7684\u9a71\u52a8\u7a0b\u5e8f\uff0c\u63d0\u9ad8\u4e86\u9a71\u52a8\u7a0b\u5e8f\u7684\u590d\u7528\u6027\u3002CDC\u7c7b\u662f\u901a\u4fe1\u8bbe\u5907\u7c7b\u7684\u7b80\u79f0\uff0c\u662f\u4e13\u4e3a\u5404\u79cd\u901a\u4fe1\u8bbe\u5907\u5b9a\u4e49\u7684\u5b50\u7c7b\u3002\u6839\u636e\u5e94\u7528\u573a\u5408\u7684\u4e0d\u540c\uff0cCDC\u7c7b\u53ef\u4ee5\u5206\u6210\u4ee5\u4e0b\u4e0d\u540c\u7684\u6a21\u578b\uff1aPOST\uff08\u4f20\u7edf\u7eaf\u7535\u8bdd\u4e1a\u52a1\uff09\u6a21\u578b\u3001ISDN\u6a21\u578b\u548cNetworking\uff08\u7f51\u7edc\uff09\u6a21\u578b\u3002\u5176\u4e2d\uff0cPOST\u6a21\u578b\u53c8\u53ef\u4ee5\u5206\u4e3aDL\uff08\u76f4\u63a5\u7ebf\u63a7\u5236\uff09\u6a21\u578b\u3001AC\uff08\u62bd\u8c61\u63a7\u5236\uff09\u6a21\u578b\u3001Datapump\uff08\u6570\u636e\u6cf5\uff09\u6a21\u578b\u3001T\uff08\u7535\u8bdd\uff09\u6a21\u578b\u3002CDC\u7c7b\u7684\u7ed3\u6784\u5982\u56fe1\u6240\u793a\u3002\u672c\u6587\u7684USB\u63a5\u53e3<\/u>\u5f00\u53d1\u5c31\u5c5e\u4e8ePOST\u6a21\u578b\u4e0b\u7684AC\u6a21\u578b\u3002<\/p>\n \n\t<\/p>\n \n\t\u56fe1 CDC\u7c7b\u7ed3\u6784\u56fe<\/p>\n \n\t\u6b64\u5916\uff0cCDC\u53c8\u7531Communicati<\/u>ON Inte<\/u>rf<\/u>ace Class\uff08\u901a\u4fe1\u63a5\u53e3\u7c7b\uff09\u548cData Interface Class\uff08\u6570\u636e\u63a5\u53e3\u7c7b\uff09\u7ec4\u6210\u3002\u901a\u4fe1\u63a5\u53e3\u7c7b\u4e3b\u8981\u8d1f\u8d23\u8bbe\u5907\u7684\u7ba1\u7406\u548c\u63a7\u5236\uff0c\u6570\u636e\u63a5\u53e3\u7c7b\u5219\u8d1f\u8d23\u6570\u636e\u7684\u4f20\u8f93\u3002\u4e0d\u540c\u7684\u6a21\u578b\u7aef\u70b9\u9700\u6c42\u4e0d\u540c\uff0c\u5bf9\u7cfb\u7edf\u6240\u7528\u7684\u62bd\u8c61\u63a7\u5236\u6a21\u578b\u6765\u8bf4\uff0c\u901a\u4fe1\u63a5\u53e3\u7c7b\u9700\u8981\u4e00\u4e2a\u63a7\u5236\u7aef\u70b9\uff08Control Endpoint\uff09\u6765\u7ba1\u7406\u8bbe\u5907\u7684\u679a\u4e3e\u3001\u865a\u62df\u4e32\u53e3\u7684\u6ce2\u7279\u7387\u548c\u6570\u636e\u7c7b\u578b\u7684\u8bbe\u7f6e\u3002\u6570\u636e\u63a5\u53e3\u7c7b\u7684\u9700\u6c42\u76f8\u5bf9\u6bd4\u8f83\u7075\u6d3b\uff0c\u672c\u4f8b\u4e2d\u91c7\u7528\u4e00\u4e2a\u5757\u4f20\u8f93 IN\u7aef\u70b9\u548c\u4e00\u4e2a\u7b49\u65f6\u4f20\u8f93OUT\u7aef\u70b9\u3002<\/p>\n \n\t2 CC2531\u82af\u7247\u7b80\u4ecb<\/p>\n \n\tCC2531\u662fTI\u516c\u53f8\u9488\u5bf92.4 GHz ISM\u9891\u5e26\u63a8\u51fa\u7684\u7b2c\u4e8c\u4ee3\u652f\u6301ZigBee<\/u>\/IEEE 802.15.4\u534f\u8bae\u7684\u7247\u4e0a\u96c6\u6210\u82af\u7247\u3002\u5176\u5185\u90e8\u96c6\u6210\u4e86\u9ad8\u6027\u80fd\u5c04\u9891<\/u>\u6536\u53d1\u5668<\/u>\u3001\u5de5\u4e1a\u6807\u51c6\u589e\u5f3a\u578b8051 MCU<\/u>\u5185\u6838\u3001256 KB Flash\u548c8 KB RAM<\/u>;\u5177\u67091\u4e2aUSB\u5168\u901f\u63a5\u53e3\u30012\u4e2aUSART\u30018\u4f4d\u548c16\u4f4d\u5b9a\u65f6\u5668<\/u>\u3001\u770b\u95e8\u72d7<\/u>\u5b9a\u65f6\u5668\u30018\u8def\u8f93\u5165\u53ef\u914d\u7f6e\u768412\u4f4dADC<\/u>\u300121\u4e2aGPI<\/u>O\u3001AES128\u534f\u540c\u5904\u7406\u5668\uff1b\u786c\u4ef6\u652f\u6301CSMACA\u3001\u6570\u5b57\u5316\u7684RS<\/u>SI\/LQI\u548c\u5f3a\u5927\u7684DMA<\/u>\u529f\u80fd\uff0c\u5177\u6709\u7535\u6c60<\/u>\u76d1\u6d4b\u548c\u6e29\u5ea6\u611f\u6d4b\u529f\u80fd\u3002<\/p>\n \n\tCC2531\u5168\u901fUSB\u63a5\u53e3\u7684\u7ed3\u6784\u5982\u56fe2\u6240\u793a\u3002\u5176\u7279\u6027\u5982\u4e0b\uff1a<\/p>\n \n\t\u25c6 \u5168\u901f\u64cd\u4f5c\uff0812 Mbps\uff09\uff1b<\/p>\n \n\t\u25c6 6\u4e2a\u7aef\u53e3\uff0c\u7aef\u53e30\u4e3a\u63a7\u5236\u7aef\u70b9\uff0c\u5176\u4f595\u4e2a\u4e3a\u6570\u636e\u4f20\u8f93\u7aef\u70b9\uff1b<\/p>\n \n\t\u25c6 \u5177\u67091 KB SRAM\uff08FIF<\/u>O\uff09\u5b58\u50a8<\/u>USB\u6570\u636e\u5305\uff1b<\/p>\n \n\t\u25c6 \u7aef\u53e3\u652f\u6301\u7684\u6570\u636e\u5305\u5927\u5c0f\u4e3a8~512\u5b57\u8282\uff1b<\/p>\n \n\t\u25c6 \u652f\u6301\u53cc\u7f13\u51b2\u4f20\u8f93\u6a21\u5f0f\u3002<\/p>\n \n\t<\/p>\n \n\t\u56fe2 USB\u63a5\u53e3\u7ed3\u6784\u56fe<\/p>\n \n\t\u7aef\u70b90\uff08EP0\uff09\u4e3a\u63a7\u5236\u7aef\u70b9\uff0c\u679a\u4e3e\u9636\u6bb5\u7684\u901a\u4fe1\u90fd\u662f\u901a\u8fc7\u8be5\u7aef\u53e3\u5b8c\u6210\u7684\u3002\u7aef\u70b91~5\uff08EP1~5\uff09\u53ef\u4ee5\u901a\u8fc7SFR\u914d\u7f6e\u4e3a\u7b49\u65f6\u3001\u5757\u3001\u4e2d\u65ad3\u79cd\u4f20\u8f93\u65b9\u5f0f\u3002\u5176\u4e2d\u5757\u4f20\u8f93\u7aef\u70b9\u548c\u4e2d\u65ad\u4f20\u8f93\u7aef\u70b9\u5bf9\u5e94\u7684USB\u5bc4\u5b58\u5668<\/u>\u8bbe\u7f6e\u662f\u4e00\u6837\u7684\uff0c\u4f46\u5728\u56fa\u4ef6\u65b9\u9762\u5177\u6709\u4e0d\u540c\u7684\u5c5e\u6027\u3002\u540c\u65f6\u4e3a\u4e86\u52a0\u5feb\u6570\u636e\u4f20\u8f93\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u53cc\u7f13\u51b2\u6a21\u5f0f\u3002\u5728\u914d\u7f6e\u5404\u4e2a\u7aef\u70b9\u7684\u5c5e\u6027\u4e4b\u524d\uff0c\u5fc5\u987b\u901a\u8fc7\u7279\u6b8a\u5bc4\u5b58\u5668USBINDEX\u6765\u9009\u62e9\u4e0d\u540c\u7684\u7aef\u70b9\uff0c\u4ee5\u6b64\u6765\u9009\u62e9\u5f53\u524d\u8fdb\u884c\u914d\u7f6e\u7684\u7aef\u70b9\u5bc4\u5b58\u5668\u7ec4\u3002<\/p>\n \n\t3 USB\u901a\u4fe1\u7684\u5b9e\u73b0<\/p>\n \n\tCC2531\u7684USB\u786c\u4ef6\u8fde\u63a5\u5f88\u7b80\u5355\uff0c\u5982\u56fe3\u6240\u793a\u3002\u91c7\u7528USB\u603b\u7ebf\u4f9b\u7535\u65b9\u5f0f\uff0c\u901a\u8fc7\u7535\u538b\u8f6c\u6362\u82af\u7247AM11173.3\u4e3a\u786c\u4ef6\u7535\u8def<\/u>\u63d0\u4f9b3.3 V\u7535\u538b\uff08\u56fe\u4e2d\u672a\u753b\u51fa\uff09\u3002\u7531\u4e8e\u8be5\u8bbe\u5907\u4e3a\u5168\u901f\u8bbe\u5907\uff0c\u56e0\u6b64D+\u4fe1\u53f7\u7ebf<\/u>\u901a\u8fc7\u7535\u963b<\/u>\u4e0a\u62c9\u3002<\/p>\n \n\t<\/p>\n \n\t\u56fe3 CC2531\u7684USB\u786c\u4ef6\u8fde\u63a5<\/p>\n \n\t\u6309\u7167CDC\u7c7b\u62bd\u8c61\u63a7\u5236\u6a21\u578b\u5bf9\u7aef\u70b9\u7684\u9700\u6c42\uff0c\u91c7\u7528\u7aef\u70b90\u4f5c\u4e3a\u63a7\u5236\u7aef\u70b9\uff0c\u5b8c\u6210\u8bbe\u5907\u7684\u679a\u4e3e\u548c\u4e32\u53e3\u53c2\u6570\u7684\u8bbe\u7f6e\u3002\u5c06\u7aef\u70b92\u548c\u7aef\u70b94\u5206\u914d\u7ed9\u6570\u636e\u63a5\u53e3\u5b50\u7c7b\uff0c\u4f5c\u4e3aIN\u548cOUT\u7aef\u70b9\uff0c\u865a\u62df\u4e32\u53e3\u7684\u6570\u636e\u4f20\u8f93\u4e3b\u8981\u5728\u8fd9\u4e24\u4e2a\u7aef\u70b9\u8fdb\u884c\u3002\u5177\u4f53\u7684\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n \n\tcurrentLineCoding.dteRate=HAL_UART<\/u>_BAUDRATE_115200;\/\/\u6ce2\u7279\u7387\u8bbe\u7f6e<\/p>\n \n\tcurrentLineCoding.charFormat=CDC_CHAR_FORMAT_1_STOP_BIT;\/\/1\u4e2a\u505c\u6b62\u4f4d<\/p>\n \n\tcurrentLineCoding.parityType=CDC_PARITY_TYPE_NONE;\/\/\u65e0\u5947\u5076\u6821\u9a8c<\/p>\n \n\tcurrentLineCoding.dataBits=8;\/\/8\u4f4d\u6570\u636e<\/p>\n \n\tUSBINDEX=0x02;\/\/\u9009\u62e9\u7aef\u70b92<\/p>\n \n\tUSBCSI<\/u>H=0x01; \/\/\u65b9\u5411\uff1aIN\u5757\u4f20\u8f93\uff0c\u53cc\u7f13\u51b2\u6a21\u5f0f<\/p>\n \n\tUSBMAXI=0x20;\/\/\u6700\u5927\u5305\u6570\u76ee 256\u5b57\u8282\uff088\u5b57\u8282\u4e3a\u5355\u4f4d\uff09<\/p>\n \n\tUSBINDEX=0x04;\/\/\u9009\u62e9\u7aef\u70b94<\/p>\n \n\tUSBCSOH=0x40;\/\/\u65b9\u5411\uff1aOUT\u7b49\u65f6\u4f20\u8f93\uff0c\u5355\u7f13\u51b2\u6a21\u5f0f<\/p>\n \n\tUSBMAXO=0x20;\/\/\u6700\u5927\u5305\u6570\u76ee 256\u5b57\u8282\uff088\u5b57\u8282\u4e3a\u5355\u4f4d\uff09<\/p>\n \n\t\u4e0b\u9762\u4ee5IN\u7aef\u70b92\u4e3a\u4f8b\uff0c\u8bf4\u660e\u6570\u636e\u5982\u4f55\u901a\u8fc7USB\u63a5\u53e3\u4f20\u9012\u5230\u7535\u8111\u4e0a\u3002\u5f53\u7535\u8111\u53d1\u51faIN\u8bf7\u6c42\u65f6\uff0c\u5982\u679cUSB\u7aef\u70b92\u7684FIFO\u975e\u7a7a\uff0c\u5c31\u5411\u7535\u8111\u53d1\u9001FIFO\u91cc\u7684\u5185\u5bb9\uff1b\u5982\u679cFIFO\u4e3a\u7a7a\uff0c\u5219\u5411\u7535\u8111\u53d1\u9001\u4e00\u4e2a\u7a7a\u5305\u4f5c\u4e3a\u56de\u5e94\u3002CC2531\u901a\u8fc7\u5bc4\u5b58\u5668\u4f4dUSBCSIL.INPKT_RDY\u6765\u63a7\u5236\u7535\u8111\u548c8051 MCU\u5185\u6838\u5bf9USB\u7684FIFO\u7684\u4f7f\u7528\u6743\u3002\u5f53INPKT_RDY=1\u65f6\uff0c\u7535\u8111\u6b63\u5728\u5bf9USB\u7aef\u53e3\u8fdb\u884c\u8bbf\u95ee\uff0c8051 MCU\u5185\u6838\u65e0\u6cd5\u5411FIFO\u5185\u5199\u5165\u6570\u636e\uff1b\u5f53INPKT_RDY=0\u65f6\uff0c8051 MCU\u5185\u6838\u53ef\u4ee5\u5c06\u53d1\u9001\u6570\u636e\u5199\u5165FIFO\u5185\uff0c\u7f6e\u4f4dINPKT_RDY=1\uff0c\u5b8c\u6210\u6570\u636e\u7684\u4e0a\u4f20\u3002\u5176\u6d41\u7a0b\u5982\u56fe4\u6240\u793a\u3002<\/p>\n \n\t<\/p>\n \n\t\u56fe4 \u7aef\u70b92\u6570\u636e\u6d41\u7a0b<\/p>\n \n\t4 \u6e29\u5ea6\u91c7\u96c6\u7684\u5b9e\u73b0<\/p>\n \n\t\u91c7\u7528CC2531\u4f5c\u4e3a\u6e29\u5ea6\u6570\u636e\u7684\u6c47\u805a\u8282\u70b9\uff0c\u91c7\u7528IEEE 802.15.4\u534f\u8bae\u7ec4\u6210\u4e00\u4e2a\u753110\u4e2a\u91c7\u96c6\u7ec8\u7aef\u7ec4\u6210\u7684\u661f\u72b6\u7f51\u7edc\uff0c\u5bf9\u7ec8\u7aef\u8282\u70b9\u7684\u6e29\u5ea6\u8fdb\u884c\u91c7\u96c6\u3002\u7ec8\u7aef\u8282\u70b9\u786c\u4ef6\u7531CC2530\u5b9e\u73b0\uff0c\u6e29\u5ea6\u4f20\u611f\u5668<\/u>\u91c7\u7528DS18B20.\u4e0a\u4f4d\u673a\u7531Visual C++<\/u>\u7f16\u5199\uff0c\u5b9e\u73b0\u6570\u636e\u7684\u5b9e\u65f6\u663e\u793a\uff0c\u5e76\u5b9e\u73b0\u6570\u636e\u7684\u5b58\u50a8\u548c\u5386\u53f2\u6e29\u5ea6\u67e5\u8be2\u3002CC2531\u7684USB\u8bbe\u5907\u63cf\u8ff0\u7b26\u91cc\u58f0\u660ePID=0x1000\uff0cVID=0x0451\uff0cUBS\u9a71\u52a8\u91c7\u7528Windows XP\u7cfb\u7edf\u63d0\u4f9b\u7684usbser.sys.\u6e29\u5ea6\u91c7\u96c6\u7ed3\u679c\u5982\u56fe5\u6240\u793a\u3002<\/p>\n \n\t<\/p>\n \n\t\u56fe5 \u6e29\u5ea6\u91c7\u96c6\u7ed3\u679c<\/p>\n \n\t\u7ed3\u8bed<\/p>\n \n\t\u91c7\u7528CC2531\u65e0\u7ebf\u5355\u7247\u673a<\/u>\uff0c\u5b9e\u73b0\u4e86\u57fa\u4e8eUSB\u63a5\u53e3\u7684\u865a\u62df\u4e32\u53e3\u901a\u4fe1\uff0c\u5e76\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u57fa\u4e8eCDC\u7c7b\u7684USB\u865a\u62df\u4e32\u53e3\u901a\u4fe1\u7684\u5b9e\u73b0\u3002\u5b9e\u9a8c\u7ed3\u679c\u8868\u660e\uff0c\u6570\u636e\u4f20\u8f93\u7387\u6ee1\u8db3\u91c7\u7528IEEE 802.15.4\u534f\u8bae\u7684\u4f4e\u901f\u65e0\u7ebf\u4f20\u611f\u5668<\/u>\u7f51\u7edc\u7684\u8981\u6c42\uff0c\u540c\u65f6\u53c8\u907f\u514d\u4e86PC\u7aef\u9a71\u52a8\u7a0b\u5e8f\u7684\u5f00\u53d1\uff0c\u5177\u6709\u4e00\u5b9a\u7684\u5b9e\u9645\u610f\u4e49\u3002 1 CDC\u7c7b\u7b80\u4ecb \u5728 USB \u7684\u6587\u4ef6\u4e2d\uff0c\u5b9a\u4e49\u4e86\u5c06\u67d0\u79cd\u76f8\u540c\u5c5e\u6027\u7684\u8bbe\u5907\u6574\u5408\u5728\u4e00\u8d77\u7684\u7fa4\u4f53\uff0c\u79f0\u4e4b\u4e3a\u7c7b\u3002\u8fd9\u6837\u505a\u53ef\u4ee5\u540c\u65f6\u5f00\u53d1\u8be5\u7c7b\u7684\u9a71\u52a8\u7a0b\u5e8f\uff0c\u63d0\u9ad8\u4e86\u9a71\u52a8\u7a0b\u5e8f\u7684\u590d\u7528\u6027\u3002CDC\u7c7b\u662f\u901a\u4fe1\u8bbe\u5907\u7c7b\u7684\u7b80\u79f0\uff0c<\/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\/2799"}],"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=2799"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2799\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2799"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n\t\u6765\u6e90\uff1b\u7535\u5b50\u5de5\u7a0b\u7f51<\/p>\n","protected":false},"excerpt":{"rendered":"