<?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>MCUXpresso IDEのトピックRe: Using I2C with CMSIS</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/Using-I2C-with-CMSIS/m-p/750099#M1707</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/Alice_Yang" rel="noopener noreferrer" target="_blank"&gt;Alice_Yang&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use CMSIS library and I am trying to write a basic code fusing with two example code which are cmsis_lpi2c_edma_b2b_transfer_master under CMSIS examples and the one you attached. I realized I am checking the busy status in a wrong way.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background-color: #f5f5f5; border: 1px solid #cccccc; font-size: 9pt; margin: 4px 8px 4px 2px; padding: 4px 6px;"&gt;while(!ARM_I2C_EVENT_TRANSFER_DONE)
{}
while(EXAMPLE_I2C_MASTER.GetStatus().busy)
{}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I need to check for&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background-color: #f5f5f5; border: 1px solid #cccccc; font-size: 9pt; margin: 4px 8px 4px 2px; padding: 4px 6px;"&gt;while(!g_masterCompletionFlag)
{}&lt;/PRE&gt;&lt;P&gt;which is set upon a completion event. That is used in the CMSIS example of I2C.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One other thing, after calling --.MasterRecieve function I need to wait for busy flag:&lt;/P&gt;&lt;PRE class="" style="color: #000000; background-color: #f5f5f5; border: 1px solid #cccccc; font-size: 9pt; margin: 4px 8px 4px 2px; padding: 4px 6px;"&gt;EXAMPLE_I2C_MASTER.GetStatus().busy&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well the main point I am struggling is the examples are too complicated for a simple I2C operation. A single write or read operation is declared in 2-3 functions concatenated. I am familiar with assembly language but it become confusing for debugging these high level example codes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am working on reading sensor data using again CMSIS libraries. I have still some problems but I am working on them &lt;IMG alt="Smiley Happy" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="https://community.nxp.com/i/smilies/16x16_smiley-happy.png" title="Smiley Happy" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I feel desperate I will ask for your help again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Onur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2020 14:05:16 GMT</pubDate>
    <dc:creator>onurdemirel</dc:creator>
    <dc:date>2020-11-02T14:05:16Z</dc:date>
    <item>
      <title>Using I2C with CMSIS</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Using-I2C-with-CMSIS/m-p/750097#M1705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am learning about CMSIS functions and started with I2C application. I have some issues that I couldn't overcome. I stucked at the beginning.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using TWR-KE18F board with MCUXpresso IDE and SDK2.0. I am trying to reach the WhoAmI register of onboard accelerometer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my piece of example code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background-color: #f5f5f5; border: 1px solid #cccccc; font-size: 9pt; margin: 4px 8px 4px 2px; padding: 4px 6px;"&gt;EXAMPLE_I2C_MASTER.Initialize(lpi2c_master_callback);
EXAMPLE_I2C_MASTER.PowerControl(ARM_POWER_FULL);
EXAMPLE_I2C_MASTER.Control(ARM_I2C_BUS_SPEED,ARM_I2C_BUS_SPEED_STANDARD);

g_master_txBuff[0] = 0x0D;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//WhoAmI register = 0x0D
EXAMPLE_I2C_MASTER.MasterTransmit(SLAVE_ADR,g_master_txBuff,1,true);

while(!ARM_I2C_EVENT_TRANSFER_DONE)
{}
while(EXAMPLE_I2C_MASTER.GetStatus().busy)
{}

EXAMPLE_I2C_MASTER.MasterReceive(SLAVE_ADR,g_master_rxBuff,1,false);

PRINTF("0x%2x", g_master_rxBuff[0]);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I see 0xff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said I am new to this topic and any help will be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Onur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2018 06:48:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Using-I2C-with-CMSIS/m-p/750097#M1705</guid>
      <dc:creator>onurdemirel</dc:creator>
      <dc:date>2018-06-05T06:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using I2C with CMSIS</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Using-I2C-with-CMSIS/m-p/750098#M1706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="319273" data-username="onurdemirel" href="https://community.nxp.com/people/onurdemirel"&gt;Onur Demirel&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;I&amp;nbsp; recommend you first have a look at the demo "read_accel_value_transfer" under SDK&amp;nbsp; (SDK_2.3.0_TWR-KE18F\boards\twrke18f\driver_examples\lpi2c\read_accel_value_transfer),&lt;/P&gt;&lt;P&gt;there is a function about read Who AM I register of FXOS8700 on board :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/7580i7ED13543CC8B30FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;BR /&gt;also the readme.txt tell you how to run this demo on your TWR-KE18F board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&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;BR /&gt;Have a great day,&lt;BR /&gt;TIC&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>Tue, 05 Jun 2018 08:36:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Using-I2C-with-CMSIS/m-p/750098#M1706</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2018-06-05T08:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using I2C with CMSIS</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Using-I2C-with-CMSIS/m-p/750099#M1707</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/Alice_Yang" rel="noopener noreferrer" target="_blank"&gt;Alice_Yang&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use CMSIS library and I am trying to write a basic code fusing with two example code which are cmsis_lpi2c_edma_b2b_transfer_master under CMSIS examples and the one you attached. I realized I am checking the busy status in a wrong way.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background-color: #f5f5f5; border: 1px solid #cccccc; font-size: 9pt; margin: 4px 8px 4px 2px; padding: 4px 6px;"&gt;while(!ARM_I2C_EVENT_TRANSFER_DONE)
{}
while(EXAMPLE_I2C_MASTER.GetStatus().busy)
{}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I need to check for&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background-color: #f5f5f5; border: 1px solid #cccccc; font-size: 9pt; margin: 4px 8px 4px 2px; padding: 4px 6px;"&gt;while(!g_masterCompletionFlag)
{}&lt;/PRE&gt;&lt;P&gt;which is set upon a completion event. That is used in the CMSIS example of I2C.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One other thing, after calling --.MasterRecieve function I need to wait for busy flag:&lt;/P&gt;&lt;PRE class="" style="color: #000000; background-color: #f5f5f5; border: 1px solid #cccccc; font-size: 9pt; margin: 4px 8px 4px 2px; padding: 4px 6px;"&gt;EXAMPLE_I2C_MASTER.GetStatus().busy&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well the main point I am struggling is the examples are too complicated for a simple I2C operation. A single write or read operation is declared in 2-3 functions concatenated. I am familiar with assembly language but it become confusing for debugging these high level example codes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am working on reading sensor data using again CMSIS libraries. I have still some problems but I am working on them &lt;IMG alt="Smiley Happy" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="https://community.nxp.com/i/smilies/16x16_smiley-happy.png" title="Smiley Happy" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I feel desperate I will ask for your help again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Onur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:05:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Using-I2C-with-CMSIS/m-p/750099#M1707</guid>
      <dc:creator>onurdemirel</dc:creator>
      <dc:date>2020-11-02T14:05:16Z</dc:date>
    </item>
  </channel>
</rss>

