<?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のトピックTiming Resolution</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546948#M9907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tgalluzzo on Mon Dec 26 16:43:22 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way of measuring time that has higher resolution than systick? What if I need to measure time very accurately but I don't want to run the systick timer very fast? Is there another way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 00:34:38 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T00:34:38Z</dc:date>
    <item>
      <title>Timing Resolution</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546948#M9907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tgalluzzo on Mon Dec 26 16:43:22 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way of measuring time that has higher resolution than systick? What if I need to measure time very accurately but I don't want to run the systick timer very fast? Is there another way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:34:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546948#M9907</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Timing Resolution</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546949#M9908</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 Dec 26 17:04:36 MST 2011&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;Is there a way of measuring time that has higher resolution than systick?&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;No :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If SysTick is clocked by main clock, nothing can be faster :mad:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't know which chip you are using and which time you are trying to measure, but measuring a simple time is usually done by a timer&amp;nbsp; :rolleyes:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:34:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546949#M9908</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Timing Resolution</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546950#M9909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Tue Dec 27 09:38:24 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess tgalluzzo is using the systick timer to generate a system tick of 1 or 10 msec. But he want to measure a more accurate time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then just taking the systick time ticks as stored by the OS + the current counter value of systick will give wat you want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The SysTick-&amp;gt;VAL register in the systick timer gives you the current count of the systick timer. SysTick-&amp;gt;LOAD tells you what value is used to reload the timer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't forget: the systick timer counts down from it's reload value to 0, the period equals SysTick-&amp;gt;LOAD [B][COLOR=Red]+ 1[/COLOR][/B].&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another option is to program one of the general purpose timers. Set the PCLK to CCLK and start/stop/reset the timer in your own program. I did something like this some years ago for the&amp;nbsp; lpc2106 (&lt;/SPAN&gt;&lt;A href="http://http://myvoice.nl/electronics/timing-programs.php"&gt;link to that page&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:34:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546950#M9909</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Timing Resolution</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546951#M9910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tgalluzzo on Tue Dec 27 14:34:41 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Rob,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The SysTick-&amp;gt;VAL technique is what I was looking for. That will work great. I'm just curious, is there a way to measure the CPU clock CCLK directly?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:34:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546951#M9910</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Timing Resolution</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546952#M9911</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 Tue Dec 27 15:22:45 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;As mentioned before, every timer can be clocked by main clock :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't know what you are trying to do (measure a time or capture a signal), what chip you are using and what times you are trying to measure; but the answer is still: that's a timer job. And therefore timer0-x or RIT timer (LPC17xx) offer a lot of options.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:34:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546952#M9911</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Timing Resolution</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546953#M9912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tgalluzzo on Tue Dec 27 15:27:45 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks I was just curious. I'm trying to measure the time between subsequent motor control iterations. I have a 1769. I understand what you mean about this being a timer job. I will look into them more.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:34:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546953#M9912</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Timing Resolution</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546954#M9913</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 Tue Dec 27 16:10:04 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The simplest way of measuring a time is just start a timer, let it count and stop it &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Every 32bit timer at 100MHz (= resolution 10E-9 sec) is able to measure a time up to 42.9 seconds:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
int main(void)
{
 volatile static int i = 0 ;

//set timer
 LPC_SC-&amp;gt;PCONP |=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (1&amp;lt;&amp;lt;1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //power on timer0
 LPC_SC-&amp;gt;PCLKSEL0 &amp;amp;=~(3&amp;lt;&amp;lt;2);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //reset clock sel bits
 LPC_SC-&amp;gt;PCLKSEL0 |= (1&amp;lt;&amp;lt;2);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //set clock sel bits:full speed = 100MHz
 LPC_TIM0-&amp;gt;TCR = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //start timer

 while(1)
 {
&amp;nbsp; i++ ;
&amp;nbsp; if(i &amp;gt;= 1000)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; LPC_TIM0-&amp;gt;TCR = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //stop timer
&amp;nbsp;&amp;nbsp; i=0;
//use debugger to read timer register LPC_TIM0-&amp;gt;TC here
&amp;nbsp;&amp;nbsp; LPC_TIM0-&amp;gt;TC =0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //reset timer register
&amp;nbsp;&amp;nbsp; LPC_TIM0-&amp;gt;TCR = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //start timer again
&amp;nbsp; }
 }
 return 0 ;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:34:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timing-Resolution/m-p/546954#M9913</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:34:42Z</dc:date>
    </item>
  </channel>
</rss>

