<?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: KL26Z i2c problem - IICIF flag.</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26Z-i2c-problem-IICIF-flag/m-p/704677#M43262</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Arkadiusz Motyka,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; About the I2C code for KL26, I highly recommend you to use our KSDK sample code directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can download KSDK2.2_FRDM-KL26 from this link:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://mcuxpresso.nxp.com/en/welcome" title="https://mcuxpresso.nxp.com/en/welcome"&gt;Welcome to MCUXpresso | MCUXpresso Config Tools&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Click SDK Builder, then choose the board as FRDM-KL26, generate the code and download it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;You can find the official I2C code in folder: SDK_2.2_FRDM-KL26Z\boards\frdmkl26z\driver_examples\i2c&lt;/P&gt;&lt;P&gt;Please try official code at first.&lt;/P&gt;&lt;P&gt;If you still have question about it, please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&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>Mon, 28 Aug 2017 06:40:31 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2017-08-28T06:40:31Z</dc:date>
    <item>
      <title>KL26Z i2c problem - IICIF flag.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26Z-i2c-problem-IICIF-flag/m-p/704675#M43260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly I want to apologise for my English, it's not my native language.&lt;/P&gt;&lt;P&gt;I'm using KL26Z128VLH4 processor and I want to start i2c module. The code hangs while waiting for IICIF flag. I tried with Processor Expert and without, with different CPU speed, with different GPIO. The best, my friend have got the same issue with KL46Z.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is code I'm using:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;void InitI2C(void){&lt;BR /&gt; SIM_BASE_PTR-&amp;gt;SCGC5 |= SIM_SCGC5_PORTB_MASK; // clock for port&amp;nbsp;B&lt;BR /&gt; SIM_BASE_PTR-&amp;gt;SCGC4 |= SIM_SCGC4_I2C0_MASK; // clock for&amp;nbsp;&amp;nbsp;I2C0&lt;BR /&gt; &lt;BR /&gt; PORTB_BASE_PTR-&amp;gt;PCR[0] = PORT_PCR_MUX(1UL&amp;lt;&amp;lt;2); //PTB0 I2C0 SCL&lt;BR /&gt; PORTB_BASE_PTR-&amp;gt;PCR[1] = PORT_PCR_MUX(1UL&amp;lt;&amp;lt;2); //PTB1 I2C0 SDA&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; I2C0_BASE_PTR-&amp;gt;F = 0x14; // baudrate: 300kHz&lt;BR /&gt; I2C0_BASE_PTR-&amp;gt;C1 |= I2C_C1_IICEN_MASK; // enable&amp;nbsp;I2C0&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;uint8_t BusyI2C(void){&lt;BR /&gt; while((I2C0_BASE_PTR-&amp;gt;S &amp;amp; I2C_S_IICIF_MASK)==0){} //here program hangs&lt;BR /&gt; if(I2C0_BASE_PTR-&amp;gt;S &amp;amp; I2C_S_RXAK_MASK){return 0;}&lt;BR /&gt; I2C0_BASE_PTR-&amp;gt;S |= I2C_S_IICIF_MASK; //&amp;nbsp;reset IICIF&lt;BR /&gt; return 1;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for help :smileylaugh:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 15:58:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26Z-i2c-problem-IICIF-flag/m-p/704675#M43260</guid>
      <dc:creator>arkadiuszmotyka</dc:creator>
      <dc:date>2017-08-22T15:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: KL26Z i2c problem - IICIF flag.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26Z-i2c-problem-IICIF-flag/m-p/704676#M43261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ohhh I forgot about Read function, where Busy function is used:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;uint8_t ReadRegisterI2C(uint8_t adres){&lt;BR /&gt; uint8_t dane=0;&lt;BR /&gt; EnableI2C();&lt;BR /&gt; SendModeI2C();&lt;BR /&gt; MasterModeI2C();&lt;BR /&gt; SendByteI2C(ADXL375_WRITE_ADDR); //adres slave&lt;BR /&gt; BusyI2C();&lt;BR /&gt; SendByteI2C(adres);&amp;nbsp;&lt;BR /&gt; BusyI2C();&lt;BR /&gt; SendRestartI2C();&lt;BR /&gt; SendByteI2C(ADXL375_READ_ADDR);&lt;BR /&gt; BusyI2C();&lt;BR /&gt; ReceiveModeI2C();&lt;BR /&gt; DisableAckI2C();&lt;BR /&gt; dane=ReadByteI2C();&lt;BR /&gt; BusyI2C();&lt;BR /&gt; SlaveModeI2C();&lt;BR /&gt; ReceiveModeI2C();&lt;BR /&gt; dane=ReadByteI2C();&lt;BR /&gt; DisableI2C();&lt;BR /&gt; return dane;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 16:01:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26Z-i2c-problem-IICIF-flag/m-p/704676#M43261</guid>
      <dc:creator>arkadiuszmotyka</dc:creator>
      <dc:date>2017-08-22T16:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: KL26Z i2c problem - IICIF flag.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26Z-i2c-problem-IICIF-flag/m-p/704677#M43262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Arkadiusz Motyka,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; About the I2C code for KL26, I highly recommend you to use our KSDK sample code directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can download KSDK2.2_FRDM-KL26 from this link:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://mcuxpresso.nxp.com/en/welcome" title="https://mcuxpresso.nxp.com/en/welcome"&gt;Welcome to MCUXpresso | MCUXpresso Config Tools&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Click SDK Builder, then choose the board as FRDM-KL26, generate the code and download it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;You can find the official I2C code in folder: SDK_2.2_FRDM-KL26Z\boards\frdmkl26z\driver_examples\i2c&lt;/P&gt;&lt;P&gt;Please try official code at first.&lt;/P&gt;&lt;P&gt;If you still have question about it, please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&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>Mon, 28 Aug 2017 06:40:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL26Z-i2c-problem-IICIF-flag/m-p/704677#M43262</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-08-28T06:40:31Z</dc:date>
    </item>
  </channel>
</rss>

