<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic The IIC problem in KL02 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449683#M26635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The KL02 works in master mode.&lt;/P&gt;&lt;P&gt;The IIC communication is failed when there is EMC disturbance.&lt;/P&gt;&lt;P&gt;The IIC communication is still failed when the EMC disturbance disappears.&lt;/P&gt;&lt;P&gt;The BUSY bit in register I2C1_S is always 1.It cannot be changed to 0.&lt;/P&gt;&lt;P&gt;It is only OK after the CPU resets.&lt;/P&gt;&lt;P&gt;Is there any method to restore the communication without resetting CPU when the EMC disturbance disappears?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jun 2015 11:02:01 GMT</pubDate>
    <dc:creator>小勇邹</dc:creator>
    <dc:date>2015-06-11T11:02:01Z</dc:date>
    <item>
      <title>The IIC problem in KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449683#M26635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The KL02 works in master mode.&lt;/P&gt;&lt;P&gt;The IIC communication is failed when there is EMC disturbance.&lt;/P&gt;&lt;P&gt;The IIC communication is still failed when the EMC disturbance disappears.&lt;/P&gt;&lt;P&gt;The BUSY bit in register I2C1_S is always 1.It cannot be changed to 0.&lt;/P&gt;&lt;P&gt;It is only OK after the CPU resets.&lt;/P&gt;&lt;P&gt;Is there any method to restore the communication without resetting CPU when the EMC disturbance disappears?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 11:02:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449683#M26635</guid>
      <dc:creator>小勇邹</dc:creator>
      <dc:date>2015-06-11T11:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: The IIC problem in KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449684#M26636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The description is wrong. I have modified it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The KL02 works in master mode.&lt;/P&gt;&lt;P&gt;The IIC communication is failed when there is EMC disturbance.&lt;/P&gt;&lt;P&gt;The IIC communication is still failed when the EMC disturbance disappears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: yellow;"&gt;The ARBL bit in register I2C1_S is always 1.It cannot be changed to 0. It becomes 1&lt;BR /&gt;again after I setting it to 0.The I2C1_S is 0x10 when the communication is&lt;BR /&gt;failed. But the I2C1_S is 0x84 when the communication is OK.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any method to restore the communication without resetting CPU when the EMC disturbance disappears?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 12:34:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449684#M26636</guid>
      <dc:creator>小勇邹</dc:creator>
      <dc:date>2015-06-11T12:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: The IIC problem in KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449685#M26637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems likely the SLAVE is probably 'stuck mid transaction', and must be cleared from the bus in the 'usual' way -- which is to take manual (GPIO) control of the I2C lines, send eight clock edges and a 'stop'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 14:36:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449685#M26637</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2015-06-11T14:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: The IIC problem in KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449686#M26638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Earl Goodrich II,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to send eight clock edges and a 'stop'?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give me a simple example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robin Zou.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robin-XiaoYong Zou&lt;/P&gt;&lt;P&gt;ABB Xiamen Low Voltage Equipment Company Limited&lt;/P&gt;&lt;P&gt;BU LPLS E&amp;amp;D China&lt;/P&gt;&lt;P&gt;No. 12-20,3rd Chuang Xin Road Xiamen SEZ,Fujian 361006 P.R.China&lt;/P&gt;&lt;P&gt;CN&lt;/P&gt;&lt;P&gt;Phone: +86 592 5767877&lt;/P&gt;&lt;P&gt;Telefax: +86 592 6038110&lt;/P&gt;&lt;P&gt;Mobile: +86 181-5089-3720&lt;/P&gt;&lt;P&gt;email: robin-xiaoyong.zou@cn.abb.com&amp;lt;mailto:robin-xiaoyong.zou@cn.abb.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 03:05:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449686#M26638</guid>
      <dc:creator>小勇邹</dc:creator>
      <dc:date>2015-06-12T03:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: The IIC problem in KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449687#M26639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue is that any time an I2C transaction is 'interrupted', the slave that was being addressed will be in some part of ITS bus-access sequence, and awaits clocking by the master to proceed.&amp;nbsp; It can be in a condition of driving SDA low (driving 'ack' for a write-byte, driving '0 data' for a read-byte), and as long as that is true the master in UNABLE to 'normally' access the bus -- it is 'busy'.&amp;nbsp; It is necessary to manually supply clocks (up to a full byte's worth, of course!) until the slave 'gives up' the data line, so that at that point you can force a 'stop' condition which will 'reset' ALL slave bus-access state machines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The details are pretty well mired in your particulars -- which I/O, and what you would use for time-pacing.&amp;nbsp; But the general point is to restore the two pins (SCL and SDA) to I/O mode (open drain operation, of course!) and set the former SDA 'open' (not driven: input).&amp;nbsp; Then every 5us drive the pin formerly called SCL low, wait 5 more, then release it, and do that up to eight times until you sense (after the 5us delay just before the next attempt to drive low) SDA 'high'.&amp;nbsp; Then drive SDA low yourself, wait 5us, and release it back to high -- that last edge is the I2C 'stop' (SDA rising edge while SCL high).&amp;nbsp; See:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/398627"&gt;I2C device dead-lock recovery&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example for a K20 has completely different GPIO controls:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t fault_cnt = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; GPIOB_PDDR &amp;amp;= ~(uint32_t)(3&amp;lt;&amp;lt;2);&amp;nbsp; //Both as 'high', but inputs (OC)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PSOR = 3&amp;lt;&amp;lt;2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTB_PCR2 = PORT_PCR_MUX(1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //I2C0 SCL to I/O&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTB_PCR3 = PORT_PCR_MUX(1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //I2C0 SDA to I/O&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; time_delay(2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while( (GPIOB_PDIR &amp;amp; (3&amp;lt;&amp;lt;2)) != (3&amp;lt;&amp;lt;2) )&amp;nbsp; //NOT both pulled 'high'???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { //We need to try 'clocking' the interface to get the slave to 'let go' of the data line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp; technically, this can't exceed 8 '0' data bits, at which point the slave might finally expect the ACK/NACK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp; BUT it is valid enough for us to just 'get control' of the data line and issue STOP to re-align ALL slaves&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PCOR = 1&amp;lt;&amp;lt;2;&amp;nbsp; //When we drive, make it a 'zero'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PDDR |= 1&amp;lt;&amp;lt;2;&amp;nbsp; //Output now!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; time_delay(2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PDDR &amp;amp;= ~(uint32_t)(1&amp;lt;&amp;lt;2); //Float back high!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; time_delay(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( ++fault_cnt &amp;gt; 10 )&amp;nbsp; //Too many???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Os_LogDebug(OS_LOG_DEBUG_ERROR, "I2C0 failed to clear.\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Make a 'stop' condition -- a rising-edge on SDA while SCL is 'high'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PCOR = 1&amp;lt;&amp;lt;2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PDDR |= 1&amp;lt;&amp;lt;2;&amp;nbsp; //Clock low&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; time_delay(2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PCOR = 1&amp;lt;&amp;lt;3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PDDR |= 1&amp;lt;&amp;lt;3;&amp;nbsp; //Data low&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; time_delay(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PDDR &amp;amp;= ~(uint32_t)(1&amp;lt;&amp;lt;2); //Float clock back high!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; time_delay(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOB_PDDR &amp;amp;= ~(uint32_t)(1&amp;lt;&amp;lt;3); //Float data back high!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; time_delay(1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 13:29:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-IIC-problem-in-KL02/m-p/449687#M26639</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2015-06-12T13:29:24Z</dc:date>
    </item>
  </channel>
</rss>

