<?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 PIT Interrupt in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-Interrupt/m-p/937797#M54261</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to write a program for the PIT module of the FRDM-KV31F board using MCUXPRESSO but the code gets stalled in the while loop.&lt;/P&gt;&lt;P&gt;Is this happening because I haven't provided an interrupt routine? What changes should I perform?&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Apurv Marathe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Aug 2019 06:51:04 GMT</pubDate>
    <dc:creator>maratheapurv</dc:creator>
    <dc:date>2019-08-01T06:51:04Z</dc:date>
    <item>
      <title>PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-Interrupt/m-p/937797#M54261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to write a program for the PIT module of the FRDM-KV31F board using MCUXPRESSO but the code gets stalled in the while loop.&lt;/P&gt;&lt;P&gt;Is this happening because I haven't provided an interrupt routine? What changes should I perform?&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Apurv Marathe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 06:51:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-Interrupt/m-p/937797#M54261</guid>
      <dc:creator>maratheapurv</dc:creator>
      <dc:date>2019-08-01T06:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-Interrupt/m-p/937798#M54262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code doesn't use interrupts, it just polls the timeout flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!(PIT-&amp;gt;CHANNEL[1].TFLG &amp;amp; PIT_TFLG_TIF_MASK))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; PTD-&amp;gt;PSOR |= 0x2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTD-&amp;gt;PCOR |= 0x2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would also quit after the first period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PTD-&amp;gt;PSOR |= 0x2; should really be PTD-&amp;gt;PSOR = 0x2;&lt;BR /&gt;and PTD-&amp;gt;PCOR |= 0x2; PTD-&amp;gt;PCOR = 0x2; although it will work as you have it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make it run forever you could do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while (1 != 0) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTD-&amp;gt;PSOR = 0x2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!(PIT-&amp;gt;CHANNEL[1].TFLG &amp;amp; PIT_TFLG_TIF_MASK)) {}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTD-&amp;gt;PCOR = 0x2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PIT-&amp;gt;CHANNEL[1].TFLG = PIT_TFLG_TIF_MASK; // clear flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!(PIT-&amp;gt;CHANNEL[1].TFLG &amp;amp; PIT_TFLG_TIF_MASK)) {}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PIT-&amp;gt;CHANNEL[1].TFLG = PIT_TFLG_TIF_MASK; // clear flag&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;(or similar).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your main issue that stops it working is your line&lt;/P&gt;&lt;P&gt;PIT-&amp;gt;MCR |= 0x0;&amp;nbsp; //activate pit module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MCR has the value 0x00000002 (disabled) out of reset and to start it one does&lt;/P&gt;&lt;P&gt;PIT-&amp;gt;MCR = 0x0; (and not PIT-&amp;gt;MCR |= 0x0; since this has no effect)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Complete Kinetis solutions for professional needs, training and support: &lt;A href="http://www.utasker.com/kinetis.html" target="test_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Kinetis KV31:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KV31F.html" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KV31F.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;uTasker: supporting &amp;gt;1'000 registered Kinetis users get products faster and cheaper to market&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;Request Free emergency remote desk-top consulting at &lt;A href="http://www.utasker.com/services.html" target="test_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Open Source version at &lt;A href="https://github.com/uTasker/uTasker-Kinetis" target="test_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 11:28:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-Interrupt/m-p/937798#M54262</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-08-01T11:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-Interrupt/m-p/937799#M54263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mark,&lt;/P&gt;&lt;P&gt;Thank you so much for your help!! That was such a silly mistake.&lt;/P&gt;&lt;P&gt;Thank you once again,&lt;/P&gt;&lt;P&gt;Apurv.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 11:56:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-Interrupt/m-p/937799#M54263</guid>
      <dc:creator>maratheapurv</dc:creator>
      <dc:date>2019-08-01T11:56:28Z</dc:date>
    </item>
  </channel>
</rss>

