<?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: Having trouble with TPM interrupt in output compare mode on FRDM-KL03Z with KSDK  in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Having-trouble-with-TPM-interrupt-in-output-compare-mode-on-FRDM/m-p/459678#M3373</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello sloat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After check your code , please check the "install interrupts" , then try again.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/53078iFD142DC4BDB2DA90/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If it still can not work well , you can send your project to me, then it can find the&lt;/P&gt;&lt;P&gt;problem facility with debug .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Dec 2015 09:50:06 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2015-12-04T09:50:06Z</dc:date>
    <item>
      <title>Having trouble with TPM interrupt in output compare mode on FRDM-KL03Z with KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Having-trouble-with-TPM-interrupt-in-output-compare-mode-on-FRDM/m-p/459677#M3372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the FRDM-KL03Z I'm having trouble with the TPM interrupt. I have used processor expert to configure TPM0 to run at 125 KHz in Output Compare Mode (with no pin output) with a Match Value of 125 (in order to generate a 1 ms interrupt). I have setup my PE options as follows:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="111017_111017.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120858i59E423CA8E35B06C/image-size/large?v=v2&amp;amp;px=999" role="button" title="111017_111017.png" alt="111017_111017.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Selection_184.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/53053iEC3C025648868767/image-size/large?v=v2&amp;amp;px=999" role="button" title="Selection_184.png" alt="Selection_184.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="111018_111018.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120859iEF6BC0518408C69B/image-size/large?v=v2&amp;amp;px=999" role="button" title="111018_111018.png" alt="111018_111018.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Selection_185.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/53094i5B36954A6227E73D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Selection_185.png" alt="Selection_185.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the following basic code to verify since the interrupt wasn't firing:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint32_t foo = 0, foo2 = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; TPM_DRV_CounterStart(general_timer_IDX, kTpmCountingUp, 65535U,false);&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foo2 = TPM_DRV_CounterRead(general_timer_IDX);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(foo2 &amp;gt;= 125)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foo = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interrupt function is in another file like this:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PE_ISR(general_timer_IRQHandler) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; soundBuzzer();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM_DRV_IRQHandler(general_timer_IDX);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am finding that the interrupt is not firing, but the timer is running properly ( I can see the value increment and I did some timing experiments with if statement). When I check the different TPM status registers after it is equal to or has passed 125 (match value) I see the following:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="111019_111019.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120860iC7C45D0F77C17A8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="111019_111019.png" alt="111019_111019.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Selection_187.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/53192iE20F4716457E21FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Selection_187.png" alt="Selection_187.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which means a couple of things, according to the datasheet, with TPM0_STATUS I should see a bit set when a channel event occurs, and obviously you see there is none. Also, I would think that TPM0_C0SC should have the MS &amp;amp; ELS bits set (4:2) and none are set, which would mean that according to the datasheet it would appear to be in "Channel Disabled" and not "Software Compare" like I think it should be:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="111021_111021.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/120861i0E145036176E23BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="111021_111021.png" alt="111021_111021.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Selection_189.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/53271i442C3F00C14DFD6D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Selection_189.png" alt="Selection_189.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following routines are being called (which they should be since the checkbox is checked to intialize the timer):&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void Components_Init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*! LED_GPIO_CONTROL Auto initialization start */&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIO_DRV_Init(gpio2_InpConfig0,LED_GPIO);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*! LED_GPIO_CONTROL Auto initialization end */&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*! OTHER_GPIO_CONTROL Auto initialization start */&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIO_DRV_Init(OTHER_GPIO_CONTROL_InpConfig0,OTHER_GPIO_CONTROL);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*! OTHER_GPIO_CONTROL Auto initialization end */&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*! general_timer Auto initialization start */&lt;/P&gt;&lt;P&gt;&amp;nbsp; NVIC_SetPriority(TPM0_IRQn, 0U);&lt;/P&gt;&lt;P&gt;&amp;nbsp; TPM_DRV_Init(general_timer_IDX, &amp;amp;timer);&lt;/P&gt;&lt;P&gt;&amp;nbsp; TPM_DRV_SetClock(general_timer_IDX, kTpmClockSourceModuleClk, kTpmDividedBy32);&lt;/P&gt;&lt;P&gt;&amp;nbsp; TPM_DRV_OutputCompareEnable(general_timer_IDX, 0U, kTpmOutputNone, 125, 65535U, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*! general_timer Auto initialization end */&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I my example code I also start the timer manually since this isn't done by the OutputCompareEnable function.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anways, not sure what is going on here, what am I missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 05:23:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Having-trouble-with-TPM-interrupt-in-output-compare-mode-on-FRDM/m-p/459677#M3372</guid>
      <dc:creator>ken_sloat</dc:creator>
      <dc:date>2015-12-03T05:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with TPM interrupt in output compare mode on FRDM-KL03Z with KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Having-trouble-with-TPM-interrupt-in-output-compare-mode-on-FRDM/m-p/459678#M3373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello sloat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After check your code , please check the "install interrupts" , then try again.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/53078iFD142DC4BDB2DA90/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If it still can not work well , you can send your project to me, then it can find the&lt;/P&gt;&lt;P&gt;problem facility with debug .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2015 09:50:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Having-trouble-with-TPM-interrupt-in-output-compare-mode-on-FRDM/m-p/459678#M3373</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-12-04T09:50:06Z</dc:date>
    </item>
  </channel>
</rss>

