<?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>MPC5xxxのトピックMPC5644A System Timer Module problem</title>
    <link>https://community.nxp.com/t5/MPC5xxx/MPC5644A-System-Timer-Module-problem/m-p/497603#M2792</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to play with the System Timer Module on this processor, I would like to have an interrupt every 500 us with a system clock of 120 MHz. I programmed the STM prescaler to 119 (0x77) to have 1 MHz timer clock,then I programmed the STM channel 0 compare register to 0x000001F4 (to have 500 us interrupt).What I obtained is only one interrupt is generated, then no more STM interrupr generated.&lt;/P&gt;&lt;P&gt;At the end of the STM ISR, I correctly clear the channel 0 interrupt flag, after that I'm no longer able to have STM interrupt.&lt;/P&gt;&lt;P&gt;I'm using CodeWarrior Development studio&amp;nbsp; 10.6.4.&lt;/P&gt;&lt;P&gt;I have not seen on the MPC5644A hardware manual some particular sequence to program the registers, below my code, please can someone help me?&lt;/P&gt;&lt;P&gt;Best regards to you all.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STM.CR.R =&amp;nbsp;&amp;nbsp; 0x00007700;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Prescaler 0x77&lt;/P&gt;&lt;P&gt;STM.CCR0.R = 0x00000001; // Enable STM Channel 0&lt;/P&gt;&lt;P&gt;STM.CMP0.R = 0x000001F4; // Compare register 0 (500 us)&lt;/P&gt;&lt;P&gt;STM.CR.R |= 0x00000001;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enable timer&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below the STM channel 0 ISR (now it is empty just to evaluate if the interrupt is scheduled correctly)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void STM0_Isr(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (STM.CIR0.R &amp;amp;&amp;amp; 0x00000001)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STM.CIR0.R = 0x00000001;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Mar 2016 16:34:37 GMT</pubDate>
    <dc:creator>Gelby</dc:creator>
    <dc:date>2016-03-22T16:34:37Z</dc:date>
    <item>
      <title>MPC5644A System Timer Module problem</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5644A-System-Timer-Module-problem/m-p/497603#M2792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to play with the System Timer Module on this processor, I would like to have an interrupt every 500 us with a system clock of 120 MHz. I programmed the STM prescaler to 119 (0x77) to have 1 MHz timer clock,then I programmed the STM channel 0 compare register to 0x000001F4 (to have 500 us interrupt).What I obtained is only one interrupt is generated, then no more STM interrupr generated.&lt;/P&gt;&lt;P&gt;At the end of the STM ISR, I correctly clear the channel 0 interrupt flag, after that I'm no longer able to have STM interrupt.&lt;/P&gt;&lt;P&gt;I'm using CodeWarrior Development studio&amp;nbsp; 10.6.4.&lt;/P&gt;&lt;P&gt;I have not seen on the MPC5644A hardware manual some particular sequence to program the registers, below my code, please can someone help me?&lt;/P&gt;&lt;P&gt;Best regards to you all.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STM.CR.R =&amp;nbsp;&amp;nbsp; 0x00007700;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Prescaler 0x77&lt;/P&gt;&lt;P&gt;STM.CCR0.R = 0x00000001; // Enable STM Channel 0&lt;/P&gt;&lt;P&gt;STM.CMP0.R = 0x000001F4; // Compare register 0 (500 us)&lt;/P&gt;&lt;P&gt;STM.CR.R |= 0x00000001;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enable timer&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below the STM channel 0 ISR (now it is empty just to evaluate if the interrupt is scheduled correctly)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void STM0_Isr(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (STM.CIR0.R &amp;amp;&amp;amp; 0x00000001)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STM.CIR0.R = 0x00000001;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2016 16:34:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5644A-System-Timer-Module-problem/m-p/497603#M2792</guid>
      <dc:creator>Gelby</dc:creator>
      <dc:date>2016-03-22T16:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5644A System Timer Module problem</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5644A-System-Timer-Module-problem/m-p/497604#M2793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is free-running timer thus in case counter achieves value defined in compare register, counter continues without restarting. It would be needed to stop the timer, reset counter value and enable again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or much better solution is to use Periodic Interrupt Timer (PIT) that be suitable for it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 11:24:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5644A-System-Timer-Module-problem/m-p/497604#M2793</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2016-03-23T11:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5644A System Timer Module problem</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5644A-System-Timer-Module-problem/m-p/497605#M2794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Absolutely right&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 02:42:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5644A-System-Timer-Module-problem/m-p/497605#M2794</guid>
      <dc:creator>yachuanliu</dc:creator>
      <dc:date>2016-04-06T02:42:56Z</dc:date>
    </item>
  </channel>
</rss>

