<?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: Systick maximum rate in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530737#M10074</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by member_lpc11xx on Fri Mar 06 02:11:29 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I agree with wellsk and TheFallGuy considerations about SysTick. So my idea is to use a peripheral timer (16 or 32 bit) to generate the reference clock, but, as you know starblue, I've problem with this clock accuracy when I set it to relative high frequency (greater than 100KHz).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:31:23 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:31:23Z</dc:date>
    <item>
      <title>Systick maximum rate</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530731#M10068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by member_lpc11xx on Tue Mar 03 09:00:42 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello everybody,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working with LPC1112FD20, using internal RC and clocking ARM core at 12MHz. My program has only to set the board and in the main task read an ADC channel and then set an output.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In previous project I always have configured system timer (SysTick) so that it runs at 1 KHz, therefore interrupt every 1ms. Now I need to set its frequency at 1MHz, but here comes the problem: I'm unable to make it work at&amp;nbsp; that rate. Application do everything in the right way till it reaches ARM defined routine "SysTick_Config()": at this time my program stop running.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My first doubt have been that ARM core clock is too slow, so I've increased it to 48MHz (keeping IRC as clock source and enabling PLL), near maximum rate for LPC11xx microcontrollers (50MHz). Results: no change, same problem; when calling "SysTick_Config()" application stops.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I've tried do another test on the LPC-Link board with a LPC1114FBD48 mounted on it: same core (Cortex-M0) but more resources. Nothing has changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I specify that in the System Tick interrupt routine the only thing I do is toggling a pin to generate an output square wave and measure its frequency with the scope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maximum SysTick frequency I can configure keeping the application running is 400KHz (interrupt every 2,5us).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, my doubt is that maybe core clock isn't enough fast to serve and execute an ISR every microsecond. Reading "A Beginner’s Guide on Interrupt Latency - and Interrupt Latency of the ARM® Cortex®-M processors" article I've understood that to enter and exit an interrupt request 32 clock cycles (16+16) are needed: so 36/48000000 = 670ns only to manage ISR.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone experience same issue and/or confirm me if what I suppose is the right consideration for this "problem"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to anyone who help me&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrea&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:31:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530731#M10068</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Systick maximum rate</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530732#M10069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wellsk on Tue Mar 03 09:56:00 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect the sysTick interrupt processing is occurring 100% of the time. Once the systick interrupt is enabled is SysTick_Config(), the background processing is stalled forever and it gives the appearance of hanging in that function. A 1MHz interrupt that the CPU needs to handle is very aggressive for a 50Mhz device - with the context switch, extra wait states needed for FLASH operation @ 50Mhz, GPIO register access latency, etc. - your probably easily using up your budget of 50 system clocks per interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Consider another design approach (ie, maybe setting up the system to handle an event on an ADC sample and using a background thread to process the ADC data without interrupts). You can get some performance back from FLASH by moving ISR code to IRAM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:31:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530732#M10069</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Systick maximum rate</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530733#M10070</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 Tue Mar 03 10:56:56 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you considered an LPC82x? Slower CPU, but maybe the analog comparators and the SCT can do what you want (you didn't tell us much)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:31:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530733#M10070</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Systick maximum rate</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530734#M10071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by member_lpc11xx on Wed Mar 04 03:51:22 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You confirm my doubt wellsk. I'm not using ADC interrupt to execute readings, the only interrupt is the SysTick. I'll try moving ISR in RAM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To answerto starblue, we are currently using LPC1112 on a wide parts of our custom products, so we are trying to keep this microcontroller for each application we need. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason I've tried clocking the System Timer at 1MHz is that I need a reference timer with base time of 1us, to manage the physical layer of a communication protocol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;I know I can use one of the peripheral timers (TMR16B0 or TMR32B0), but I've observed strange behaviour of them, as I've stated in this forum thread &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Ftimer-1632-bit-wrong-counting" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/forum/timer-1632-bit-wrong-counting&lt;/A&gt;&lt;SPAN&gt; .&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks everyone of you,starblue and wellsk.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrea&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:31:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530734#M10071</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Systick maximum rate</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530735#M10072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Wed Mar 04 04:02:06 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Do the math:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Clock = 48MHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Systick rate = 1MHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gives you 48 cycles to execute your Systick handler&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Minimum exception (interrupt) handling latency is 16 cycles. I guess the return is going to be similar&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This leaves you about 16 cycles to do some real work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Most (but not all) instructions are single cycle, so your maximum instructions is 16 (but likely to be less)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Flash is not zero wait state, further reducing the number of instructions you can execute&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, at 48MHz with a 1MHz Systick, you are going to be doing nothing else but service Systick AND you are going to have to do some very tight coding in the handler...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:31:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530735#M10072</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Systick maximum rate</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530736#M10073</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 Thu Mar 05 01:39:24 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: member_lpc11xx&lt;/STRONG&gt;&lt;BR /&gt;The reason I've tried clocking the System Timer at 1MHz is that I need a reference timer with base time of 1us, to manage the physical layer of a communication protocol.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use some other timer and set the prescaler so that the main counter ticks at 1MHz. Then you can easily read time stamps directly out of the timer. You can also use it to generate interrupts at certain points in time. (I've done just that on an LPC11C14, with a free running 32 bit timer.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:31:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530736#M10073</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Systick maximum rate</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530737#M10074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by member_lpc11xx on Fri Mar 06 02:11:29 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I agree with wellsk and TheFallGuy considerations about SysTick. So my idea is to use a peripheral timer (16 or 32 bit) to generate the reference clock, but, as you know starblue, I've problem with this clock accuracy when I set it to relative high frequency (greater than 100KHz).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:31:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Systick-maximum-rate/m-p/530737#M10074</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:31:23Z</dc:date>
    </item>
  </channel>
</rss>

