<?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: LPC5410x i2c read from register in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5410x-i2c-read-from-register/m-p/588503#M21824</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;The &lt;A href="http://www.nxp.com/products/software-and-tools/hardware-development-tools/lpcxpresso-boards/lpcopen-software-development-platform-lpc5410x:LPCOPEN-SOFTWARE-FOR-LPC5410X"&gt;LPCOpen software for LPC5410x chip&lt;/A&gt; provides the I2C master demo, which located at below folder:&lt;/P&gt;&lt;P&gt;..\lpc5410x_lpcxpresso_54102_keil_iar_3.01.000_9\lpc5410x\prj_lpcxpresso_54102\iar&lt;/P&gt;&lt;P&gt;There shows how to use read data from 3-axis accelerometer (Bosch BMC150) with I2C bus.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ma Hui&lt;BR /&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>Fri, 09 Sep 2016 06:58:07 GMT</pubDate>
    <dc:creator>Hui_Ma</dc:creator>
    <dc:date>2016-09-09T06:58:07Z</dc:date>
    <item>
      <title>LPC5410x i2c read from register</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5410x-i2c-read-from-register/m-p/588502#M21823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have problems trying to read specific register from i2c device. First I transmit address and register to request reading from device, but when I try to send start (repeated start) it still expects new TX data.. I am not sure what should I send to specify I want to read now...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the sample code I am trying to use:&lt;/P&gt;&lt;P style="color: #931a68; font-size: 11px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 15px;"&gt;if&lt;SPAN style="color: #000000;"&gt; (!&lt;/SPAN&gt;&lt;SPAN style="color: #793d93;"&gt;waitForState&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #006141;"&gt;MasterStates&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;::&lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;Idle&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) &lt;/SPAN&gt;return&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;false&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #0326cc; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;m_peripheral&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;MSTDAT&lt;SPAN style="color: #000000;"&gt; = &lt;/SPAN&gt;m_address&lt;SPAN style="color: #000000;"&gt;; //send address of slave and set start&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #0326cc; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;m_peripheral&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;MSTCTL&lt;SPAN style="color: #000000;"&gt; = MSTSTART;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #931a68; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;if&lt;SPAN style="color: #000000;"&gt; (!&lt;/SPAN&gt;&lt;SPAN style="color: #793d93;"&gt;waitForState&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #006141;"&gt;MasterStates&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;::&lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;TxRdy&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) &lt;/SPAN&gt;return&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;false&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #0326cc; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;m_peripheral&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;MSTDAT&lt;SPAN style="color: #000000;"&gt; = a_reg; &amp;nbsp;// send address of register i want to read and send continue&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;m_peripheral&lt;/SPAN&gt;-&amp;gt;&lt;SPAN style="color: #0326cc;"&gt;MSTCTL&lt;/SPAN&gt; = MSTCONTINUE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #931a68; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;if&lt;SPAN style="color: #000000;"&gt; (!&lt;/SPAN&gt;&lt;SPAN style="color: #793d93;"&gt;waitForState&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #006141;"&gt;MasterStates&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;::&lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;TxRdy&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) &lt;/SPAN&gt;return&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;false&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 11px;"&gt;&lt;/P&gt;&lt;P style="color: #0326cc; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;m_peripheral&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;MSTDAT&lt;SPAN style="color: #000000;"&gt; = &lt;/SPAN&gt;m_address&lt;SPAN style="color: #000000;"&gt; | 1; &amp;nbsp;//set read flag on address and send start (i hoped it would be repeated start)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #0326cc; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;m_peripheral&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;MSTCTL&lt;SPAN style="color: #000000;"&gt; = MSTSTART;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #931a68; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;if&lt;SPAN style="color: #000000;"&gt; (!&lt;/SPAN&gt;&lt;SPAN style="color: #793d93;"&gt;waitForState&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #006141;"&gt;MasterStates&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;::&lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;RxRdy&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) &lt;/SPAN&gt;return&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;false&lt;SPAN style="color: #000000;"&gt;; &amp;nbsp;//&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;--- this is where I still get TxRdy instead of RxRdy&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #0326cc; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;tmp = &lt;/SPAN&gt;m_peripheral&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;MSTDAT&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #0326cc; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;m_peripheral&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;MSTCTL&lt;SPAN style="color: #000000;"&gt; = MSTSTOP;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #931a68; font-size: 11px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;if&lt;SPAN style="color: #000000;"&gt; (!&lt;/SPAN&gt;&lt;SPAN style="color: #793d93;"&gt;waitForState&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #006141;"&gt;MasterStates&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;::&lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;Idle&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)) &lt;/SPAN&gt;return&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;false&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #931a68; font-size: 11px;"&gt;&lt;/P&gt;&lt;P style="color: #931a68; font-size: 11px;"&gt;&lt;SPAN style="color: #000000; font-size: 15px;"&gt;So what should I set after sending the address of register i want to read ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #931a68; font-size: 11px;"&gt;&lt;/P&gt;&lt;P style="color: #931a68; font-size: 11px;"&gt;&lt;SPAN style="color: #000000; font-size: 15px;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Sep 2016 16:58:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5410x-i2c-read-from-register/m-p/588502#M21823</guid>
      <dc:creator>gossamer69</dc:creator>
      <dc:date>2016-09-04T16:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: LPC5410x i2c read from register</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5410x-i2c-read-from-register/m-p/588503#M21824</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;The &lt;A href="http://www.nxp.com/products/software-and-tools/hardware-development-tools/lpcxpresso-boards/lpcopen-software-development-platform-lpc5410x:LPCOPEN-SOFTWARE-FOR-LPC5410X"&gt;LPCOpen software for LPC5410x chip&lt;/A&gt; provides the I2C master demo, which located at below folder:&lt;/P&gt;&lt;P&gt;..\lpc5410x_lpcxpresso_54102_keil_iar_3.01.000_9\lpc5410x\prj_lpcxpresso_54102\iar&lt;/P&gt;&lt;P&gt;There shows how to use read data from 3-axis accelerometer (Bosch BMC150) with I2C bus.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ma Hui&lt;BR /&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>Fri, 09 Sep 2016 06:58:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5410x-i2c-read-from-register/m-p/588503#M21824</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2016-09-09T06:58:07Z</dc:date>
    </item>
  </channel>
</rss>

