<?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 Late timer in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Late-timer/m-p/522371#M5007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdurand on Sat Aug 25 12:55:31 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC1754&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Red Probe +&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm seeing something odd with the timer...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I set up three MCR in the timer while it's reset and then let it run. The interrupts are coming in about 4% later than they should.&amp;nbsp; I've tested this at a bit over 1mS to almost 23mS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tested SystemCoreClock by looking at continuous serial data and the serial baud rate comes out just fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there some way the debugger could slow the timer?&amp;nbsp; Any other way the timer could run slower than the serial port since they're both on the same PCLK?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the setup:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;TCR = 0b10;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;MR0 =200;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;MR1 = 225;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;MR2 = 22850;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;MCR = 1&amp;lt;&amp;lt;6 | 1&amp;lt;&amp;lt;3 | 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;TCR = 0b01;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a test point on one pin that I set low when I start the timer and high when MR2 interrupt hits.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:38:19 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:38:19Z</dc:date>
    <item>
      <title>Late timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Late-timer/m-p/522371#M5007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdurand on Sat Aug 25 12:55:31 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC1754&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Red Probe +&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm seeing something odd with the timer...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I set up three MCR in the timer while it's reset and then let it run. The interrupts are coming in about 4% later than they should.&amp;nbsp; I've tested this at a bit over 1mS to almost 23mS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tested SystemCoreClock by looking at continuous serial data and the serial baud rate comes out just fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there some way the debugger could slow the timer?&amp;nbsp; Any other way the timer could run slower than the serial port since they're both on the same PCLK?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the setup:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;TCR = 0b10;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;MR0 =200;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;MR1 = 225;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;MR2 = 22850;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;MCR = 1&amp;lt;&amp;lt;6 | 1&amp;lt;&amp;lt;3 | 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TIM0-&amp;gt;TCR = 0b01;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a test point on one pin that I set low when I start the timer and high when MR2 interrupt hits.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:38:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Late-timer/m-p/522371#M5007</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Late timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Late-timer/m-p/522372#M5008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdurand on Sat Aug 25 13:45:23 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to test things, I set up PWM1 to run at 100Hz and checked it with my logic analyzer.&amp;nbsp; It's running at 99.955853Hz which says my SystemCoreClock is within 0.04% of 100MHz.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So...why is Timer 0 running over 4% slow?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:38:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Late-timer/m-p/522372#M5008</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Late timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Late-timer/m-p/522373#M5009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdurand on Sat Aug 25 17:03:54 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Found it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I missed subtracting 1 from the Prescale Register (LPC_TIM0-&amp;gt;PR) and since my prescale was 25, that made me 4% slow.&amp;nbsp; Now all is well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:38:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Late-timer/m-p/522373#M5009</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:38:21Z</dc:date>
    </item>
  </channel>
</rss>

