<?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 Re: Slave address in I2C repeated start is always 0 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361780#M18423</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was actually able to make it work by adding a 3us delay between sending the repeated start signal and writing the slave address again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;// Repeated Start&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I2C0_C1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= I2C_C1_RSTA_MASK;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;delay_us(3);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;// Write slave address byte&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I2C0_D = (0x43 &amp;lt;&amp;lt; 1) | 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jan 2015 19:04:26 GMT</pubDate>
    <dc:creator>willx</dc:creator>
    <dc:date>2015-01-21T19:04:26Z</dc:date>
    <item>
      <title>Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361774#M18417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a KL03 as an I2C master and it is sending the following bytes to a slave with address 0x43:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(0x43 &amp;lt;&amp;lt; 1) | 0&lt;/P&gt;&lt;P&gt;0x01&lt;/P&gt;&lt;P&gt;(0x43 &amp;lt;&amp;lt; 1) | 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then the expectation is to read a byte back from the slave.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the problem I'm seeing is that the second time I write the slave address, it shows up as 0 (irrespective of what I actually write) and then the data read is always 0xFF. See attached screenshot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's some snippets of the code I'm using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// init function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Enable clock for SPI0 module */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SIM_SCGC4 |= SIM_SCGC4_I2C0_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PORT_PCR_REG( PORTA_BASE_PTR, 3 ) = PORT_PCR_MUX(2); // SCL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PORT_PCR_REG( PORTA_BASE_PTR, 4 ) = PORT_PCR_MUX(2); // SDA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 = 0x0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C2 = 0x0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* No slave address, so this is master */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_A1 = 0x0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 |= I2C_C1_IICIE_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_S1 = I2C_S1_IICIF_MASK | I2C_S1_ARBL_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Initialize and set I2C baudrate to default value */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i2c_set_baudrate( i2cInfo.baudRate );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Enable I2C0 Interrupts */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; enable_int_vector( INT_I2C0, INT_MAX_PRIORITY_DEFAULT );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 |= I2C_C1_IICEN_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// I trigger the I2C transfer to the slave by writing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Send start signal */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 |= I2C_C1_MST_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Set to TX mode */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 |= I2C_C1_TX_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Write byte */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_D = (slaveAddr &amp;lt;&amp;lt; 1) | 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// And then the rest of the processing is done in the IRQ handler which basically does the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// first IRQ&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_S1 |= I2C_S1_IICIF_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_D = 0x1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// second IRQ&lt;BR /&gt;&amp;nbsp;&amp;nbsp; I2C0_S1 |= I2C_S1_IICIF_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 |= I2C_C1_RSTA_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_D = (slaveAddr &amp;lt;&amp;lt; 1) | 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// third IRQ&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_S1 |= I2C_S1_IICIF_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 &amp;amp;= ~I2C_C1_TX_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 |= I2C_C1_TXAK_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp; readData = I2C0_D;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// fourth IRQ&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_S1 |= I2C_S1_IICIF_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 |= I2C_C1_TXAK_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 |= I2C_C1_TX_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C0_C1 &amp;amp;= ~I2C_C1_MST_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any idea of what might be causing this? Appreciate the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2015-01-20 at 1.52.46 PM.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/48915i8C179FB3DFCEDA5F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2015-01-20 at 1.52.46 PM.png" alt="Screen Shot 2015-01-20 at 1.52.46 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 22:04:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361774#M18417</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-01-20T22:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361775#M18418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see this post:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/message/460444#460444" title="https://community.freescale.com/message/460444#460444"&gt;https://community.freescale.com/message/460444#460444&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not been able to work with the KL03 or KL43's I2C in interrupt mode due to the probem. Am awaiting new feedback from Freescale.&lt;/P&gt;&lt;P&gt;Could your problem be the same, or related?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 01:15:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361775#M18418</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-01-21T01:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361776#M18419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is not specific to interrupt mode. I tried the following code which does the same as what I was trying to do sequentially but still the exact same output (only IICEN was set in C1, IICIE was cleared):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;// Set as Master&lt;/P&gt;&lt;P&gt;I2C0_C1&amp;nbsp; |=&amp;nbsp; I2C_C1_MST_MASK;&lt;/P&gt;&lt;P&gt;// Set as TX&lt;/P&gt;&lt;P&gt;I2C0_C1 |= I2C_C1_TX_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Write slave address byte&lt;/P&gt;&lt;P&gt;I2C0_D = (0x43 &amp;lt;&amp;lt; 1) | 0;&lt;/P&gt;&lt;P&gt;// Wait&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((I2C0_S1 &amp;amp; I2C_S_IICIF_MASK)==0)&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; // clear flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C0_S1 |= I2C_S_IICIF_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Write register address byte&lt;/P&gt;&lt;P&gt;I2C0_D = 0x1;&lt;/P&gt;&lt;P&gt;// Wait&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((I2C0_S1 &amp;amp; I2C_S_IICIF_MASK)==0)&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; // clear flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C0_S1 |= I2C_S_IICIF_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Repeated Start&lt;/P&gt;&lt;P&gt;I2C0_C1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= I2C_C1_RSTA_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Write slave address byte&lt;/P&gt;&lt;P&gt;I2C0_D = (0x43 &amp;lt;&amp;lt; 1) | 1;&lt;/P&gt;&lt;P&gt;// Wait&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((I2C0_S1 &amp;amp; I2C_S_IICIF_MASK)==0)&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; // clear flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C0_S1 |= I2C_S_IICIF_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set as RX&lt;/P&gt;&lt;P&gt;I2C0_C1 &amp;amp;= ~I2C_C1_TX_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Give NACK&lt;/P&gt;&lt;P&gt;I2C0_C1 |= I2C_C1_TXAK_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Read byte&lt;/P&gt;&lt;P&gt;tempRead1 = I2C0_D;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Wait&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while((I2C0_S1 &amp;amp; I2C_S_IICIF_MASK)==0)&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; // clear flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C0_S1 |= I2C_S_IICIF_MASK;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Stop&lt;/P&gt;&lt;P&gt;// Set Slave&lt;/P&gt;&lt;P&gt;I2C0_C1&amp;nbsp; &amp;amp;= ~I2C_C1_MST_MASK;&lt;/P&gt;&lt;P&gt;// Set RX&lt;/P&gt;&lt;P&gt;I2C0_C1 &amp;amp;= ~I2C_C1_TX_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Read byte&lt;/P&gt;&lt;P&gt;tempRead2 = I2C0_D;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 05:50:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361776#M18419</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-01-21T05:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361777#M18420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Will&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact the problem is not restricted to interrupt mode, but I believe that some code (which happens to not be interrupt driven) manages to function.&lt;/P&gt;&lt;P&gt;I just never managed to avoid the issue with interrupts and that is why I call it an 'interrupt mode' problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 06:17:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361777#M18420</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-01-21T06:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361778#M18421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;So do you have any sample code that manages to do a repeated start?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be great if I could compare my code with something known to work to understand what could be the problem. I pulled some online code and tried it but it still doesn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 06:51:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361778#M18421</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-01-21T06:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361779#M18422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Will&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not have any code that works (I just heard that there was some simple polling code that didn't seem to be [obviously] affected).&lt;/P&gt;&lt;P&gt;In my case I do not use I2C on these devices until there is feedback about the recommended workaround from Freescale.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 18:54:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361779#M18422</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-01-21T18:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361780#M18423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was actually able to make it work by adding a 3us delay between sending the repeated start signal and writing the slave address again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;// Repeated Start&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I2C0_C1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= I2C_C1_RSTA_MASK;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;delay_us(3);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;// Write slave address byte&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I2C0_D = (0x43 &amp;lt;&amp;lt; 1) | 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 19:04:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361780#M18423</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-01-21T19:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361781#M18424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually this is the final fix I have come up with for this problem. Need to make sure the TX buffer is ready to accept new data before writing to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;// Repeated Start&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I2C0_C1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= I2C_C1_RSTA_MASK;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;// Wait till TX buffer is ready to be written to&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;while ( (I2C0_S2 &amp;amp; I2C_S2_EMPTY_MASK) == 0x00 );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;// Write slave address byte&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I2C0_D = (0x43 &amp;lt;&amp;lt; 1) | 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 23:02:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361781#M18424</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-01-21T23:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361782#M18425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Will&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The KL03 is different to previous I2C Kinetis implementations due to the fact that it is double-buffered (previously all were single-buffered).&lt;/P&gt;&lt;P&gt;The delay and/or polling for a state may avoid problems which can't be avoided when using only interrupts (without also waiting for flags in the interrupt routine itself).&lt;/P&gt;&lt;P&gt;Since I don't want to use any blocking driver code I am still waiting to hopefully hear details back from Freescale.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 03:55:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361782#M18425</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-01-22T03:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361783#M18426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Mark — have you heard back from Freescale (NXP)? I've just stubled into this problem (what a timewaster) here:&amp;nbsp;&lt;A href="https://community.nxp.com/thread/436883"&gt;I2C: delay required between setting RSTA and write to D?&lt;/A&gt;&amp;nbsp;and I'm trying to figure out an elegant solution. The newer "double-buffered" I2C peripheral seems like a disaster to me.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm wondering in particular whether the repeated start flow you proposed here&amp;nbsp;&lt;A href="https://community.nxp.com/thread/377611"&gt;Double Buffered I2C Difficulties (eg. KL27)&lt;/A&gt;&amp;nbsp; is something that is "officially sanctioned" and expected to work reliably? I mean specifically using the start detection with additional interrupts to detect that a repeated start condition has been transmitted and it is safe to write to the D register?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read AN4997 and find it disconcerting. This phrase in particular: "apply a small delay (depends on the I2C clock selection) before waiting for the EMPTY flag" &amp;nbsp;— what is a "small delay"? Do I need to wait before waiting for the EMPTY flag? Sounds like a race condition waiting to happen. Plus, I'd really rather not busy-wait at all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 09:49:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361783#M18426</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2016-10-19T09:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Slave address in I2C repeated start is always 0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361784#M18427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Freescale/NXP upgraded the migration guide with new information about the I2C difficulties (originally specified as fully compatible and no SW impact, but subsequently upgraded to essentially "massive" SW impact....). I also had some contact with the Freescale engineer tasked with the rework and I was also asked some questions about whether I knew anything about needing to add SW delays, etc. I referenced to my own work that is also published in the forum where no delays are needed, but the new documents still have them mentioned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the meantime the uTasker I2C master/save implementation has been used in various industrial projects, including very high use repeated starts, with no known issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that some people have to realise that Freescale/NXP is a fantastic chip design/manufacturer but not a necessarily a firmware specialist or embedded system developer. Most code is example code that may have been written by a guru but may also have been written by someone who happened to have a bit of time to experiment (no software developer is reference, no idea if any code management is present, whether things were tested extensively, etc.). Basically Freescale/NXP is interested in giving users something get started with (that may work if the wind blows in the right direction) and so hooked into their chips. It is up the the user to actually get things working, which may involve a rework of the basic examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically in the case of the buffered I2C I do think that the design is flawed (not up to the usual standard) but I also think that the example code was something that seemed to work by chance due to adding some delays (the sort of things that one tries when one doesn't "yet" understand behavior) which is adequate for "examples" to show that it "can" work. At the end of the day anyone developing embedded software is responsible for the final functionality so if the examples don't deliver the required quality one can do it properly themselves....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S: I believe that Microsoft was also caught out when they used Freescale code for the internal clock driver in their (failed?) Zune devices. &lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FZune" rel="nofollow" target="_blank"&gt;https://en.wikipedia.org/wiki/Zune&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The first generation devices froze at midnight on December 31st 2008 due to this.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2016 14:48:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Slave-address-in-I2C-repeated-start-is-always-0/m-p/361784#M18427</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-10-20T14:48:41Z</dc:date>
    </item>
  </channel>
</rss>

