<?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のトピックHow do I set up a 1khz on Ctimer 0 using the 1MHz Free running clock on the LPC5516?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-do-I-set-up-a-1khz-on-Ctimer-0-using-the-1MHz-Free-running/m-p/1447454#M48540</link>
    <description>&lt;P&gt;As the subject indicates, I am trying to set up a&amp;nbsp;&lt;SPAN&gt;1khz on Ctimer 0 using the 1MHz Free running clock.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any advice or suggestions are more than welcome.&amp;nbsp; I am trying to create a low-level muti-tasking kernel in C. Eg. time-sliced threads&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Apr 2022 20:52:37 GMT</pubDate>
    <dc:creator>upstate</dc:creator>
    <dc:date>2022-04-21T20:52:37Z</dc:date>
    <item>
      <title>How do I set up a 1khz on Ctimer 0 using the 1MHz Free running clock on the LPC5516?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-do-I-set-up-a-1khz-on-Ctimer-0-using-the-1MHz-Free-running/m-p/1447454#M48540</link>
      <description>&lt;P&gt;As the subject indicates, I am trying to set up a&amp;nbsp;&lt;SPAN&gt;1khz on Ctimer 0 using the 1MHz Free running clock.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any advice or suggestions are more than welcome.&amp;nbsp; I am trying to create a low-level muti-tasking kernel in C. Eg. time-sliced threads&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 20:52:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-do-I-set-up-a-1khz-on-Ctimer-0-using-the-1MHz-Free-running/m-p/1447454#M48540</guid>
      <dc:creator>upstate</dc:creator>
      <dc:date>2022-04-21T20:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set up a 1khz on Ctimer 0 using the 1MHz Free running clock on the LPC5516?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-do-I-set-up-a-1khz-on-Ctimer-0-using-the-1MHz-Free-running/m-p/1447548#M48544</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I suggest you refer to the _ctimer_match_interrupt_example, the CTimer generate programmable period interrupt, in the ISR, you can switch the task.&lt;/P&gt;
&lt;P&gt;You can use the systick module to generate interrupt, the systick module is core module, it's interrupt is of higher priority. For the systick module, you can refer to the led_blinky_example as the following Fig.&lt;/P&gt;
&lt;P&gt;For the CTimer clock selection, I think you can use the line for 1MHz free running clock.&lt;/P&gt;
&lt;P&gt;CLOCK_AttachClk(kFRO1M_to_CTIMER2);&lt;/P&gt;
&lt;P&gt;For the period, you can modify:&lt;/P&gt;
&lt;P&gt;/* Configuration 0 */&lt;BR /&gt;matchConfig0.enableCounterReset = true;&lt;BR /&gt;matchConfig0.enableCounterStop = false;&lt;BR /&gt;matchConfig0.matchValue = 1000; //Rong wrote; to generate 1KHz interrupt&lt;BR /&gt;matchConfig0.outControl = kCTIMER_Output_Toggle;&lt;BR /&gt;matchConfig0.outPinInitState = false;&lt;BR /&gt;matchConfig0.enableInterrupt = true;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1650594540177.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/177664i90218D05FA272DBD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1650594540177.png" alt="xiangjun_rong_0-1650594540177.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_1-1650594860797.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/177665i46CC67380140EC5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_1-1650594860797.png" alt="xiangjun_rong_1-1650594860797.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 02:48:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-do-I-set-up-a-1khz-on-Ctimer-0-using-the-1MHz-Free-running/m-p/1447548#M48544</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-04-22T02:48:11Z</dc:date>
    </item>
  </channel>
</rss>

