<?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: KL25z I2C two bytes reading</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25z-I2C-two-bytes-reading/m-p/256826#M7622</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that, but it did not help, i need to understand the code. The routine in the figure is clear, but how to programm, thats the real &lt;A href="http://www.dict.cc/englisch-deutsch/challenge.html" style="color: black; font-size: 13px; background-color: #eeeeee;" title="frequency: 1664"&gt;challenge. Its unclear where to set and unset acknowledge&lt;/A&gt; and where to read the two bytes, both after&amp;nbsp; i2c_stop(I2C0_B)?. It would help a lot if someone could explain the code and set it to read two bytes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 26 Jan 2014 03:08:18 GMT</pubDate>
    <dc:creator>asdasdaram</dc:creator>
    <dc:date>2014-01-26T03:08:18Z</dc:date>
    <item>
      <title>KL25z I2C two bytes reading</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25z-I2C-two-bytes-reading/m-p/256824#M7620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, how would a baremetal code of reading two bytes with I2c from a sensor look like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code ist from twr-kl25Demo and reads one byte. How i could read the 2. byte. The Sensor just excect an Acknowledge after the first byte, but how to integrade that in the code below. I Also dont understand why theres &lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;i2c_give_nack(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt; after &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt; i2c_get_ack(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt; i2c_set_rx_mode(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and why there is a reading after i2c_stop. Could someone Comment this pls. Thanks a lot&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;uint8 result;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_start(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_write_byte(I2C0_B, MMA8451_I2C_ADDRESS | I2C_WRITE);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_wait(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_get_ack(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_write_byte(I2C0_B, addr);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_wait(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_get_ack(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_repeated_start(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_write_byte(I2C0_B, MMA8451_I2C_ADDRESS | I2C_READ);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_wait(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_get_ack(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_set_rx_mode(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_give_nack(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = i2c_read_byte(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_wait(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_stop(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = i2c_read_byte(I2C0_B);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pause();&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2014 01:54:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25z-I2C-two-bytes-reading/m-p/256824#M7620</guid>
      <dc:creator>asdasdaram</dc:creator>
      <dc:date>2014-01-25T01:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: KL25z I2C two bytes reading</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25z-I2C-two-bytes-reading/m-p/256825#M7621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi asdasd aram&lt;/P&gt;&lt;P&gt;I think you can refer the Typical I2C interrupt routine in KL25P80M48SF0RM.pdf&lt;/P&gt;&lt;P&gt;See below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Typical I2C interrupt routine.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/41341iB57FBD86E5AE90EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Typical I2C interrupt routine.jpg" alt="Typical I2C interrupt routine.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that help.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Jan 2014 01:10:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25z-I2C-two-bytes-reading/m-p/256825#M7621</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2014-01-26T01:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: KL25z I2C two bytes reading</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25z-I2C-two-bytes-reading/m-p/256826#M7622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that, but it did not help, i need to understand the code. The routine in the figure is clear, but how to programm, thats the real &lt;A href="http://www.dict.cc/englisch-deutsch/challenge.html" style="color: black; font-size: 13px; background-color: #eeeeee;" title="frequency: 1664"&gt;challenge. Its unclear where to set and unset acknowledge&lt;/A&gt; and where to read the two bytes, both after&amp;nbsp; i2c_stop(I2C0_B)?. It would help a lot if someone could explain the code and set it to read two bytes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Jan 2014 03:08:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25z-I2C-two-bytes-reading/m-p/256826#M7622</guid>
      <dc:creator>asdasdaram</dc:creator>
      <dc:date>2014-01-26T03:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: KL25z I2C two bytes reading</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25z-I2C-two-bytes-reading/m-p/256827#M7623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi asdasd aram,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please see my reply in your another tip:&lt;A _jive_internal="true" href="https://community.nxp.com/thread/318549" title="https://community.freescale.com/thread/318549"&gt;https://community.freescale.com/thread/318549&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I wish it useful to you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you still have question, please let me know!&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;P&gt;Jing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 05:19:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25z-I2C-two-bytes-reading/m-p/256827#M7623</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2014-01-27T05:19:11Z</dc:date>
    </item>
  </channel>
</rss>

