{"id":1745,"date":"2018-12-13T02:58:24","date_gmt":"2018-12-13T02:58:24","guid":{"rendered":""},"modified":"2018-12-13T10:58:51","modified_gmt":"2018-12-13T02:58:51","slug":"i2c%e5%92%8c%e7%94%b5%e6%ba%90%e7%9a%84%e5%85%b3%e7%b3%bb","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=1745","title":{"rendered":"I2C\u548c\u7535\u6e90\u7684\u5173\u7cfb"},"content":{"rendered":"
\n\t\u524d\u9762\u8bf4\u7684“I2C<\/u>\u4e03\u5b97\u7f6a\u4e4b\u7b2c\u4e00\u7f6a”\u548c\u590d\u4f4d\u6709\u5173\u7cfb\uff0c \u8fd9\u4e00\u6b21\u6211\u4eec\u6765\u8bf4\u8bf4\uff1a<\/p>\n
\n\tI2C\u548c\u7535\u6e90\u7684\u5173\u7cfb<\/p>\n
\n\t\u63d0\u5230\u7535\u6e90\u5927\u5bb6\u7684\u5fc3\u7406\u901a\u5e38\u662f\u7d27\u5f20\u6ef4\uff0c\u4e0d\u81ea\u89c9\u5730\u53d1\u95ee\uff1a\u662f\u4e0d\u662f\u95ee\u9898\u5f88\u4e25\u91cd\uff1f\u662f\u7684\uff0c \u975e\u5e38\u4e25\u91cd\uff0c \u800c\u4e14\u901a\u8fc7\u8f6f\u4ef6\u662f\u6ca1\u6709\u529e\u6cd5\u89e3\u51b3\u7684\u3002\u6211\u4eec\u5148\u6765\u770b\u4e0b\u9762\u8fd9\u5f20\u7b80\u56fe\uff1a<\/p>\n
\n\t1.\u7cfb\u7edf\u6709\u98ce\u6247\uff0c12V\u4f9b\u7535\uff1b<\/p>\n
\n\t2.Fan\u548cCPU<\/u>\u4e4b\u95f4\u6709\u8f6c\u901f\u68c0\u6d4bTACH\u548c\u8f6c\u901f\u63a7\u5236PWM\u4fe1\u53f7\uff1b<\/p>\n
\n\t3.CPU\u5de6\u8fb9\u6709\u4e00\u4e2a\u9897I2C EXPANDER\uff0c\u7528\u6765\u505aGPI<\/u>O\u6269\u5c55\u7684\uff1b<\/p>\n
\n\t4.DC-DC\u4ea7\u751fVCC-3.3V\u5206\u522b\u4f9b\u7ed9CPU\u548cI2C Expander\u3002<\/p>\n
\n\t<\/p>\n
\n\t\u4e4d\u4e00\u770b\uff0c\u4e5f\u6ca1\u5565\u95ee\u9898\u554a\uff01\u4fd7\u8bdd\u8bf4\u5f97\u597d\uff0c\u5e73\u9759\u7684\u6c34\u9762\u4e0b\u6697\u6d41\u6d8c\u52a8\u554a\uff0c\u6211\u5148\u6765\u7ed9\u5927\u5bb6\u4e00\u70b9\u70b9\u63d0\u793a\uff0c\u770b\u770b\u8c01\u80fd\u5148\u731c\u5230\u95ee\u9898\u6240\u5728\uff0c\u6211\u4eec\u6765\u770b\u770bCPU PWM\/TACH\u5185\u90e8\u7ed3\u6784\u3002<\/p>\n
\n\t<\/p>\n
\n\t\u8fd9\u4e2a\u4e5f\u6ca1\u6709\u5565\u95ee\u9898\u554a\uff0c \u6211\u4eec\u90fd\u77e5\u9053IBIS buffer\u7684\u6837\u5b50\u5982\u4e0b\uff0c\u8fd9\u4e2a\u5728\u7f51\u7edc\u4e0a\u968f\u4fbfgoogle\u6216\u8005\u5ea6\u5a18\uff0c\u5230\u5904\u90fd\u662f\u554a\u3002<\/p>\n
\n\t<\/p>\n
\n\t\u8fd9\u4e9b\u770b\u8d77\u6765\u90fd\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\uff0c\u53ef\u662f\u504f\u504f\u6211\u4eec\u628a\u8fd9\u91cc\u7684CPU(MCU<\/u>)\u548c\u98ce\u6247\u653e\u5728\u4e00\u8d77\u5c31\u51fa\u95ee\u9898\u4e86\uff0c\u770b\u770b\u4e0b\u9762\u8fd9\u5f20\u793a\u610f\u56fe\uff0c\u4f60\u4e5f\u8bb8\u4f1a\u5f00\u59cb\u6709feel\uff1a<\/p>\n
\n\t<\/p>\n
\n\t\u6211\u4eec\u4ece\u7535\u6e90\u7684\u4e0a\u7535\u987a\u5e8f\u5f00\u59cb\uff1a<\/p>\n
\n\t1.\u63d2\u516512V\u7535\u6e90\uff0cFan\u5148\u5f00\u59cb\u8fd0\u8f6c\uff0c\u6ce8\u610f\u6b64\u65f6DC-DC\u8fd8\u6ca1\u6709\u5f00\u59cb\u5de5\u4f5c\uff0c\u4e5f\u5c31\u662f\u8bf4VCC-3.3V\u8fd8\u6ca1\u6709\u4ea7\u751f\uff1b<\/p>\n
\n\t2.\u7531\u4e8e\u98ce\u6247\u768412V\u5148\u4e0a\u7535\uff0cPWN\/TACH\u4fe1\u53f7\u7ebf\u5df2\u7ecf\u6709\u7535\u4e86\uff0c\u4e8e\u662f\u901a\u8fc7\u56fe\u4e2dMCU\u7684\u4fdd\u62a4\u4e8c\u6781\u7ba1<\/u>\uff08\u4e0a\u7ba1\uff09\u5bf93.3V\u5145\u7535\uff1b<\/p>\n
\n\t3.\u6ce8\u610f\u6b64\u65f6DC-DC\u4ecd\u7136\u8fd8\u6ca1\u6709\u5de5\u4f5c\uff0c\u4f46\u662f3.3V\u5df2\u7ecf\u5f00\u59cb\u5347\u538b\uff0c\u4f46\u662f\u6765\u6e90\u4e0d\u662fDC-DC Buck\uff0c\u800c\u4e14\u6765\u81eaFan\u7684I\/O\u7ba1\u811a\u6f0f\u8fc7\u6765\u7684\uff1b<\/p>\n
\n\t4.\u6b64\u65f6DC-DC\u7535\u6e90\u5f00\u59cb\u5de5\u4f5c\uff0c\u7531\u4e8e\u540c\u6b65\u6574\u6d41\u7684\u7535\u6e90BUCK\u90fd\u9700\u8981\u81ea\u4e3e\uff0c\u4e5f\u5c31\u8bf4\u6211\u4eec\u901a\u5e38\u6240\u8bf4\u7684Bootstrap\u7684\u7535\u8def\uff0c\u4e0b\u7ba1\u7684MOSFET<\/u>\u8981\u5148\u6253\u5f00\uff08\u5173\u4e8e\u7535\u6e90\u90e8\u5206\u6211\u4eec\u540e\u9762\u518d\u8be6\u7ec6\u53d9\u8ff0\uff09\uff0c\u4ea7\u751f\u7684\u540e\u679c\u662f\u628a\u539f\u5148I\/O\u6f0f\u8fc7\u6765\u7684\u7535\u538b\u62c9\u5230\u5730\uff1b<\/p>\n
\n\t5.Bootstrap\u7535\u8def\u5f00\u59cb\u5de5\u4f5c\u540e\uff0cDC-DC\u5f00\u59cb\u6b63\u5f0f\u5de5\u4f5c\uff0c\u4ece0\u5f00\u59cb\u4ea7\u751fVCC-3.3V\u3002<\/p>\n
\n\t<\/p>\n
\n\t\u4e8e\u662f\u6211\u4eec\u5c31\u770b\u4e86\u5982\u4e0a\u56fe\u7684\u6ce2\u5f62\uff0c \u56fe\u4e2d\u7eff\u8272\u7684\u5c31\u662f3.3V\uff0c 12V\u7535\u6e90\u63d2\u5165\u77ac\u95f4\u5f00\u59cb\u4e0a\u5347\uff0c\u7136\u540e\u5728\u67d0\u4e00\u4e2a\u65f6\u95f4\uff0c\u7a81\u7136\u4e0b\u964d\u52300\uff0c \u518d\u91cd\u65b0\u4e0a\u5347\u52303.3V\uff0c \u7535\u6e90\u5b8c\u6210\u4e0a\u7535\u3002<\/p>\n
\n\t\u8bf4\u5230\u8fd9\uff0c \u6709\u4eba\u5f00\u59cb\u95ee\u4e86\uff0c\u4f60\u4e0d\u662f\u8ba8\u8bbaI2C\u5417\uff1f \u600e\u4e48\u548c\u6211\u4eec\u8ba8\u8bba\u8d773.3V\u7535\u6e90\u6765\u4e86\u554a\uff1f\u522b\u6025\u522b\u6025\uff0c \u4e8b\u60c5\u90fd\u662f\u6162\u6162\u660e\u6717\u8d77\u6765\u7684\u3002<\/p>\n
\n\t\u5982\u679c\u6b64\u65f6\u4f60\u56de\u53bb\u770b\u6700\u4e0a\u9762\u7684\u7b2c\u4e00\u5f20\u56fe\uff0c\u90a3\u4e48\u4f60\u5c31\u53d1\u73b0\u56fe\u4e2d\u6709\u4e00\u4e2aI2C Expander\uff0c\u5bf9\u4e86\uff0c\u95ee\u9898\u5c31\u51fa\u81ea\u8fd9\u91cc\uff0c\u901a\u8fc7\u6211\u4eec\u4ece\u4e0a\u9762\u7684\u8ba8\u8bba\uff0c\u6211\u4eec\u5df2\u7ecf\u77e5\u9053\uff0c 3.3V\u7684\u4e0a\u7535\u4e0d\u662f\u4e00\u5e06\u98ce\u987a\u7684\uff0c\u800c\u662f\u4f1a\u6709\u4e00\u4e2aSpike\uff0c\u4e5f\u5c31\u662f\u4e00\u4e2a\u5012\u94a9\u3002\u5982\u4e0b\u9762\u6240\u793a\uff1a<\/p>\n
\n\t<\/p>\n
\n\t\u6211\u518d\u6765\u7ed9\u4e00\u5f20\u6e05\u6670\u4e00\u70b9\u56fe\uff0cVCC\u6bcf\u6b21\u4e0a\u7535\u90fd\u662f\u5148\u88ab12V-Fan I\/O\u5145\u7535\uff0c\u7136\u540e\u8dcc\u843d\u5230\u5730\uff0c\u5728\u722c\u5347\u4f1a3.3V\uff0c \u539f\u56e0\u4e0a\u9762\u6211\u5df2\u7ecf\u7ed9\u51fa\u8be6\u7ec6\u7684\u89e3\u91ca\uff0c\u90a3\u4e48\u53c8\u6709\u4eba\u95ee\u4e86\uff0c\u8fd9\u4e2a\u4f1a\u6709\u4ec0\u4e48\u95ee\u9898\u5417\uff1f\u6211\u5148\u660e\u786e\u7684\u56de\u7b54\uff0c\u4f1a\u51fa\u5927\u95ee\u9898\u3002<\/p>\n
\n\t<\/p>\n
\n\t<\/p>\n
\n\t\u6211\u5148\u6765\u8d34\u4e00\u6bb5\u82f1\u6587\uff0c\u6211\u975e\u5e38\u5f3a\u70c8\u5efa\u8bae\u5927\u5bb6\u5e73\u65f6\u5de5\u4f5c\u4e2d\u8981\u517b\u6210\u8bfb\u82f1\u6587\u8bba\u6587\u7684\u4e60\u60ef\uff0c\u6211\u5012\u4e0d\u662f\u5d07\u6d0b\u5a9a\u5916\uff0c\u8001\u5916\u90a3\u4e9b\u5927\u725b\u7684\u6587\u7ae0\uff0c\u771f\u7684\u8ba9\u4f60\u89c9\u5f97\u5f88\u7cbe\u5999\uff0c \u6709\u65f6\u5019\u81ea\u5df1\u7ffb\u8bd1\u6210\u4e2d\u6587\u603b\u89c9\u5f97\u602a\u602a\u7684\uff0c\u751f\u6015\u66f2\u89e3\u4e86\u5927\u725b\u7684\u539f\u610f\uff0c\u6240\u4ee5\u8fd8\u662f\u8001\u8001\u5b9e\u5b9e\u53bb\u8bfb\u539f\u7248\u6587\u7ae0\uff0c\u4e0d\u8981\u7ffb\u8bd1\u6210\u4e2d\u6587\u3002<\/p>\n
\n\tIf by any chance, the TACH pin is pulled or driven high while the Expander VCC is not applied (which should not be allowed during normal operati<\/u>on), the Expander could be powered up from<\/u> the TACH pin through the connecte<\/u>d internal diode<\/u> between the pin and VCC. Such false power-up events do not ensure the required power supply to Expander the POR would not be ensured, and a lockup may occur.<\/p>\n
\n\tPoint\u548c\u4e0a\u9762\u7684\u82f1\u6587\u610f\u601d\u5dee\u4e0d\u591a\uff0c\u5c31\u662fI2C Expander\uff08\u6211\u4eec\u8fd9\u91cc\u662fCPU\uff09\u88ab\u522b\u7684\u7535\u8def \u901a\u8fc7I\/O\u7ba1\u811a\u5546\u5e97\u4e86\u3002\u6211\u4eec\u5148\u6765\u628a\u8fd9\u9897\u7c92I2C expander\u7684\u5185\u90e8\u7535\u8def\u7ed9\u753b\u4e00\u4e0b\uff0c \u6211\u4eec\u770b\u5230\u8fd9\u9897\u82af\u7247\u6ca1\u6709\u5916\u90e8\u590d\u4f4dpin\u811a\uff0c\u6240\u4ee5\u4e00\u822c\u5185\u90e8\u4f1a\u6709\u4e00\u4e2a\u7b80\u5355\u8bbe\u8ba1\u7684POR\u7535\u8def\uff1a<\/p>\n
\n\t<\/p>\n
\n\t\u6211\u4eec\u770b\u5230\uff0c\u5f533.3V VCC\u4e0a\u7535\u6709\u5012\u94a9\u65f6\uff0c\u7531\u4e8eFan\u901a\u8fc7TACH\/PWM\u5bf9I2C expander\u63d0\u524d\u4e0a\u7535\uff0c \u7136\u540e\u7a81\u7136\u53c8\u5012\u56de\u6765\uff0c \u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u6709\u4e24\u4ef6\u4e8b\u662f\u4e0d\u786e\u5b9a\u7684\uff1a<\/p>\n
\n\tThe POR brings the Expander to a known working state (the default condition) by initializing the internal storage elements (flip-flops) and recognizing its connections (such as identifying the status of pins A1 and A0 as high or low, which is how the Expander slave address can<\/u> be decided). Without the POR feature, the Expander may start up in a random state and thus may cause a lockup.<\/p>\n
\n\t1.I2C expander\u662f\u4e0d\u662f\u5df2\u7ecf\u4e0a\u7535\u6210\u529f\u4e86\uff1f\u6211\u4eec\u4e0d\u77e5\u9053\uff0c\u56e0\u4e3a3.3V\u4e0a\u7535\u5230\u4e86\u534a\u5c71\u8170\u53c8\u5012\u56de\u6765\uff0c\u6b64\u65f6\u82af\u7247\u5185\u90e8\u7684POR\u662f\u4e0d\u662f\u5bf9\u82af\u7247\u5b8c\u6210\u5185\u90e8\u590d\u4f4d\u6211\u4eec\u4e0d\u6e05\u695a\uff0c\u4e0d\u4ec5\u5982\u6b64I2C expander\u6709\u6ca1\u6709\u51c6\u786e\u9501\u5b9a\u5916\u90e8\u7684strap pin\u811a\u7684\u72b6\u6001\uff0c\u6211\u4eec\u4e5f\u4e0d\u6e05\u695a\uff1b<\/p>\n
\n\t2.\u7531\u4e8e\u4e0d\u80fd\u786e\u5b9a\u662f\u5426\u5b8c\u6210\u5185\u90e8\u5b58\u50a8\u5355\u5143\uff08\u89e6\u53d1\u5668\uff09\u7684\u521d\u59cb\u5316\uff0cI2X expander\u53ef\u80fd\u5de5\u4f5c\u4e00\u4e2a\u5f88random\u7684\u72b6\u6001\uff0c\u800c\u4e0d\u662f\u6211\u4eec\u9700\u8981\u7684Idle\u72b6\u6001\u3002<\/p>\n
\n\t\u5173\u4e8e\u8fd9\u4e2a\u89e3\u91ca\uff0c\u540e\u6765TI\u7684\u5de5\u7a0b\u5e08\u7ed9\u51fa\u8be6\u7ec6\u7684\u89e3\u91ca\uff0c \u82f1\u6587\u6211\u4e0d\u5c31\u7ffb\u8bd1\u6210\u4e2d\u6587\u4e86\uff0c\u8bf7\u8bfb\u8005\u4ed4\u7ec6\u54c1\u5473\u548c\u7406\u89e3\uff1a<\/p>\n
\n\tThe device has a 6 bit state machine (64 states) of which 49 valid state and 15 are invalid states. The above fix will work assuming the device comes up in a valid state. Typically on all our designs, an invalid state would lead to the idle state on the immediately next clock cycle. However, the PCF8575 is our very firs<\/u>t I2C device and there are some invalid states that could latch the SDA line low indefinitely. The 9 clk cycle fix will not work if the device were to power up into an invalid state. The only way to bring the device out of this state is to provide a proper reset.<\/p>\n
\n\t\u90a3\u6211\u4eec\u8bf4\u4e86\u90a3\u4e48\u591a\uff0c\u7a76\u7adf\u7ed3\u679c\u662f\u600e\u4e48\u6837\u5462\uff1f \u7ed3\u679c\u5c31\u662fI2C expander\u4ea7\u751f\u4e86Lock up\uff0c I2C\u63a5\u53e3\u8bbf\u95ee\u4e0d\u4e86\uff0c\u6709\u65f6\u5019\u8fd8\u4f1a\u62c9\u4f4fSCL\u6216\u8005SDA.<\/p>\n
\n\t\u603b\u7ed3\u4e0b\u6765\u5c31\u662f\u4e00\u53e5\u8bdd\uff1a\u82af\u7247\u9700\u8981POR\u7535\u8def\u6765\u8fdb\u884c\u590d\u4f4d\uff0c\u5982\u679c\u56e0\u4e3a\u522b\u7684\u539f\u56e0\u63d0\u524d\u4e0a\u7535\uff0c\u5bfc\u81f4POR\u5de5\u4f5c\u4e0d\u6b63\u5e38\uff0c\u90a3\u4e48\u5c31\u4f1a\u6709\u95ee\u9898\u3002<\/p>\n
\n\t\u5173\u4e8e\u4e0a\u9762\u7684\u73b0\u8c61\u8fd8\u6709\u53e6\u5916\u4e00\u79cd\u89e3\u91ca\uff0c\u5c31\u662f\u5f53VCC\u7684\u5012\u94a9\u65f6\uff0c\u6b64\u65f6I2C Expander\u7684\u5185\u90e8\u7535\u8def\u5df2\u7ecf\u88ab\u641e\u4e71\u4e86\uff0c \u4f46\u662f\u6709\u5185\u90e8POR\u7684RC\u7535\u8def\u7684\u5e73\u6ed1\u4f5c\u7528\uff0c \u5bfc\u81f4\u5185\u90e8Reset\u88ab\u6ee4\u5e73\u6ed1\u4e86\uff0c\u5185\u90e8Reset\u6ca1\u6709\u78b0\u5230\u95e8\u9650\u7535\u538b\uff0c\u8bf7\u4ed4\u7ec6\u770b\u4e0a\u56fe\u7ea2\u8272\u7684\u51f9\u9677\u3002<\/p>\n
\n\t<\/p>\n
\n\t\u8fd9\u6837\u5bfc\u81f4\u82af\u7247\u4e5f\u4e0d\u80fd\u6b63\u5e38\u590d\u4f4d\uff0c\u5f53\u7136\u4e5f\u5c31\u4e0d\u80fd\u6b63\u5e38\u5de5\u4f5c\u4e86\u3002\u8bf7\u770b\u5927\u725bHoward Johnson\u7684\u63cf\u8ff0\uff1a<\/p>\n
\n\tHoward Johnson : Power interruptions drive power-on-reset circuits crazy.. If a processor is involved, the dropout is long enough to make scram<\/u>bled eggs of the processor’s internal state machines but not long enough to discharge the RC circuit. If the RC circuit doesn't discharge, ~RESET doesn't activate, and the processor spins out of control, powered on, but lost in space.<\/p>\n","protected":false},"excerpt":{"rendered":"
\u524d\u9762\u8bf4\u7684 I2C \u4e03\u5b97\u7f6a\u4e4b\u7b2c\u4e00\u7f6a\u548c\u590d\u4f4d\u6709\u5173\u7cfb\uff0c \u8fd9\u4e00\u6b21\u6211\u4eec\u6765\u8bf4\u8bf4\uff1a I2C\u548c\u7535\u6e90\u7684\u5173\u7cfb \u63d0\u5230\u7535\u6e90\u5927\u5bb6\u7684\u5fc3\u7406\u901a\u5e38\u662f\u7d27\u5f20\u6ef4\uff0c\u4e0d\u81ea\u89c9\u5730\u53d1\u95ee\uff1a\u662f\u4e0d\u662f\u95ee\u9898\u5f88\u4e25\u91cd\uff1f\u662f\u7684\uff0c \u975e\u5e38\u4e25\u91cd\uff0c \u800c\u4e14\u901a\u8fc7<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/1745"}],"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=1745"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/1745\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1745"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}