<?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>topic Re: Timer + Interrupt difficulties in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-Interrupt-difficulties/m-p/537285#M5477</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 Wed Jul 25 09:46:09 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Sepheriod&lt;/STRONG&gt;&lt;BR /&gt;Hello, I'm using an LPC 11c24 MCU and my program consists of 2 ISR's ran by 2 seperate timers. timer_32_0 and timer_32_1&lt;BR /&gt; &lt;BR /&gt;timer_32_0 runs on 1hz and the ISR takes about 150 mS to handle all the instructions in the ISR&lt;BR /&gt; &lt;BR /&gt;timer_32_1 runs on 1000hz and is done in a few microseconds.&lt;BR /&gt; &lt;BR /&gt;These timers have to run at the same time.&lt;BR /&gt; &lt;BR /&gt;But the problem now is that when timer_32_0 is active for that 150 mS timer_32_1 is inactive.&lt;BR /&gt; &lt;BR /&gt;if I change around the NVIC priorities timer_32_1 is always active and timer_32_0 is never called.&lt;BR /&gt; &lt;BR /&gt;NVIC_SetPriority(TIMER_32_1_IRQn, 4);&lt;BR /&gt; &lt;BR /&gt;is there a way to work around this problem?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, switch you brain on, set a flag in your interrupt and let the work do your main :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Writing 150ms Interrupts deserves punishment ;)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 01:45:32 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T01:45:32Z</dc:date>
    <item>
      <title>Timer + Interrupt difficulties</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-Interrupt-difficulties/m-p/537283#M5475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Sepheriod on Wed Jul 25 08:06:43 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, I'm using an LPC 11c24 MCU and my program consists of 2 ISR's ran by 2 seperate timers. timer_32_0 and timer_32_1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;timer_32_0 runs on 1hz and the ISR takes about 150 mS to handle all the instructions in the ISR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;timer_32_1 runs on 1000hz and is done in a few microseconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;These timers have to run at the same time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the problem now is that when timer_32_0 is active for that 150 mS timer_32_1 is inactive.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if I change around the NVIC priorities timer_32_1 is always active and timer_32_0 is never called.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NVIC_SetPriority(TIMER_32_1_IRQn, 4);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is there a way to work around this problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:45:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-Interrupt-difficulties/m-p/537283#M5475</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Timer + Interrupt difficulties</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-Interrupt-difficulties/m-p/537284#M5476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Wed Jul 25 08:58:46 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems an interrupt ack problem to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know the LPC11xx timers details, but I had similar problems on LPC2148 which has one ISR, common to all functions of a single timer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:45:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-Interrupt-difficulties/m-p/537284#M5476</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Timer + Interrupt difficulties</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-Interrupt-difficulties/m-p/537285#M5477</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 Wed Jul 25 09:46:09 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Sepheriod&lt;/STRONG&gt;&lt;BR /&gt;Hello, I'm using an LPC 11c24 MCU and my program consists of 2 ISR's ran by 2 seperate timers. timer_32_0 and timer_32_1&lt;BR /&gt; &lt;BR /&gt;timer_32_0 runs on 1hz and the ISR takes about 150 mS to handle all the instructions in the ISR&lt;BR /&gt; &lt;BR /&gt;timer_32_1 runs on 1000hz and is done in a few microseconds.&lt;BR /&gt; &lt;BR /&gt;These timers have to run at the same time.&lt;BR /&gt; &lt;BR /&gt;But the problem now is that when timer_32_0 is active for that 150 mS timer_32_1 is inactive.&lt;BR /&gt; &lt;BR /&gt;if I change around the NVIC priorities timer_32_1 is always active and timer_32_0 is never called.&lt;BR /&gt; &lt;BR /&gt;NVIC_SetPriority(TIMER_32_1_IRQn, 4);&lt;BR /&gt; &lt;BR /&gt;is there a way to work around this problem?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, switch you brain on, set a flag in your interrupt and let the work do your main :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Writing 150ms Interrupts deserves punishment ;)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:45:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-Interrupt-difficulties/m-p/537285#M5477</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Timer + Interrupt difficulties</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-Interrupt-difficulties/m-p/537286#M5478</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 Wed Jul 25 10:27:04 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;First, interrupt service taking 150 ms ia a serious conceptual flaw -&amp;gt; rethink your project. The interrupt service should not wait for anything.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Second, if something must happen 1000 times per second and something other once per second, you should use only one timer interrupt, do the 1000 Hz stuff in ISR, then decrement a counter - if decremented to 0, do the 1 Hz stuff and reload the counter with 1000.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:45:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Timer-Interrupt-difficulties/m-p/537286#M5478</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:45:33Z</dc:date>
    </item>
  </channel>
</rss>

