<?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 MicrocontrollersのトピックRe: i2c bus reads 2 bytes instead of one?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/i2c-bus-reads-2-bytes-instead-of-one/m-p/623165#M37299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;BR /&gt;Please refer the "Figure 31-42. Typical I2C interrupt routine" in &lt;A href="http://www.nxp.com/assets/documents/data/en/reference-manuals/KEA128RM.pdf"&gt;KEA128RM&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Dummy read.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/11625i8E124E3BB05C4E5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Dummy read.png" alt="Dummy read.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u8ErrorStatus = I2C_ReadOneByte(pI2Cx,&amp;amp;pRdBuff[i],I2C_SEND_NACK);&amp;nbsp; is used to read one byte out of the i2c register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;---------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Dec 2016 06:36:56 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2016-12-21T06:36:56Z</dc:date>
    <item>
      <title>i2c bus reads 2 bytes instead of one?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/i2c-bus-reads-2-bytes-instead-of-one/m-p/623164#M37298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the KEAZ128 and I just downloaded the quick start package which has a bunch of test drivers in it. I started using the polling i2c driver and noticed that its reading two bytes out of the i2c register called instead of one? Has anyone else encountered this problem with this code? &amp;nbsp;Here is the read function from the file:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint8_t I2C_MasterReadWait(I2C_Type *pI2Cx,uint16_t u16SlaveAddress,uint8_t *pRdBuff,uint32_t u32Length)&lt;BR /&gt;{&lt;BR /&gt; uint32_t i;&lt;BR /&gt; uint8_t u8ErrorStatus;&lt;/P&gt;&lt;P&gt;/* send start signals to bus */&lt;BR /&gt; u8ErrorStatus = I2C_Start(pI2Cx);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* send device address to slave */&lt;BR /&gt; u8ErrorStatus = I2C_WriteOneByte(pI2Cx,u16SlaveAddress | I2C_READ);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* if no error occur, received the correct ack from slave&lt;BR /&gt; continue to send data to slave&lt;BR /&gt; */&lt;BR /&gt; /* dummy read one byte to switch to Rx mode */&lt;BR /&gt; I2C_ReadOneByte(pI2Cx,&amp;amp;pRdBuff[0],I2C_SEND_ACK);&lt;BR /&gt; &lt;BR /&gt; if( u8ErrorStatus == I2C_ERROR_NULL )&lt;BR /&gt; {&lt;BR /&gt; for(i=0;i&amp;lt;u32Length-1;i++)&lt;BR /&gt; {&lt;BR /&gt; u8ErrorStatus = I2C_ReadOneByte(pI2Cx,&amp;amp;pRdBuff[i],I2C_SEND_ACK);&lt;BR /&gt; if( u8ErrorStatus != I2C_ERROR_NULL )&lt;BR /&gt; {&lt;BR /&gt; return u8ErrorStatus;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; u8ErrorStatus = I2C_ReadOneByte(pI2Cx,&amp;amp;pRdBuff[i],I2C_SEND_NACK);&lt;BR /&gt; }&lt;BR /&gt; /* send stop signals to bus */&lt;BR /&gt; u8ErrorStatus = I2C_Stop(pI2Cx);&lt;BR /&gt; return u8ErrorStatus;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2016 00:48:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/i2c-bus-reads-2-bytes-instead-of-one/m-p/623164#M37298</guid>
      <dc:creator>alexandradickie</dc:creator>
      <dc:date>2016-12-19T00:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: i2c bus reads 2 bytes instead of one?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/i2c-bus-reads-2-bytes-instead-of-one/m-p/623165#M37299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;BR /&gt;Please refer the "Figure 31-42. Typical I2C interrupt routine" in &lt;A href="http://www.nxp.com/assets/documents/data/en/reference-manuals/KEA128RM.pdf"&gt;KEA128RM&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Dummy read.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/11625i8E124E3BB05C4E5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Dummy read.png" alt="Dummy read.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u8ErrorStatus = I2C_ReadOneByte(pI2Cx,&amp;amp;pRdBuff[i],I2C_SEND_NACK);&amp;nbsp; is used to read one byte out of the i2c register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;---------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 06:36:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/i2c-bus-reads-2-bytes-instead-of-one/m-p/623165#M37299</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2016-12-21T06:36:56Z</dc:date>
    </item>
  </channel>
</rss>

