<?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>Kinetis Software Development KitのトピックRe: I2C Communications Lockup Issue when during communications the processor experiences a brownout or is put into a low power state because of loss of power</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-Communications-Lockup-Issue-when-during-communications-the/m-p/498057#M4686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Vanitha&lt;/P&gt;&lt;P&gt;From your description, you have the chip enter sleep mode in the low voltage warning interrupt flag, while the chip is maintained by a super capacitor, Upon wakening the code starts running from the beginning and reconfigures the I/O and reinitializes memory values.&lt;/P&gt;&lt;P&gt;After waking up from stop mode, the processor follows up a reset procedure, is it right? if it is case, I do not think there is issue.&lt;/P&gt;&lt;P&gt;If the IIC has issue after waking up exactly, I think you can check the WAKEUP bit in MC_SRSL, if it is wakeup reset, you can delay sometime so that the power supply is stable, then reinitialize the IIC.&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jun 2016 07:40:56 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2016-06-01T07:40:56Z</dc:date>
    <item>
      <title>I2C Communications Lockup Issue when during communications the processor experiences a brownout or is put into a low power state because of loss of power</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-Communications-Lockup-Issue-when-during-communications-the/m-p/498056#M4685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am having an I2C communications lockup issue when during communications the processor experiences a brownout or is put into a low power state because of loss of power.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the KSDK_1.30 and MKL36Z64 microcontroller for this project.&amp;nbsp; I am using the SDK functions (“I2C_DRV_MasterSendDataBlocking” / “I2C_DRV_MasterReceiveDataBlocking”) to send/receive a message and result status is “&lt;SPAN style="color: black;"&gt;kStatus_I2C_Busy&lt;/SPAN&gt;”.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i2c_result = I2C_DRV_MasterReceiveDataBlocking(I2C_PORT_0, &amp;amp;i2c_slave_eeprom, cmdBuff, 1, receiveValues, 3, I2C_TIMEOUT_MS);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the low voltage warning interrupt flag to initiate sleep mode and uses a supcap to maintain power during the power outage.&amp;nbsp; The I2C EEPROM that we are communicating with is not backed up by the supercap.&amp;nbsp; When power is restored a rising edge on the LLWU wakeup pin restores the processor to normal operation.&amp;nbsp; The only thing we need operational and maintained during the sleep is the RTC. Upon wakening the code starts running from the beginning and reconfigures the I/O and reinitializes memory values.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For debug purpose, I also have &lt;SPAN style="color: black;"&gt;I2C0_C1, I2C0_S, I2C0_FLT, and “&lt;/SPAN&gt;i2c_result” &lt;SPAN style="color: black;"&gt;values displayed on LCD when the device is up and running. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;When device wakes up from a sleep mode, all modules work correctly except I2C. Receiving a &lt;/SPAN&gt;“&lt;SPAN style="color: black;"&gt;kStatus_I2C_Busy&lt;/SPAN&gt;”&lt;SPAN style="color: black;"&gt; status each time when I2C is used. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;Here are the register values when device wakes up from a sleep mode and starts running:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;I2C0_C1 value is 0x90, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;I2C0_S value is 0x80, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;I2C0_FLT is 0x80, and &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;“&lt;/SPAN&gt;i2c_result” &lt;SPAN style="color: black;"&gt;is “kStatus_I2C_Busy”.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;With sleep mode code commenting out: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;There is no issue with I2C except under certain brownout conditions.&amp;nbsp; When VCC is removed, the device shuts down and when VCC is applied back, it will go through a power on reset (or LVD reset). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;Here are the register values when device goes through a power on reset/LVD reset: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;I2C0_C1 value is 0x88, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;I2C0_S value is 0x84, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;I2C0_FLT is 0xd0, and &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;“&lt;/SPAN&gt;i2c_result” &lt;SPAN style="color: black;"&gt;is “kStatus_I2C_Success”.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*********** I2C Initialization Code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ******************/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;The code to initialize i2c is below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;i2c_master_state_t master;&lt;/P&gt;&lt;P&gt;void init_i2c_master( void )&lt;/P&gt;&lt;P&gt;{&amp;nbsp; &lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;//Initialize the I2C master mode driver&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;I2C_DRV_MasterInit(I2C_PORT_0, &amp;amp;master);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;init_i2c_master ();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Initialize I2C instance 0 master&lt;/P&gt;&lt;P&gt;//Debug: Stop Hold Enable. Stop holdoff is enabled.&lt;/P&gt;&lt;P&gt;I2C0_FLT |= I2C_FLT_SHEN_MASK;&lt;/P&gt;&lt;P&gt;/******&amp;nbsp;&amp;nbsp; END of I2C Initialization Code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *****************/&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried several things to resolve the problem. But none of them have worked.&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;If "i2c_result" is "Arbitration lost" or "busy", disable and re-enable I2C.&amp;nbsp; Did not work.&lt;/LI&gt;&lt;LI&gt;Toggle the I2C clock line if “i2c_result” is NOT “kStatus_I2C_Success”. I did this by disabling I2C then set I2C clock line as GPIO output and toggle it.&amp;nbsp; Then reconfigure the pin as an I2C clock line.&amp;nbsp; Finally enable I2C.&amp;nbsp; Did not work.&lt;/LI&gt;&lt;LI&gt;In LVD_LVW_IRQHandler ( ), I tried I2C “Deinit” and changed I2C clock and data line mux settings to “0” (pins are disabled). This did not work.&lt;/LI&gt;&lt;/OL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have reached the end of what I know, any comments or suggestions would be appreciated. Thank you.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Vanitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 16:25:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-Communications-Lockup-Issue-when-during-communications-the/m-p/498056#M4685</guid>
      <dc:creator>vanithaaenugu</dc:creator>
      <dc:date>2016-05-24T16:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: I2C Communications Lockup Issue when during communications the processor experiences a brownout or is put into a low power state because of loss of power</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-Communications-Lockup-Issue-when-during-communications-the/m-p/498057#M4686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Vanitha&lt;/P&gt;&lt;P&gt;From your description, you have the chip enter sleep mode in the low voltage warning interrupt flag, while the chip is maintained by a super capacitor, Upon wakening the code starts running from the beginning and reconfigures the I/O and reinitializes memory values.&lt;/P&gt;&lt;P&gt;After waking up from stop mode, the processor follows up a reset procedure, is it right? if it is case, I do not think there is issue.&lt;/P&gt;&lt;P&gt;If the IIC has issue after waking up exactly, I think you can check the WAKEUP bit in MC_SRSL, if it is wakeup reset, you can delay sometime so that the power supply is stable, then reinitialize the IIC.&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2016 07:40:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/I2C-Communications-Lockup-Issue-when-during-communications-the/m-p/498057#M4686</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-06-01T07:40:56Z</dc:date>
    </item>
  </channel>
</rss>

