<?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>S32 SDK中的主题 Periodic interrupt from LPTMR, using NXP S32K14x, S32DS for ARM and RTM SDK</title>
    <link>https://community.nxp.com/t5/S32-SDK/Periodic-interrupt-from-LPTMR-using-NXP-S32K14x-S32DS-for-ARM/m-p/837519#M686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use LPTMR to create a 1ms periodic interrupt for a bare metal simple scheduler. I'm programming for NXP's S32K144 using S32DS for ARM, with the S32K14x RTM SDK for GCC, version 2.0.0 (not the beta).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already added the LPTMR component to my project, and used component inspector to&amp;nbsp;adjust a timer configuration to suit. Right now, the config is as below:&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;-------------------&lt;/P&gt;&lt;P&gt;const lptmr_config_t lpTmr1_config0 = {&lt;BR /&gt; .workMode = LPTMR_WORKMODE_TIMER,&lt;BR /&gt; .dmaRequest = false,&lt;BR /&gt; .interruptEnable = true,&lt;BR /&gt; .freeRun = false,&lt;BR /&gt; .compareValue = 1000U,&lt;BR /&gt; .counterUnits = LPTMR_COUNTER_UNITS_MICROSECONDS,&lt;BR /&gt; .clockSelect = LPTMR_CLOCKSOURCE_RTC,&lt;BR /&gt; .prescaler = LPTMR_PRESCALE_4_GLITCHFILTER_2,&lt;BR /&gt; .bypassPrescaler = false,&lt;BR /&gt; .pinSelect = LPTMR_PINSELECT_TRGMUX,&lt;BR /&gt; .pinPolarity = LPTMR_PINPOLARITY_RISING,&lt;BR /&gt;};&lt;/P&gt;&lt;P style="padding: 0px;"&gt;-------------------&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P&gt;Also, I have created a custom&amp;nbsp;LPTMR0_IRQHandler() function;&lt;/P&gt;&lt;P&gt;And I have added some timer setup code to main():&lt;/P&gt;&lt;P style="padding: 0px;"&gt;Code:&lt;/P&gt;&lt;P style="padding: 0px;"&gt;-------------------&lt;/P&gt;&lt;P&gt;LPTMR_DRV_Init(INST_LPTMR1, &amp;amp;lpTmr1_config0, TRUE);&lt;/P&gt;&lt;P&gt;LPTMR_DRV_SetInterrupt(INST_LPTMR1, TRUE);&lt;/P&gt;&lt;P&gt;-------------------&lt;/P&gt;&lt;P&gt;However, while debugging, it seems that the interrupt handler is never executed.&lt;/P&gt;&lt;P&gt;What am I missing here?&lt;/P&gt;&lt;P&gt;Also, do I need to clear anything in LPTMR registers before leaving the ISR?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Joao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Dec 2018 18:37:49 GMT</pubDate>
    <dc:creator>Joao_Roscoe</dc:creator>
    <dc:date>2018-12-27T18:37:49Z</dc:date>
    <item>
      <title>Periodic interrupt from LPTMR, using NXP S32K14x, S32DS for ARM and RTM SDK</title>
      <link>https://community.nxp.com/t5/S32-SDK/Periodic-interrupt-from-LPTMR-using-NXP-S32K14x-S32DS-for-ARM/m-p/837519#M686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use LPTMR to create a 1ms periodic interrupt for a bare metal simple scheduler. I'm programming for NXP's S32K144 using S32DS for ARM, with the S32K14x RTM SDK for GCC, version 2.0.0 (not the beta).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already added the LPTMR component to my project, and used component inspector to&amp;nbsp;adjust a timer configuration to suit. Right now, the config is as below:&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;-------------------&lt;/P&gt;&lt;P&gt;const lptmr_config_t lpTmr1_config0 = {&lt;BR /&gt; .workMode = LPTMR_WORKMODE_TIMER,&lt;BR /&gt; .dmaRequest = false,&lt;BR /&gt; .interruptEnable = true,&lt;BR /&gt; .freeRun = false,&lt;BR /&gt; .compareValue = 1000U,&lt;BR /&gt; .counterUnits = LPTMR_COUNTER_UNITS_MICROSECONDS,&lt;BR /&gt; .clockSelect = LPTMR_CLOCKSOURCE_RTC,&lt;BR /&gt; .prescaler = LPTMR_PRESCALE_4_GLITCHFILTER_2,&lt;BR /&gt; .bypassPrescaler = false,&lt;BR /&gt; .pinSelect = LPTMR_PINSELECT_TRGMUX,&lt;BR /&gt; .pinPolarity = LPTMR_PINPOLARITY_RISING,&lt;BR /&gt;};&lt;/P&gt;&lt;P style="padding: 0px;"&gt;-------------------&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P&gt;Also, I have created a custom&amp;nbsp;LPTMR0_IRQHandler() function;&lt;/P&gt;&lt;P&gt;And I have added some timer setup code to main():&lt;/P&gt;&lt;P style="padding: 0px;"&gt;Code:&lt;/P&gt;&lt;P style="padding: 0px;"&gt;-------------------&lt;/P&gt;&lt;P&gt;LPTMR_DRV_Init(INST_LPTMR1, &amp;amp;lpTmr1_config0, TRUE);&lt;/P&gt;&lt;P&gt;LPTMR_DRV_SetInterrupt(INST_LPTMR1, TRUE);&lt;/P&gt;&lt;P&gt;-------------------&lt;/P&gt;&lt;P&gt;However, while debugging, it seems that the interrupt handler is never executed.&lt;/P&gt;&lt;P&gt;What am I missing here?&lt;/P&gt;&lt;P&gt;Also, do I need to clear anything in LPTMR registers before leaving the ISR?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Joao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2018 18:37:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/Periodic-interrupt-from-LPTMR-using-NXP-S32K14x-S32DS-for-ARM/m-p/837519#M686</guid>
      <dc:creator>Joao_Roscoe</dc:creator>
      <dc:date>2018-12-27T18:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Periodic interrupt from LPTMR, using NXP S32K14x, S32DS for ARM and RTM SDK</title>
      <link>https://community.nxp.com/t5/S32-SDK/Periodic-interrupt-from-LPTMR-using-NXP-S32K14x-S32DS-for-ARM/m-p/837520#M687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joao,&lt;/P&gt;&lt;P&gt;There is an SDK example that shows how to use it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/71278iDC6B3C14E3BA6B84/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you enabled the interrupt in the NVIC registers using:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/71334i33F922EB9ED4D9B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Yes, you need to clear the CSR_TCF flag.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/71390i4FB06E9821D3C854/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Dec 2018 18:30:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/Periodic-interrupt-from-LPTMR-using-NXP-S32K14x-S32DS-for-ARM/m-p/837520#M687</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-12-29T18:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Periodic interrupt from LPTMR, using NXP S32K14x, S32DS for ARM and RTM SDK</title>
      <link>https://community.nxp.com/t5/S32-SDK/Periodic-interrupt-from-LPTMR-using-NXP-S32K14x-S32DS-for-ARM/m-p/837521#M688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right on the spot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the interrupt enable&amp;nbsp;at setup and the compare flag clearing, in the interrupt handler, were missing. Added them, and now I have a minimalistic baremetal scheduler running.&lt;/P&gt;&lt;P&gt;I'm using the interrupt vectors already in place on flash, so the INT_SYS_InstallHandler part was not needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really nice, thank you for your time and attention.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2019 11:57:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/Periodic-interrupt-from-LPTMR-using-NXP-S32K14x-S32DS-for-ARM/m-p/837521#M688</guid>
      <dc:creator>Joao_Roscoe</dc:creator>
      <dc:date>2019-01-02T11:57:07Z</dc:date>
    </item>
  </channel>
</rss>

