<?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>Kinetis MicrocontrollersのトピックPIT interrupt handler not triggered on KL26Z</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-interrupt-handler-not-triggered-on-KL26Z/m-p/1626455#M64908</link>
    <description>&lt;P&gt;I have a FRDM-KL26Z board I am trying to use PIT to get an interrupt, but it fails.&lt;/P&gt;&lt;P&gt;Things that I am doing:&lt;/P&gt;&lt;P&gt;- declare the PIT handler that should print a line of text&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void PIT_IRQHandler(void)
{
	PRINTF("PIT_IRQHandler \r\n");
}&lt;/LI-CODE&gt;&lt;P&gt;- set-up PIT&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    unsigned int *sim_scgc6 = (unsigned int *) 0x4004803C;
    *sim_scgc6 |= 1U &amp;lt;&amp;lt; 23; // enable clock gate PIT

    unsigned int *pit_mcr = (unsigned int *) 0x40037000;
    *pit_mcr &amp;amp;= ~(1U &amp;lt;&amp;lt; 1); // enable PIT
    *pit_mcr &amp;amp;= ~(1U &amp;lt;&amp;lt; 0); // timer continues in debug mode

    unsigned int *pit_ldval0 = (unsigned int *) 0x40037100;
    // *pit_ldval0 = 0x0003E7FF; // setup timer 1 for 256000 cycles
    *pit_ldval0 = 0xF;

    unsigned int *pit_tctrl0 = (unsigned int *) 0x40037108;
    *pit_tctrl0 |= 1U &amp;lt;&amp;lt; 1; // enable interrupt
    *pit_tctrl0 |= 1U; // start timer&lt;/LI-CODE&gt;&lt;P&gt;- then enter an infinite loop&lt;/P&gt;&lt;P&gt;I am not getting the line from the PIT handler.&lt;/P&gt;&lt;P&gt;I have attached the full code. Is it something that I am missing? In debug mode I see the timer changing and the TIF flag is set, but the handler is not executed.&lt;/P&gt;</description>
    <pubDate>Sun, 02 Apr 2023 14:37:11 GMT</pubDate>
    <dc:creator>mihaineken</dc:creator>
    <dc:date>2023-04-02T14:37:11Z</dc:date>
    <item>
      <title>PIT interrupt handler not triggered on KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-interrupt-handler-not-triggered-on-KL26Z/m-p/1626455#M64908</link>
      <description>&lt;P&gt;I have a FRDM-KL26Z board I am trying to use PIT to get an interrupt, but it fails.&lt;/P&gt;&lt;P&gt;Things that I am doing:&lt;/P&gt;&lt;P&gt;- declare the PIT handler that should print a line of text&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void PIT_IRQHandler(void)
{
	PRINTF("PIT_IRQHandler \r\n");
}&lt;/LI-CODE&gt;&lt;P&gt;- set-up PIT&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    unsigned int *sim_scgc6 = (unsigned int *) 0x4004803C;
    *sim_scgc6 |= 1U &amp;lt;&amp;lt; 23; // enable clock gate PIT

    unsigned int *pit_mcr = (unsigned int *) 0x40037000;
    *pit_mcr &amp;amp;= ~(1U &amp;lt;&amp;lt; 1); // enable PIT
    *pit_mcr &amp;amp;= ~(1U &amp;lt;&amp;lt; 0); // timer continues in debug mode

    unsigned int *pit_ldval0 = (unsigned int *) 0x40037100;
    // *pit_ldval0 = 0x0003E7FF; // setup timer 1 for 256000 cycles
    *pit_ldval0 = 0xF;

    unsigned int *pit_tctrl0 = (unsigned int *) 0x40037108;
    *pit_tctrl0 |= 1U &amp;lt;&amp;lt; 1; // enable interrupt
    *pit_tctrl0 |= 1U; // start timer&lt;/LI-CODE&gt;&lt;P&gt;- then enter an infinite loop&lt;/P&gt;&lt;P&gt;I am not getting the line from the PIT handler.&lt;/P&gt;&lt;P&gt;I have attached the full code. Is it something that I am missing? In debug mode I see the timer changing and the TIF flag is set, but the handler is not executed.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2023 14:37:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-interrupt-handler-not-triggered-on-KL26Z/m-p/1626455#M64908</guid>
      <dc:creator>mihaineken</dc:creator>
      <dc:date>2023-04-02T14:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: PIT interrupt handler not triggered on KL26Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-interrupt-handler-not-triggered-on-KL26Z/m-p/1627176#M64919</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You can find some examples of PIT that can guide you on your design on SDK&amp;nbsp; (&lt;/SPAN&gt;&lt;A href="https://mcuxpresso.nxp.com/en/welcome" target="_blank"&gt;&lt;SPAN&gt;https://mcuxpresso.nxp.com/en/welcome&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 01:28:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PIT-interrupt-handler-not-triggered-on-KL26Z/m-p/1627176#M64919</guid>
      <dc:creator>CarlosGarabito</dc:creator>
      <dc:date>2023-04-04T01:28:34Z</dc:date>
    </item>
  </channel>
</rss>

