<?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>LPC MicrocontrollersのトピックRe: LPC54628 I2C polling master example code not quite right.</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-I2C-polling-master-example-code-not-quite-right/m-p/807286#M32413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are checking with the latest version of &lt;A href="https://mcuxpresso.nxp.com/en/dashboard"&gt;MCUXpresso SDK&lt;/A&gt; for LPCXpresso54628?&lt;/P&gt;&lt;P&gt;The latest version is V2.4.1&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/75994iDDF71C324F11CFF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't find your mentioned code issue at &amp;lt;i2c_polling_b2b_transfer_master.c&amp;gt; file:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76047iA27F1E1DB30B723C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&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, 22 Oct 2018 05:36:59 GMT</pubDate>
    <dc:creator>Hui_Ma</dc:creator>
    <dc:date>2018-10-22T05:36:59Z</dc:date>
    <item>
      <title>LPC54628 I2C polling master example code not quite right.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-I2C-polling-master-example-code-not-quite-right/m-p/807285#M32412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone look at the examples and wonder what's going on?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it be too hard to ask for working examples?&amp;nbsp; I know, they're "examples".&amp;nbsp; But this one is a lulu.&amp;nbsp; It couldn't ever have worked, not as is.&amp;nbsp; Maybe this is one of their training examples where students are asked "to find the bugs" and answers deliberately aren't incorporated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The block of code below is from i2c_polling_b2b_transfer_master.c.&amp;nbsp; Take a look at the usage of I2C_MasterWriteBlocking(); the two lines are marked with "&amp;lt;==HERE".&amp;nbsp; In the first instance, the address of uint8_t deviceAddress is passed.&amp;nbsp; In the second instance, the address of the data buffer to transmit is passed.&amp;nbsp; The compiler is told to expect a const void * so the compiler doesn't "squeak".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had one job: to get FLEXComm8 talking to a resistive touch screen controller via i2c.&amp;nbsp; By the next morning.&amp;nbsp; Because of the time constraint, my thought was to use an example and build from that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NXP + Murphy paid a visit to the SDK creators: the example doesn't work.&amp;nbsp; Looks like a cut-and-paste from somewhere else.&amp;nbsp; Now I'm on the market, looking for work..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't recommend NXP products.&amp;nbsp; Not any more.&amp;nbsp; I can't afford the time to investigate boobytraps.&amp;nbsp; Guys, time-to-market is ever decreasing.&amp;nbsp; Please understand that your customers aren't supposed to be beta test sites, not for stuff like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking for work in the Eastern Massachusetts area...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;============================================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Send master blocking data to slave */&lt;BR /&gt;if (kStatus_Success == I2C_MasterStart(EXAMPLE_I2C_MASTER, I2C_MASTER_SLAVE_ADDR_7BIT, kI2C_Write)) &lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* subAddress = 0x01, data = g_master_txBuff - write to slave.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; start + slaveaddress(w) + subAddress + length of data buffer + data buffer + stop*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, &amp;amp;deviceAddress, 1, kI2C_TransferNoStopFlag);&amp;nbsp;&amp;nbsp; &amp;lt;== HERE&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (reVal != kStatus_Success)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return -1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; reVal = I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, g_master_txBuff, I2C_DATA_LENGTH, 0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;== HERE&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (reVal != kStatus_Success)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return -1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; reVal = I2C_MasterStop(EXAMPLE_I2C_MASTER);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2018 20:52:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-I2C-polling-master-example-code-not-quite-right/m-p/807285#M32412</guid>
      <dc:creator>walkingthrough</dc:creator>
      <dc:date>2018-10-18T20:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54628 I2C polling master example code not quite right.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-I2C-polling-master-example-code-not-quite-right/m-p/807286#M32413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are checking with the latest version of &lt;A href="https://mcuxpresso.nxp.com/en/dashboard"&gt;MCUXpresso SDK&lt;/A&gt; for LPCXpresso54628?&lt;/P&gt;&lt;P&gt;The latest version is V2.4.1&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/75994iDDF71C324F11CFF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't find your mentioned code issue at &amp;lt;i2c_polling_b2b_transfer_master.c&amp;gt; file:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76047iA27F1E1DB30B723C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&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, 22 Oct 2018 05:36:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-I2C-polling-master-example-code-not-quite-right/m-p/807286#M32413</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-10-22T05:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54628 I2C polling master example code not quite right.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-I2C-polling-master-example-code-not-quite-right/m-p/807287#M32414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SDK 2.4.1 is what sourced the i2c example I was upset at last week.&amp;nbsp; Also dated 2018-06-18.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the left side of MCUXpresso IDE see the "Create or Import a project".&amp;nbsp; Select "Import SDK example(s)..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have only one SDK installed, that for the 54628.&amp;nbsp; I left-click the image to select the board then left-click "Next".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a number of examples listed in the lower half-pane.&amp;nbsp; Open "driver_examples" and select "i2c".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fifth example is "i2c_polling_b2b_transfer_master" and so I select that by setting the checkbox.&amp;nbsp; To avoid a project collision, I change the prefix to "BOARD_" (that's at top left).&amp;nbsp; Then click Finish.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IDE runs... and I now have a project named "BOARD_i2c_polling_b2b_transfer_master".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open the project then open the source folder.&amp;nbsp; There is "i2c_polling_b2b_transfer_master.c"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open "i2c_polling_b2b_transfer_master.c" and scroll down to line 131.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, what does this program do?&amp;nbsp; It sends a block of data, receives a block of data, compares the two, and hangs at the while-loop at line 200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Okay.&amp;nbsp; Line 131 contains the call to I2C_MasterStart.().&amp;nbsp; Hm.&amp;nbsp; See below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lines 135 and 140 contain the calls to I2C_MasterWriteBlocking.&amp;nbsp; I believe Line 135 calls the wrong function... because deviceAddress contains the i2c address of the slave and &amp;amp;deviceAddress is the address of a memory location containing the slave's address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the documentation (you can see it via hovering the cursor) says that the second argument is a pointer to the data to be transferred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line 140 passes supplies the address of the buffer to be transmitted.&amp;nbsp; That's correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is Line 131 doing?&amp;nbsp; Line 131 takes the I2C reference, something called "I2C_MASTER_SLAVE_ADDR_7BIT", and the last argument is kI2C_Write.&amp;nbsp; I2C_MASTER_SLAVE_ADDR_7BIT is a symbol with value 0x7EU.&amp;nbsp; I thought that address reserved.for future purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before my end, I did get an I2C transfer running.&amp;nbsp; I'm writing this from memory.. but I do remember that an attached oscilloscope showed the I2C bus handshake between master and slave.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C_MasterStart(EXAMPLE_I2C_MASTER, deviceAddress, kI2C_Write);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set slave address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C_MasterWriteBlocking(EXAMPLE_I2C_MASTER, g_master_txBuff, I2C_DATA_LENGTH, 0);&amp;nbsp; // Start transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I2C_MasterStop(EXAMPLE_I2C_MASTER);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // End transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All three functions are in fsl_i2c.h .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All this was with SDK 2.4.1 dated 2018-06-18.&amp;nbsp; That's what was available Monday, October 15th.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==============&lt;/P&gt;&lt;P&gt;My apologies to the user community for the tone of my writing last week.&amp;nbsp; I'd used similar-named routines on other devices, discounted that because, well, this is an NXP device, and went with what was in front of me rather than dig into the provided code.&amp;nbsp; A "tight-schedule-hope-it-works" situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2018 23:00:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-I2C-polling-master-example-code-not-quite-right/m-p/807287#M32414</guid>
      <dc:creator>walkingthrough</dc:creator>
      <dc:date>2018-10-22T23:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54628 I2C polling master example code not quite right.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-I2C-polling-master-example-code-not-quite-right/m-p/807288#M32415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed your posted steps and import the i2c_polling_b2b_transfer_master project.&lt;/P&gt;&lt;P&gt;I don't find there with any strange code at &amp;lt;i2c_polling_b2b_transfer_master.c&amp;gt; file:&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/76739iAA551C48B1CEDB19/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The actual I2C master will transfer below signals:&lt;/P&gt;&lt;P&gt;start + slaveaddress(w) + subAddress + length of data buffer + data buffer + stop&lt;/P&gt;&lt;P&gt;line131: I2C master transfer start + slaveaddress(w)&lt;/P&gt;&lt;P&gt;line135: I2C master transfer subAddress&lt;/P&gt;&lt;P&gt;line140: I2C master transfer length of data buffer + data buffer + stop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check below I2C signal for the detailed info:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76894iB18CB976E99FCE96/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The MCUXpresso SDK server was maintained last week, I am not sure if that cause the problem code generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&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>Wed, 24 Oct 2018 03:04:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-I2C-polling-master-example-code-not-quite-right/m-p/807288#M32415</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-10-24T03:04:24Z</dc:date>
    </item>
  </channel>
</rss>

