<?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: I2C peripherals in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/I2C-peripherals/m-p/933564#M2218</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/rex.liu@sacsys.com.tw"&gt;rex.liu@sacsys.com.tw&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;I suggest you to verify the driver functioning; to do this please use other board to check if the problem persist. If you don't have any other available board you can use I2C0 to interconnect the modules inside the board.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this is helpful.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Omar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Sep 2019 17:46:53 GMT</pubDate>
    <dc:creator>Omar_Anguiano</dc:creator>
    <dc:date>2019-09-10T17:46:53Z</dc:date>
    <item>
      <title>I2C peripherals</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/I2C-peripherals/m-p/933561#M2215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to use i2c peripherals.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MCU : LPC51U68&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Development board : OM40005&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDK :&amp;nbsp;SDK_2.6.0_LPCXpresso51U68.zip&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;when i write data to eeprom and don't "stop" , then read data. it's ok.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;code as below:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (kStatus_Success == I2C_MasterStart(EXAMPLE_I2C_MASTER, I2C_MASTER_SLAVE_ADDR_7BIT, kI2C_Write))&lt;BR /&gt; {&lt;BR /&gt; /* subAddress = 0x01, data = g_master_txBuff - write to slave.&lt;BR /&gt; start + slaveaddress(w) + subAddress + length of data buffer + data buffer + stop*/&lt;BR /&gt; //reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, 0x30, 1, kI2C_TransferNoStopFlag);&lt;BR /&gt; //if (reVal != kStatus_Success)&lt;BR /&gt; //{&lt;BR /&gt; // return -1;&lt;BR /&gt; //}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, g_master_txBuff, 2, kI2C_TransferDefaultFlag);&lt;BR /&gt; if (reVal != kStatus_Success)&lt;BR /&gt; {&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;//reVal = I2C_MasterStop(EXAMPLE_I2C_MASTER);&lt;BR /&gt; //if (reVal != kStatus_Success)&lt;BR /&gt; //{&lt;BR /&gt; // return -1;&lt;BR /&gt; //}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;//GPIO_PinWrite(GPIO, APP_BOARD_TEST_LED_PORT, APP_BOARD_TEST_LED_PIN, 0);&lt;BR /&gt; /* Wait until the slave is ready for transmit, wait time depend on user's case.&lt;BR /&gt; Slave devices that need some time to process received byte or are not ready yet to&lt;BR /&gt; send the next byte, can pull the clock low to signal to the master that it should wait.*/&lt;BR /&gt; for (uint32_t i = 0U; i &amp;lt; WAIT_TIME; i++)&lt;BR /&gt; {&lt;BR /&gt; __NOP();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;//GPIO_PinWrite(GPIO, APP_BOARD_TEST_LED_PORT, APP_BOARD_TEST_LED_PIN, 1);&lt;/P&gt;&lt;P&gt;PRINTF("Receive sent data from slave :");&lt;/P&gt;&lt;P&gt;/* Receive blocking data from slave */&lt;BR /&gt; /* subAddress = 0x01, data = g_master_rxBuff - read from slave.&lt;BR /&gt; start + slaveaddress(w) + subAddress + repeated start + slaveaddress(r) + rx data buffer + stop */&lt;BR /&gt; if (kStatus_Success == I2C_MasterStart(EXAMPLE_I2C_MASTER, I2C_MASTER_SLAVE_ADDR_7BIT, kI2C_Write))&lt;BR /&gt; {&lt;BR /&gt; //reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, 0x30, 1, kI2C_TransferNoStopFlag);&lt;BR /&gt; //if (reVal != kStatus_Success)&lt;BR /&gt; //{&lt;BR /&gt; // return -1;&lt;BR /&gt; //}&lt;/P&gt;&lt;P&gt;reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, g_master_txBuff, 1, kI2C_TransferDefaultFlag);&lt;BR /&gt; if (reVal != kStatus_Success)&lt;BR /&gt; {&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;reVal = I2C_MasterRepeatedStart(EXAMPLE_I2C_MASTER, I2C_MASTER_SLAVE_ADDR_7BIT, kI2C_Read);&lt;BR /&gt; if (reVal != kStatus_Success)&lt;BR /&gt; {&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;reVal = I2C_MasterReadBlocking(EXAMPLE_I2C_MASTER, g_master_rxBuff, 1, kI2C_TransferDefaultFlag);&lt;BR /&gt; if (reVal != kStatus_Success)&lt;BR /&gt; {&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;reVal = I2C_MasterStop(EXAMPLE_I2C_MASTER);&lt;BR /&gt; if (reVal != kStatus_Success)&lt;BR /&gt; {&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;but&amp;nbsp;&amp;nbsp;i write data to eeprom and don't "stop" , then write data again. it's fail.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;code as below:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (kStatus_Success == I2C_MasterStart(EXAMPLE_I2C_MASTER, I2C_MASTER_SLAVE_ADDR_7BIT, kI2C_Write))&lt;BR /&gt; {&lt;BR /&gt; /* subAddress = 0x01, data = g_master_txBuff - write to slave.&lt;BR /&gt; start + slaveaddress(w) + subAddress + length of data buffer + data buffer + stop*/&lt;BR /&gt; //reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, 0x30, 1, kI2C_TransferNoStopFlag);&lt;BR /&gt; //if (reVal != kStatus_Success)&lt;BR /&gt; //{&lt;BR /&gt; // return -1;&lt;BR /&gt; //}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, t_master_txBuff, 2, kI2C_TransferDefaultFlag);&lt;BR /&gt; if (reVal != kStatus_Success)&lt;BR /&gt; {&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;//reVal = I2C_MasterStop(EXAMPLE_I2C_MASTER);&lt;BR /&gt; //if (reVal != kStatus_Success)&lt;BR /&gt; //{&lt;BR /&gt; // return -1;&lt;BR /&gt; //}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;for (uint32_t i = 0U; i &amp;lt; WAIT_TIME; i++)&lt;BR /&gt; {&lt;BR /&gt; __NOP();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if (kStatus_Success == I2C_MasterStart(EXAMPLE_I2C_MASTER, I2C_MASTER_SLAVE_ADDR_7BIT, kI2C_Write))&lt;BR /&gt; {&lt;BR /&gt; /* subAddress = 0x01, data = g_master_txBuff - write to slave.&lt;BR /&gt; start + slaveaddress(w) + subAddress + length of data buffer + data buffer + stop*/&lt;BR /&gt; //reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, 0x30, 1, kI2C_TransferNoStopFlag);&lt;BR /&gt; //if (reVal != kStatus_Success)&lt;BR /&gt; //{&lt;BR /&gt; // return -1;&lt;BR /&gt; //}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, r_master_txBuff, 2, kI2C_TransferDefaultFlag);&lt;BR /&gt; if (reVal != kStatus_Success)&lt;BR /&gt; {&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;//reVal = I2C_MasterStop(EXAMPLE_I2C_MASTER);&lt;BR /&gt; //if (reVal != kStatus_Success)&lt;BR /&gt; //{&lt;BR /&gt; // return -1;&lt;BR /&gt; //}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;for (uint32_t i = 0U; i &amp;lt; WAIT_TIME; i++)&lt;BR /&gt; {&lt;BR /&gt; __NOP();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;At the beginning of each action, there is a stop command.&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;When the instrument is used,&lt;/STRONG&gt;&lt;/EM&gt; &lt;EM&gt;&lt;STRONG&gt;there is a stop condition.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;However, after the experiment,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;it is found that there is no stop to finish reading.&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;However, if there is no stop command,&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;the data cannot be written and written again.&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;I confirm the temporary The value of the register is also correct.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;another one.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;when program run to "I2C_MasterWriteBlocking" funtion.&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;in this function, code will run to "base-&amp;gt;MSTCTL = I2C_MSTCTL_MSTSTOP_MASK;"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;that means it will have stop command. in the logic-analyzer, stop command can be saw.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if add&amp;nbsp;&amp;nbsp;"I2C_MasterStop" function. there is twice stop command.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="stop.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87627i5AE4B1F827AF5282/image-size/large?v=v2&amp;amp;px=999" role="button" title="stop.png" alt="stop.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Please help&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;experts.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Rex Liu&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2019 09:35:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/I2C-peripherals/m-p/933561#M2215</guid>
      <dc:creator>rex_liu</dc:creator>
      <dc:date>2019-09-02T09:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: I2C peripherals</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/I2C-peripherals/m-p/933562#M2216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rex Liu&lt;/P&gt;&lt;P&gt;Can you tell which device are you using to receive?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2019 15:52:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/I2C-peripherals/m-p/933562#M2216</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2019-09-04T15:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: I2C peripherals</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/I2C-peripherals/m-p/933563#M2217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="343210" data-username="nxf54944" href="https://community.nxp.com/people/nxf54944" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 200; text-decoration: none; font-size: 1.286rem;"&gt;Omar Anguiano&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Device : Atmel eeprom - AT24C02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Rex Liu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2019 01:08:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/I2C-peripherals/m-p/933563#M2217</guid>
      <dc:creator>rex_liu</dc:creator>
      <dc:date>2019-09-05T01:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: I2C peripherals</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/I2C-peripherals/m-p/933564#M2218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/rex.liu@sacsys.com.tw"&gt;rex.liu@sacsys.com.tw&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;I suggest you to verify the driver functioning; to do this please use other board to check if the problem persist. If you don't have any other available board you can use I2C0 to interconnect the modules inside the board.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this is helpful.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Omar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2019 17:46:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/I2C-peripherals/m-p/933564#M2218</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2019-09-10T17:46:53Z</dc:date>
    </item>
  </channel>
</rss>

