<?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 simply function call periodically on MCF52235 in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simply-function-call-periodically-on-MCF52235/m-p/148984#M3682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I'm a begginer on this board.&lt;/DIV&gt;&lt;DIV&gt;I would like to call&amp;nbsp;my function for example every 10ms.&lt;/DIV&gt;&lt;DIV&gt;I don't at all the way I have to take. Does anyone help me: DMA timer, PIT, GPT, ...&lt;/DIV&gt;&lt;DIV&gt;thanks a lot for your help.&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by sev on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-04-21&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;09:49 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Apr 2008 15:48:34 GMT</pubDate>
    <dc:creator>sev</dc:creator>
    <dc:date>2008-04-21T15:48:34Z</dc:date>
    <item>
      <title>simply function call periodically on MCF52235</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simply-function-call-periodically-on-MCF52235/m-p/148984#M3682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I'm a begginer on this board.&lt;/DIV&gt;&lt;DIV&gt;I would like to call&amp;nbsp;my function for example every 10ms.&lt;/DIV&gt;&lt;DIV&gt;I don't at all the way I have to take. Does anyone help me: DMA timer, PIT, GPT, ...&lt;/DIV&gt;&lt;DIV&gt;thanks a lot for your help.&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by sev on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-04-21&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;09:49 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Apr 2008 15:48:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simply-function-call-periodically-on-MCF52235/m-p/148984#M3682</guid>
      <dc:creator>sev</dc:creator>
      <dc:date>2008-04-21T15:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: simply function call periodically on MCF52235</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simply-function-call-periodically-on-MCF52235/m-p/148985#M3683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi sev&lt;BR /&gt;&lt;BR /&gt;A PIT (periodic interrupt timer) is generally used for such work.&lt;BR /&gt;&lt;BR /&gt;It is very easy to set up but does require the interrupt controller to also be set up correctly. It may be easier for you to start with a complete project (see the uTasker project which is free for non-commercial use). Below&amp;nbsp; is the PIT0 code to configure a periodic interrupt (TICK_RESOLUTION would be 10 in your case) and then handle the interrupt, calling a function names fnRtmkSystemTick():&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;PRE&gt;// calculate the settings//#define REQUIRED_MS ((1000/TICK_RESOLUTION))                             // the TICK frequency we require in kHz#if TICK_RESOLUTION &amp;gt; 4  #if TICK_RESOLUTION &amp;gt; 64    #define TICK_DIVIDE (((BUS_CLOCK/2/32768) + REQUIRED_MS/2)/REQUIRED_MS) // the divide ratio required (32k prescaler assumed)    #define PIT_PRESCALE PIT_PRESCALE_32K  #else    #define TICK_DIVIDE (((BUS_CLOCK/2/4096) + REQUIRED_MS/2)/REQUIRED_MS)  // the divide ratio required (4k prescaler assumed)    #define PIT_PRESCALE PIT_PRESCALE_4K  #endif#else  #define TICK_DIVIDE (((BUS_CLOCK/2/1048) + REQUIRED_MS/2)/REQUIRED_MS)    // the divide ratio required (1k prescaler assumed)  #define PIT_PRESCALE  PIT_PRESCALE_1K#endif// TICK uses PIT 0//extern void fnStartTick(void){    PIT_PCSR_0 = (PIT_PRESCALE | PIT_DBG | PIT_OVW | PIT_PIF | PIT_RLD); // prepare for load    PIT_PMR_0 = (TICK_DIVIDE - 1);                                       // load interval value    fnSetIntHandler(PIT0_VECTOR, (unsigned char *)_RealTimeInterrupt);    IC_ICR_0_55 = TICK_INTERRUPT_PRIORITY;                               // define interrupt level and priority    IC_IMRH_0 &amp;amp;= ~(PIT_0_PIF_INT_H);                                     // unmask interrupt source    IC_IMRL_0 &amp;amp;= ~(MASK_ALL_INT);                                        // clear global mask    PIT_PCSR_0 = (PIT_PRESCALE | PIT_DBG | PIT_OVW | PIT_PIF | PIT_RLD | PIT_PIE | PIT_EN); // start PIT with interrupt enabled}static __interrupt__ void _RealTimeInterrupt(void){  PIT_PCSR_0 = (PIT_PRESCALE | PIT_DBG | PIT_OVW | PIT_PIF | PIT_RLD | PIT_PIE | PIT_EN); // reset interrupt request flag  fnRtmkSystemTick();                                                    // operating system tick}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTakser.com" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;www.uTakser.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:50:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/simply-function-call-periodically-on-MCF52235/m-p/148985#M3683</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T08:50:54Z</dc:date>
    </item>
  </channel>
</rss>

