<?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中的主题 Re: Timer problem on LPC 1343</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553484#M12784</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kacso on Sun Aug 26 03:33:44 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Where can I see which is priority? I'm new with this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:09:59 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:09:59Z</dc:date>
    <item>
      <title>Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553482#M12782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kacso on Fri Aug 24 09:21:07 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to initalize timer32 so that he makes an interrupt every second, but I don't know what should I put for TimerInterval.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I try with this: init_timer32(1, 72000000); what should be normal (at least I think so) because frequency is 72MHz but it is to fast (In 3-4 hours it generate 3 interrupts more than he should.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I read somewhere that it sholud be 71999999 but of course it's to fast too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;:confused:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:09:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553482#M12782</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553483#M12783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ex-kayoda on Fri Aug 24 10:00:48 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;#1 Timer is counting digital, so Freq-1 is the correct value :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#2 Which interrupt priority has your timer?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:09:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553483#M12783</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553484#M12784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kacso on Sun Aug 26 03:33:44 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Where can I see which is priority? I'm new with this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:09:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553484#M12784</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553485#M12785</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 Sun Aug 26 05:49:14 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;CMSIS is supporting you with priority functions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;core_cm3.h:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; This function sets the priority for the specified interrupt. The interrupt 
&amp;nbsp;&amp;nbsp;&amp;nbsp; number can be positive to specify an external (device specific) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; interrupt, or negative to specify an internal (core) interrupt.

&amp;nbsp;&amp;nbsp;&amp;nbsp; Note: The priority cannot be set for every core interrupt.

&amp;nbsp;&amp;nbsp;&amp;nbsp; \param [in]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IRQn&amp;nbsp; Number of the interrupt for set priority
&amp;nbsp;&amp;nbsp;&amp;nbsp; \param [in]&amp;nbsp; priority&amp;nbsp; Priority to set
 */
static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
{
&amp;nbsp; if(IRQn &amp;lt; 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB-&amp;gt;SHP[((uint32_t)(IRQn) &amp;amp; 0xF)-4] = ((priority &amp;lt;&amp;lt; (8 - __NVIC_PRIO_BITS)) &amp;amp; 0xff); } /* set Priority for Cortex-M&amp;nbsp; System Interrupts */
&amp;nbsp; else {
&amp;nbsp;&amp;nbsp;&amp;nbsp; NVIC-&amp;gt;IP[(uint32_t)(IRQn)] = ((priority &amp;lt;&amp;lt; (8 - __NVIC_PRIO_BITS)) &amp;amp; 0xff);&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* set Priority for device specific Interrupts&amp;nbsp; */
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;Debugger should show you interrupt settings:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Peripherals View-&amp;gt; NVIC -&amp;gt; IRQ_3_0_PRIOIRITY (start at 0xE000 E400)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately registers &amp;gt; 32 (= IRQ number) are not shown here :eek::mad::mad::eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So you have to open a new window to monitor this addresses (&amp;gt; 0xe00e41c) or you just read it back:&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;
 NVIC_SetPriority(30,2);//TIMER_32_0_IRQn , 1);
 priority_value = NVIC_GetPriority(TIMER_32_0_IRQn);
&amp;nbsp; &lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:09:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553485#M12785</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553486#M12786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kacso on Wed Sep 05 07:57:04 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I assigned the highest priority to the timer but there is no change, timer is too fast again. I think that priority doesn't mean anything in this problem because timer could just be to slow if priority is to low, but it couldn't be to fast.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought that the problem is with clearing interrupt in interrupt handler, I was doing it on the end, now I clear it on the beginig of handler, but there is no change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:10:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553486#M12786</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553487#M12787</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 Wed Sep 05 10:37:16 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: kacso&lt;/STRONG&gt;&lt;BR /&gt;Any idea?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#1 Create a new project and add your timer ;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#2 Test Debug and Release Version :confused:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#3 Post it :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:10:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553487#M12787</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553488#M12788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kacso on Thu Sep 06 05:20:35 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I try in new project with the same timer and write counts on oled (on base board) but timer is to fast again. In less than 2 hours he counts 1 second more than my computer clock.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:10:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553488#M12788</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553489#M12789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fjrg76 on Thu Sep 06 17:21:47 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Use the SystemCoreClock variable:&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;
/* 1 second interval */
timer32(1,SystemCoreClock / 1);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That works great for me (although I used / 1000 for a 1ms interval).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:10:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553489#M12789</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553490#M12790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kacso on Fri Sep 07 03:47:41 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I try it but there is the same problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for trying to help :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:10:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553490#M12790</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553491#M12791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TommyBurger on Fri Sep 07 08:39:45 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Consider the accuracy of your reference clock, that is, your PC. PC's are generally inaccurate. Also consider the accuracy of the oscillator on you uC. Then one second in a couple of hours may seem reasonable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Recently, I needed a good time reference to verify our products accuracy. The cheapest solution for me was a Garmin GPS unit with a 1 pulse per second output.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:10:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553491#M12791</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Timer problem on LPC 1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553492#M12792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kacso on Fri Sep 07 10:30:26 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Probably that is the problem :).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks all for help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:10:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-problem-on-LPC-1343/m-p/553492#M12792</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:10:04Z</dc:date>
    </item>
  </channel>
</rss>

