<?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: FRDM-KL46Z I2C Accelerometer</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL46Z-I2C-Accelerometer/m-p/438893#M25650</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;You need to configure and start the accelerometer.&lt;/P&gt;&lt;P&gt;Please refer to its data sheet for all details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&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, 18 Jan 2016 12:14:27 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2016-01-18T12:14:27Z</dc:date>
    <item>
      <title>FRDM-KL46Z I2C Accelerometer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL46Z-I2C-Accelerometer/m-p/438890#M25647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Hi Everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make an accelerometer application using built-in MMA8451Q module on FRDM-KL46Z board. I am using Keil uVision editor. It's something new to me so please be patient &lt;SPAN aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My problem starts with I2C communication. I am trying to read a value from WHO_AM_I register but I always receive the WHO_AM_I address - not the value in it (0x1A).&lt;BR /&gt;I tried to search for similar projects or codes, but most of them are made with additional libraries (mbed for example) in other editors (CodeWarrior). What am i doing wrong in I2C_ReadRegister_uc function? How it's supposed to be done?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am including my C files so you can see the code.&lt;BR /&gt;Please help &lt;SPAN aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt; And thanks in advance &lt;SPAN aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337339"&gt;I2C.h.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337339"&gt;I2C.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337339"&gt;main.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 18:18:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL46Z-I2C-Accelerometer/m-p/438890#M25647</guid>
      <dc:creator>januszkowalski</dc:creator>
      <dc:date>2015-11-24T18:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL46Z I2C Accelerometer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL46Z-I2C-Accelerometer/m-p/438891#M25648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Janusz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took a look at your initialisation code and see that you are enabling I2C1 on PTE0 and PTE1.&lt;/P&gt;&lt;P&gt;As far as I know and have experienced (unless there is a new board that has a different design) the MMA8451Q is connected to I2C0 (PTE24 and PTE25). Please check this before continuing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note that you can get a complete project for your board which includes robust I2C for the accelerometer, as well as almost everything else that you may need (sLCD, USB, etc.) at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.utasker.com/kinetis/FRDM-KL46Z.html" rel="nofollow"&gt;http://www.utasker.com/kinetis/FRDM-KL46Z.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It also allows you to simuate the (FRDM-KL46Z) KL46 and the I2C operation with accelerometer to learn full details of the KL46.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 20:20:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL46Z-I2C-Accelerometer/m-p/438891#M25648</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-11-24T20:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL46Z I2C Accelerometer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL46Z-I2C-Accelerometer/m-p/438892#M25649</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;thank you for your advice. Much appreciated. My I2C is working now and I read the correct value from WHO_AM_I register :smileyhappy: &lt;BR /&gt;But I'm facing with another problem now. When I read from axis registers of &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;MMA8451Q module I always get the same value from them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I do it like that:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //======================================&lt;/P&gt;&lt;P&gt;&amp;nbsp; //================X AXIS================&lt;/P&gt;&lt;P&gt;&amp;nbsp; //======================================&lt;/P&gt;&lt;P&gt;&amp;nbsp; xMSB = I2C_ReadRegister(0x01); //MSB&lt;/P&gt;&lt;P&gt;&amp;nbsp; xLSB = I2C_ReadRegister(0x02); //LSB&lt;/P&gt;&lt;P&gt;&amp;nbsp; xMSB = xMSB&amp;lt;&amp;lt;6;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = xMSB | xLSB;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //======================================&lt;/P&gt;&lt;P&gt;&amp;nbsp; //================Y AXIS================&lt;/P&gt;&lt;P&gt;&amp;nbsp; //======================================&lt;/P&gt;&lt;P&gt;&amp;nbsp; yMSB = I2C_ReadRegister(0x03); //MSB&lt;/P&gt;&lt;P&gt;&amp;nbsp; yLSB = I2C_ReadRegister(0x04); //LSB&lt;/P&gt;&lt;P&gt;&amp;nbsp; yMSB = yMSB&amp;lt;&amp;lt;6;&lt;/P&gt;&lt;P&gt;&amp;nbsp; y = yMSB | yLSB;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //======================================&lt;/P&gt;&lt;P&gt;&amp;nbsp; //================Z AXIS================&lt;/P&gt;&lt;P&gt;&amp;nbsp; //======================================&lt;/P&gt;&lt;P&gt;&amp;nbsp; zMSB = I2C_ReadRegister(0x05); //MSB&lt;/P&gt;&lt;P&gt;&amp;nbsp; zLSB = I2C_ReadRegister(0x06); //LSB&lt;/P&gt;&lt;P&gt;&amp;nbsp; zMSB = zMSB&amp;lt;&amp;lt;6;&lt;/P&gt;&lt;P&gt;&amp;nbsp; z = zMSB | zLSB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These registers always return the same values. Should I calibrate or initialise the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;MMA8451Q module before reading these registers? How to do it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Janusz&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 00:01:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL46Z-I2C-Accelerometer/m-p/438892#M25649</guid>
      <dc:creator>januszkowalski</dc:creator>
      <dc:date>2016-01-18T00:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL46Z I2C Accelerometer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL46Z-I2C-Accelerometer/m-p/438893#M25650</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;You need to configure and start the accelerometer.&lt;/P&gt;&lt;P&gt;Please refer to its data sheet for all details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&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, 18 Jan 2016 12:14:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL46Z-I2C-Accelerometer/m-p/438893#M25650</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-01-18T12:14:27Z</dc:date>
    </item>
  </channel>
</rss>

