<?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: Re: Accelerometer KL25Z</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280716#M10322</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Antonio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried use your code but the code &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;gets stuck in this line:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;void Default_Handler()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm("bkpt"); // &amp;lt;-------------&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after have ran from &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I2CWriteRegister(0x1D, 0x0E, 0x00); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IIC_StartTransmission(SlaveID,MWSR);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i2c_Start();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea about what can be happening?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 16:51:31 GMT</pubDate>
    <dc:creator>joaolouzada</dc:creator>
    <dc:date>2014-05-29T16:51:31Z</dc:date>
    <item>
      <title>Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280709#M10315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on a kl25z for the freescale cup and i'm trying to program the build-in accelerometer...&lt;/P&gt;&lt;P&gt;I just got into college, so I don't know anything about programming processors and stuff like that...&lt;/P&gt;&lt;P&gt;I've tried lots of tutorials, but my CW project does't have the processor expert, and, if I add it, it messes the whole thing...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My software is based on the sample for the TFC...&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-93914"&gt;Freescale Cup Shield for the Freedom KL25Z&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could someone help me with the code for it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 23:45:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280709#M10315</guid>
      <dc:creator>mauriciofarina</dc:creator>
      <dc:date>2013-10-15T23:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280710#M10316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there fellow college student!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll start recognizing people around these boards (the community) and you'll probably start to notice some of the same people posting tutorials or articles they have written on various useful topics. One person has helped me learn a lot, Erich Styger, his blog helps with common issues or questions people may have while their projects excel (&lt;A href="http://mcuoneclipse.com/" title="http://mcuoneclipse.com/"&gt;MCU on Eclipse | Everything on Eclipse, Microcontrollers and Software&lt;/A&gt;) and he has a github account that holds many different demo projects. There are many projects on his github for KL25z and there is a demo project on there for KL25z's accelerometer using processor expert. Here is his github link: &lt;A href="https://github.com/ErichStyger/mcuoneclipse" title="https://github.com/ErichStyger/mcuoneclipse"&gt;ErichStyger/mcuoneclipse · GitHub&lt;/A&gt;.&amp;nbsp; Just load the .zip onto your computer and import the Freedom_Accel project on to Eclispe!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Lander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2013 17:29:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280710#M10316</guid>
      <dc:creator>lander</dc:creator>
      <dc:date>2013-10-16T17:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280711#M10317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah... I've searched a lot... but the problem is that int all of the tutorials that I found they all use the process expert... and my code doesn't support it...&lt;/P&gt;&lt;P&gt;If I try to add the process expert it bugs all my code...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2013 22:55:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280711#M10317</guid>
      <dc:creator>mauriciofarina</dc:creator>
      <dc:date>2013-10-16T22:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280712#M10318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't really understand. You don't need processor expert because your code doesn't support it, but you try to add it? The rules for the freescale cup say that you can or cannot use processor expert? And when you say bugs, you get errors? What kind of errors?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 12:29:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280712#M10318</guid>
      <dc:creator>lander</dc:creator>
      <dc:date>2013-10-17T12:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280713#M10319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NOO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't use processor expert because it conflicts with the parameters in my code!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I add it I get like 20 errors... then i correct them and i get many others.........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I think I need is a library for the accelerometer...&lt;/P&gt;&lt;P&gt;like a .c and a .h code for it...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 16:16:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280713#M10319</guid>
      <dc:creator>mauriciofarina</dc:creator>
      <dc:date>2013-10-17T16:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280714#M10320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello mauricio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Processor Expert just creates a .c and a .h file for every peripheral of the microcontroller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of the accelerometer, you will communicate with it through I2C. You can check the example that has been suggested to you from Erich's blog, look at the code that processor expert generates and then try to implement it in your project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&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;Santiago&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;El 17/10/2013, a las 18:17, "Mauricio Farina" &amp;lt;admin@community.freescale.com&amp;lt;mailto:admin@community.freescale.com&amp;gt;&amp;gt; escribió:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.freescale.com/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.freescale.com/&amp;gt;&lt;/P&gt;&lt;P&gt;Accelerometer KL25Z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reply from Mauricio Farina&amp;lt;https://community.freescale.com/people/mauriciofarina?et=watches.email.thread&amp;gt; in Kinetis Microcontrollers - View the full discussion&amp;lt;https://community.freescale.com/message/356413?et=watches.email.thread#356413&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:33:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280714#M10320</guid>
      <dc:creator>santiago_gonzal</dc:creator>
      <dc:date>2013-10-17T17:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280715#M10321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mauricio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am giving a software lab course at the University. As students are learning the basics of low-level programming (register level), I do not use Processor Expert in this course. The final experiment is accessing the accelerometer through I2C, so I have developed a library for this purpose, derived from an example library for Kinetis Family, which I simplified and suited for my needs. I am sending the .h and .c files attached to this reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For controlling the accelerometer, you just have to write the right values to the right config registers. Remember that the accelerometer address (SlaveID) is 0x1D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you just want to read raw (unfiltered) data from XYZ axes, using a full scale range of 2g, you may initialize the accelerometer using this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I2CWriteRegister(0x1D, 0x0E, 0x00); // Writes 0x00 to data config register (0x0E).&lt;/P&gt;&lt;P&gt;I2CWriteRegister(0x1D, 0x2A, 0x39); // Writes 0x39 to general config register 1 (0x2A)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the accelerometer starts working. It will make a new read (all 3 axes) every 640ms. If you want other periods, you just have to write the right value on 0x2A register, instead of 0x39. For 160ms, write 0x31; for 80ms, write 0x29; for 20ms, write 0x21.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may read the latest collected values this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I2CReadMultiRegisters(0x1D, 0x01, 6, data); // Reads 6 sequential registers starting from MSB of X axis (0x01). "data" is a 6-element array of char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result will be the values of 3 axes loaded on "data" array: [MSB_X, LSB_X, MSB_Y, LSB_Y, MSB_Z, LSB_Z]. You may also test if new data is available before reading using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dr = (I2CReadRegister(0x1D, STATUS) &amp;amp; 0x08); // dr is zero if no new data is available; it is 0x08 if new data is available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that it helps. Just message me if you need something else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, Processor Expert should not keep giving you errors. It would be interesting if you could provide more details (including screen captures) about the errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Antonio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 15:30:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280715#M10321</guid>
      <dc:creator>quevedo</dc:creator>
      <dc:date>2013-10-22T15:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280716#M10322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Antonio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried use your code but the code &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;gets stuck in this line:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;void Default_Handler()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm("bkpt"); // &amp;lt;-------------&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after have ran from &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I2CWriteRegister(0x1D, 0x0E, 0x00); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IIC_StartTransmission(SlaveID,MWSR);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i2c_Start();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea about what can be happening?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 16:51:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280716#M10322</guid>
      <dc:creator>joaolouzada</dc:creator>
      <dc:date>2014-05-29T16:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280717#M10323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When code stucks at the default interrupt handler, it is probably some math error (like divide by zero) or a hardware fault. There is a way to know what kind of error is happening in this case. Just check this link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/02/20/oh-my-an-interrupt/" title="http://mcuoneclipse.com/2012/02/20/oh-my-an-interrupt/"&gt;Oh my! An Interrupt… | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doing this you can see if you have a dardware fault, which is the most probable. Then, check on these 2 links:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/11/24/debugging-hard-faults-on-arm-cortex-m/" title="http://mcuoneclipse.com/2012/11/24/debugging-hard-faults-on-arm-cortex-m/"&gt;http://mcuoneclipse.com/2012/11/24/debugging-hard-faults-on-arm-cortex-m/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/12/28/a-processor-expert-component-to-help-with-hard-faults/" title="http://mcuoneclipse.com/2012/12/28/a-processor-expert-component-to-help-with-hard-faults/"&gt;A Processor Expert Component to Help with Hard Faults | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may get more details on your error. Also, create a breakpoint inside i2c_Start() function, right at the beginning and use step-by-step execution, and see in what instruction the interrupt is triggered at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Post your results so I can help you more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Antonio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 20:12:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280717#M10323</guid>
      <dc:creator>quevedo</dc:creator>
      <dc:date>2014-05-29T20:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280718#M10324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Antonio, I am getting the exact same issue as Joao, my code getting an interrupt handler error inside 12c_start();. I tried going to the links you provided, but I can't really relate since I'm not using processor expert. Did you come up with any fix for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:33:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280718#M10324</guid>
      <dc:creator>lilyann</dc:creator>
      <dc:date>2015-02-23T20:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Accelerometer KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280719#M10325</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;I recommend to post a new question in the &lt;A href="https://community.nxp.com/space/2019"&gt; Kinetis Microcontrollers&lt;/A&gt; space. There it will have more visibility and more members can help you with the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 22:58:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Accelerometer-KL25Z/m-p/280719#M10325</guid>
      <dc:creator>adriancano</dc:creator>
      <dc:date>2015-02-23T22:58:43Z</dc:date>
    </item>
  </channel>
</rss>

