<?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>LPC MicrocontrollersのトピックRIT timer possible overrun</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/RIT-timer-possible-overrun/m-p/514433#M686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efiLabs on Sun Dec 14 22:29:48 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;friends :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i noticed the following code in LpcOpen rtitimer_15xx.c&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Returns the current timer Counter value */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint64_t Chip_RIT_GetCounter(LPC_RITIMER_T *pRITimer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint64_t val;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;val = (uint64_t) pRITimer-&amp;gt;COUNTER_H;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;val = val &amp;lt;&amp;lt; 32;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;val |= (uint64_t) pRITimer-&amp;gt;COUNTER;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;return val;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;how about if the timer rolls over into the high part between the 2 reads ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i didn't find anything in the user manual stating if the high part is being read 1st the low reading following it contains a saved copy of the low part from the time of the high part read&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; my solution was&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ulong h0 = LPC_RITIMER-&amp;gt;COUNTER_H ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ulong lo = LPC_RITIMER-&amp;gt;COUNTER ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ulong h1 = LPC_RITIMER-&amp;gt;COUNTER_H ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and if h0 != h1 reread the low part&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any other suggestions please ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers efiLabs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:11:26 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:11:26Z</dc:date>
    <item>
      <title>RIT timer possible overrun</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/RIT-timer-possible-overrun/m-p/514433#M686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efiLabs on Sun Dec 14 22:29:48 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;friends :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i noticed the following code in LpcOpen rtitimer_15xx.c&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Returns the current timer Counter value */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint64_t Chip_RIT_GetCounter(LPC_RITIMER_T *pRITimer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint64_t val;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;val = (uint64_t) pRITimer-&amp;gt;COUNTER_H;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;val = val &amp;lt;&amp;lt; 32;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;val |= (uint64_t) pRITimer-&amp;gt;COUNTER;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;return val;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;how about if the timer rolls over into the high part between the 2 reads ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i didn't find anything in the user manual stating if the high part is being read 1st the low reading following it contains a saved copy of the low part from the time of the high part read&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; my solution was&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ulong h0 = LPC_RITIMER-&amp;gt;COUNTER_H ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ulong lo = LPC_RITIMER-&amp;gt;COUNTER ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ulong h1 = LPC_RITIMER-&amp;gt;COUNTER_H ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and if h0 != h1 reread the low part&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any other suggestions please ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers efiLabs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:11:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/RIT-timer-possible-overrun/m-p/514433#M686</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: RIT timer possible overrun</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/RIT-timer-possible-overrun/m-p/514434#M687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by hnoor on Fri Mar 27 00:47:54 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;i didn't find anything in the user manual stating if the high part is being read 1st the low reading following it contains a saved copy of the low part from the time of the high part read&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:11:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/RIT-timer-possible-overrun/m-p/514434#M687</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: RIT timer possible overrun</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/RIT-timer-possible-overrun/m-p/514435#M688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by starblue on Fri Mar 27 02:33:56 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: efiLabs&lt;/STRONG&gt;&lt;BR /&gt;my solution was&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; ulong h0 = LPC_RITIMER-&amp;gt;COUNTER_H ;&lt;BR /&gt;&amp;nbsp; ulong lo = LPC_RITIMER-&amp;gt;COUNTER ;&lt;BR /&gt;&amp;nbsp; ulong h1 = LPC_RITIMER-&amp;gt;COUNTER_H ;&lt;BR /&gt;&lt;BR /&gt;and if h0 != h1 reread the low part&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's what I do in similar situations, loop while the reading of the high part changes.&amp;nbsp; Under any realistic system load the loop should terminate very quickly, rereading at most once (if not you have serious problems elsewhere).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:11:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/RIT-timer-possible-overrun/m-p/514435#M688</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:11:27Z</dc:date>
    </item>
  </channel>
</rss>

