<?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>LPCXpresso IDEのトピックSysTick less accurate than expected</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529454#M1506</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mfc on Mon Jan 30 03:02:27 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I was hoping to use SysTick as a precise real-time clock by setting the SysTick count to interrupt every 100 microseconds and then simply counting (every 10,000 counts bumps a seconds counter, [I]etc[/I].).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;On running this overnight, I find that there were 0.3% more interrupts than expected (3000 parts per million, whereas the external 12MHz crystal from which the clock is driven should be within 30 ppm).&amp;nbsp;&amp;nbsp; This equates to a gain of about 270 seconds (4.5 minutes) per day, which is too large for my application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have any ideas what might be causing this?&amp;nbsp; I've checked the SysTick CALIB register and it has the expected value (0x000F423F) for the 1768 chip that I'm using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks -- Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 02:51:53 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T02:51:53Z</dc:date>
    <item>
      <title>SysTick less accurate than expected</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529454#M1506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mfc on Mon Jan 30 03:02:27 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I was hoping to use SysTick as a precise real-time clock by setting the SysTick count to interrupt every 100 microseconds and then simply counting (every 10,000 counts bumps a seconds counter, [I]etc[/I].).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;On running this overnight, I find that there were 0.3% more interrupts than expected (3000 parts per million, whereas the external 12MHz crystal from which the clock is driven should be within 30 ppm).&amp;nbsp;&amp;nbsp; This equates to a gain of about 270 seconds (4.5 minutes) per day, which is too large for my application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have any ideas what might be causing this?&amp;nbsp; I've checked the SysTick CALIB register and it has the expected value (0x000F423F) for the 1768 chip that I'm using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks -- Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:51:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529454#M1506</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: SysTick less accurate than expected</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529455#M1507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by gbm on Mon Jan 30 03:20:49 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Systick timer is as accurate as your frequency source. Check your oscillator.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:51:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529455#M1507</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: SysTick less accurate than expected</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529456#M1508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Mon Jan 30 03:51:55 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;...it has the expected value (0x000F423F) for the 1768 chip that I'm using...&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;User manual:&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;23.5.4 System Timer Calibration value register (STCALIB - 0xE000 E01C). The STCALIB register contains a value that is initialized by the Boot Code to a factory programmed value that is appropriate for generating an interrupt every [COLOR=Red]10 milliseconds[/COLOR] if the System Tick Timer is clocked at a frequency of [COLOR=Red]100 MHz[/COLOR]. This is the intended use of the System Tick Timer by ARM. It can be used to generate interrupts at other frequencies by selecting the correct reload value.&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;#1 If you change your interrupt to 10 ms you should get a better result :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#2 If you change your calibration value you should get a better result :):)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:51:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529456#M1508</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: SysTick less accurate than expected</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529457#M1509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mfc on Mon Jan 30 03:58:37 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Zero&lt;/STRONG&gt;&lt;BR /&gt;User manual:&lt;BR /&gt;#1 If you change your interrupt to 10 ms you should get a better result :)&lt;BR /&gt; &lt;BR /&gt;#2 If you change your calibration value you should get a better result :):)&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, but:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#1 I am using a count of 9600 (-1 into the RELOAD register) for a 100 us interrupt [my clock speed is 96 MHz].&amp;nbsp; 10 ms is too slow for my application (real-time control).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#2 The CALIB value is 'hard-coded' in the hardware, and confirms that there is no skew in the device -- so the timing should be as good as the crystal from which the system clock is derived?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:51:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529457#M1509</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: SysTick less accurate than expected</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529458#M1510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by stalisman on Mon Jan 30 04:25:50 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;It is interesting that you are running your interrupts 100 times faster than suggested and that your errors are 100 times greater.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Given that the individual errors for each 100micro second timer, each with an associated 30ppm inacuracy, will accunulate over night is not something like this to be expected?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:51:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529458#M1510</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: SysTick less accurate than expected</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529459#M1511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mfc on Mon Jan 30 07:24:06 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: stalisman&lt;/STRONG&gt;&lt;BR /&gt;It is interesting that you are running your interrupts 100 times faster than suggested and that your errors are 100 times greater.&lt;BR /&gt; &lt;BR /&gt;Given that the individual errors for each 100micro second timer, each with an associated 30ppm inacuracy, will accunulate over night is not something like this to be expected?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hmm, that's an interesting observation.&amp;nbsp; But I'm not sure how it 'adds up'? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm asking for an interrupt every 9600 clock ticks.&amp;nbsp; The hardware should be doing exactly that.&amp;nbsp; So there should be 10,000 interrupts per second.&amp;nbsp; If I asked for an interrupt every 960000 ticks (100 per second) why would that be more accurate - they are the same ticks being counted?&amp;nbsp; I just count them 9600 at a time rather than 960000 at a time?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[Offline suggestions are that I have a 'bad' crystal ... will try and borrow a high-spec frequency meter to measure directly.]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:51:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529459#M1511</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: SysTick less accurate than expected</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529460#M1512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mfc on Sun Feb 05 03:52:03 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Mystery solved.&amp;nbsp; The SysTick_Config inline routine (in core_cm3.h) has the undocumented side-effect of setting the SysTick interrupt priority to lowest (by default it is at highest priority).&amp;nbsp; Since my interrupt handlers for accelerometer and gyro were at a medium priority and could run for more than 100us this caused occasional lost SysTick events (overrun).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My first measurement (where the clock appeared to run fast) must have been in error, as all subsequent ones showed the clock apparently running slow by 1.2% or so.&amp;nbsp; The crystal oscillator was stable with 13ppm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks for the suggestions, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:51:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SysTick-less-accurate-than-expected/m-p/529460#M1512</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:51:57Z</dc:date>
    </item>
  </channel>
</rss>

