<?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>PowerQUICC Processors中的主题 Re: i2c register read back problem</title>
    <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947975#M2995</link>
    <description>&lt;P&gt;Sorry i wrote the code as wrong. Yes my code is like your example.&lt;/P&gt;&lt;P&gt;i changed timeout value as 1000000 and i also tried it in big value to make sure the problem is not about timeout value and the problem is still same.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2021 14:15:53 GMT</pubDate>
    <dc:creator>love_hate_and_repeat</dc:creator>
    <dc:date>2021-01-12T14:15:53Z</dc:date>
    <item>
      <title>i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947959#M2979</link>
      <description>&lt;P&gt;I2C_Status is structure and defined as volatile keyword.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while(I2C_Status-&amp;gt;RXAK != ACK_SIG);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if ( I2C_Status-&amp;gt;RXAK != ACK_SIG)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("we got an ack from slave because "while loop" is broken, it is weird because now it's like we didnt get an ack from slave");&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i put a delay before if condition, printf in if condition is not printed and this means everyting is okay but if i dont put a delay before if condition, how come i dont know&amp;nbsp; printf in if condition is printed. it's weird.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why i should put a delay to read again same register ? i guess this problem is about reading consecutively same register but i dont know the technique reason&amp;nbsp; ? can you explain for me ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 14:08:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947959#M2979</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2021-01-12T14:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947960#M2980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which processor is in question?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 12:47:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947960#M2980</guid>
      <dc:creator>ufedor</dc:creator>
      <dc:date>2019-10-21T12:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947961#M2981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks, i specifed the processor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 13:03:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947961#M2981</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2019-10-21T13:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947962#M2982</link>
      <description>&lt;P&gt;by the way, the topic is assumed as answered.&amp;nbsp; can you correct it as not answered again ?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 14:18:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947962#M2982</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2021-01-12T14:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947963#M2983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please refer to the U-Boot I2C driver source code available at:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/qoriq-open-source/u-boot/blob/b3f98d438eefd1b355efdec0b50af5813ff8d0e1/drivers/i2c/fsl_i2c.c" title="https://github.com/qoriq-open-source/u-boot/blob/b3f98d438eefd1b355efdec0b50af5813ff8d0e1/drivers/i2c/fsl_i2c.c"&gt;u-boot/fsl_i2c.c at b3f98d438eefd1b355efdec0b50af5813ff8d0e1 · qoriq-open-source/u-boot · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 13:59:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947963#M2983</guid>
      <dc:creator>ufedor</dc:creator>
      <dc:date>2019-10-21T13:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947964#M2984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Primarily, thanks to your answer.&lt;/P&gt;&lt;P&gt;I actually want technique explanation because i also handle this issue by placing a delay before checking if condition but i dont know why it's working when i put a delay. I want to understand what i do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 14:54:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947964#M2984</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2019-10-21T14:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947965#M2985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe that the issue is caused by an instruction before the "while".&lt;/P&gt;&lt;P&gt;Please consider the QorIQ T1040 Reference Manual,&amp;nbsp;2.6.1 Accessing CCSR Memory from the Local Processor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 15:12:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947965#M2985</guid>
      <dc:creator>ufedor</dc:creator>
      <dc:date>2019-10-21T15:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947966#M2986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you put your declaration of&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I2C_Status?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;The status register is an 8 bit register and RXAK is just one bit in that register. So how did you declare the status register as a structure? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Also what is your declaration of ACK_SIG?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2019 14:49:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947966#M2986</guid>
      <dc:creator>Ray_V</dc:creator>
      <dc:date>2019-10-24T14:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947967#M2987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I defined it as bitfield and bit order is same with t1040 ref manual.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2019 14:18:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947967#M2987</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2019-10-28T14:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947968#M2988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you define the bitfield structure as "packed"? in many compilers you need to.&lt;/P&gt;&lt;P&gt;If you don't share the actual code it's impossible to help you beyond some generic tips.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2019 14:41:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947968#M2988</guid>
      <dc:creator>Ray_V</dc:creator>
      <dc:date>2019-10-28T14:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947969#M2989</link>
      <description>&lt;P&gt;i dont need to use packed attribute because its size is already power of two or it's not out of aligment and no need to&amp;nbsp;add pad by compiler.. the structure is defined as the following way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;struct statusRegisterStc&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned char MCF : 1;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;unsigned char MAAS : 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;unsigned char&amp;nbsp; MBB : 1;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;unsigned char&amp;nbsp; MAL : 1;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;unsigned char&amp;nbsp; BCSTM : 1;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;unsigned char&amp;nbsp; SRW : 1;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;unsigned char&amp;nbsp; MIF : 1;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;unsigned char RXAK : 1;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;and ACK_SIG is defined as following way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define ACK_SIG 0&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 14:09:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947969#M2989</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2021-01-12T14:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947970#M2990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt; &lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;i dont need to use packed attribute because its size is already power of two or it's not out of aligment and no need to&amp;nbsp;add pad by compiler&lt;/SPAN&gt;&lt;/P&gt; &lt;/BLOCKQUOTE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;It doesn't matter, I have found when porting code between processors+compilers that in some you still have to use "packed" or it doesn't work.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I would just avoid it and use mask, it's more portable. Also try waiting until the bus is idle, that way you know&amp;nbsp;RXAK is valid.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="property macro token"&gt;#define RXAK_MASK 0x80&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define MBB_MASK 0x04&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; MBB_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; RXAK_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; RXAK_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// some code&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;And I would also add timeouts to the while loops to avoid hanging up if the condition never becomes false.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;By the way, the problem is very likely caused by checking for the ACK before the frame is sent by the hardware and the ACK you see initially is for the previous frame.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 13:42:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947970#M2990</guid>
      <dc:creator>Ray_V</dc:creator>
      <dc:date>2019-10-31T13:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947971#M2991</link>
      <description>&lt;P&gt;i resolved this problem with delay but i don't know the reason why it's working when putting a delay before accessing registers.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 14:13:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947971#M2991</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2021-01-12T14:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947972#M2992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not used nor do I have this processor, so I have no hands on experience with it.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;It's possible that the bus idle bit can only be used to detect if other masters are controlling the bus, and not if this i2c is transmitting.&amp;nbsp;Also I could not find information on when the RXAK bit gets&amp;nbsp;set, it could be that it is set after the byte has been transmitted and cleared when the ACK is received.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;You can try looking at the MCF bit (byte transfer complete) before looking at RXAK&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="property macro token"&gt;#define RXAK_MASK 0x80&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define MCF_MASK 0x01&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/* 1 = transfer is completed */&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; MCF_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/* 0 = ACK received */&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; RXAK_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; RXAK_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
     &lt;SPAN class="comment token"&gt;// Handle Failure&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// Handle success&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2019 14:45:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947972#M2992</guid>
      <dc:creator>Ray_V</dc:creator>
      <dc:date>2019-11-01T14:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947973#M2993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your effort and reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i&amp;nbsp;use counter beside of checking bit with mask&amp;nbsp; like following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;
&lt;/CODE&gt;*I2C_I2CSR &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;&amp;amp;&lt;/SPAN&gt; MCF_MASK != MCF_MASK)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; // THERE IS A PROBLEM
}
&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;the above code is not working. it's always entering to if condition but the following code is working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;char data = readByte(I2C_DATA);
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;udelay(some_time);

if (&lt;/SPAN&gt;&lt;/CODE&gt;*I2C_I2CSR &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;&amp;amp;&lt;/SPAN&gt; MCF_MASK!= MCF_MASK)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; // THERE IS A PROBLEM
}&lt;/PRE&gt;&lt;P&gt;the above code is alway working and&amp;nbsp; it's not entering to if condition.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2019 12:04:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947973#M2993</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2019-11-07T12:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947974#M2994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MCF bit = 0&amp;nbsp;-&amp;gt; transfer ongoing&lt;/P&gt;&lt;P&gt;MCF bit = 1 -&amp;gt; Transfer done, so your code should be&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;char&lt;/SPAN&gt; data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;readByte&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;I2C_DATA&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; MCF_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;counter&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;100000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; MCF_MASK &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; MCF_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// THERE IS A PROBLEM&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;you also have to keep in mind your CPU speed, for example if you are running at 200MHz and the "while" loop takes 8 cpu cycles(just an example, I don't know for this mcu) counting&amp;nbsp; form 0 to 100000 the wait is only 80 us, which may not be enough.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2019 14:54:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947974#M2994</guid>
      <dc:creator>Ray_V</dc:creator>
      <dc:date>2019-11-07T14:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947975#M2995</link>
      <description>&lt;P&gt;Sorry i wrote the code as wrong. Yes my code is like your example.&lt;/P&gt;&lt;P&gt;i changed timeout value as 1000000 and i also tried it in big value to make sure the problem is not about timeout value and the problem is still same.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 14:15:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947975#M2995</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2021-01-12T14:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947976#M2996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How long is the delay (udelay(some_time);) when it works?&lt;/P&gt;&lt;P&gt;Also, what happens if you remove the counter?&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;char&lt;/SPAN&gt; data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;readByte&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;I2C_DATA&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; MCF_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; MCF_MASK &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; MCF_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// THERE IS A PROBLEM&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2019 15:18:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947976#M2996</guid>
      <dc:creator>Ray_V</dc:creator>
      <dc:date>2019-11-07T15:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947977#M2997</link>
      <description>&lt;P&gt;delay time is 10000 microseconds and when i remove counter the code is frozen because of infinite loop.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 14:17:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947977#M2997</guid>
      <dc:creator>love_hate_and_repeat</dc:creator>
      <dc:date>2021-01-12T14:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: i2c register read back problem</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947978#M2998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about you try this&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;char&lt;/SPAN&gt; data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;readByte&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;I2C_DATA&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;char&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; MCF_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;char&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;I2C_I2CSR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; MCF_MASK &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; MCF_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// THERE IS A PROBLEM&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;By the way, this really should be handled inside the readByte() function so you know the data value is valid, the function should not return until the byte has been read, else the return value is not valid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2019 16:27:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/i2c-register-read-back-problem/m-p/947978#M2998</guid>
      <dc:creator>Ray_V</dc:creator>
      <dc:date>2019-11-07T16:27:39Z</dc:date>
    </item>
  </channel>
</rss>

