<?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: PDB Interrupt in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174258#M1395</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;All zeros is the NVICs reset state. All Zeros will stop all interrupts above Int 15 from being passed through. Interrupts 0-15 are not connected through the NVIC. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should see one bit set for each active interrupt in the NVIC_ISER0 - NVIC_ISER31 registers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The PDB's interrupt must be enabled through one of the NVIC_ISERx registers. If I did my math correctly, it would be NVIC_SER2 bit 8. ( Register = ((Int 88-16) /32), Bit = ((Int 88-16)%32) ) That bit needs to be set for the PDB interrupt to get through to the core. The PDB interrupt will not work without the NVIC bit being set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I enable the NVIC bit at the same time I enable the interrupt. Your environment may be doing this for the other interrupts. Check to make sure this is happening.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2012 21:47:14 GMT</pubDate>
    <dc:creator>ndavies</dc:creator>
    <dc:date>2012-11-13T21:47:14Z</dc:date>
    <item>
      <title>PDB Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174255#M1392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking to use the PDB for one-shot interrupt generation (I'm not driving DACs or ADC, just looking for interrupt generation).&amp;nbsp; While I can get the Interrupt Flag (PDBIF) to go active I can't get my interrupt to actually vector.&amp;nbsp; I noticed in the PDB block diagram that the interrupt appears to be gated by TOEx.&amp;nbsp; But this is somewhat confusing, as I don't want to involve the DAC triggers at all.&amp;nbsp; Can anyone provide help?&amp;nbsp; What is the mystery setting to get interrupt to fire?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My setup code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Enable PDB clock&lt;/P&gt;&lt;P&gt;SIM-&amp;gt;SCGC6 |= SIM_SCGC6_PDB_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set timeout&lt;/P&gt;&lt;P&gt;PDB0-&amp;gt;IDLY = PDB_IDLY_IDLY(0x7fff);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PDB0-&amp;gt;SC =&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; PDB_SC_SWTRIG_MASK | // Software trigger&lt;/P&gt;&lt;P&gt;&amp;nbsp; PDB_SC_TRGSEL(0xF) | // Software trigger select&lt;/P&gt;&lt;P&gt;&amp;nbsp; PDB_SC_PDBEN_MASK&amp;nbsp; | // Enable PDB&lt;/P&gt;&lt;P&gt;&amp;nbsp; PDB_SC_PDBIE_MASK&amp;nbsp; | // Enable Interrupt&lt;/P&gt;&lt;P&gt;&amp;nbsp; PDB_SC_LDOK_MASK; // Load OK&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 13:50:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174255#M1392</guid>
      <dc:creator>pmt</dc:creator>
      <dc:date>2012-11-13T13:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: PDB Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174256#M1393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you enable the NVIC to pass the interrupt through to the processor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 20:29:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174256#M1393</guid>
      <dc:creator>ndavies</dc:creator>
      <dc:date>2012-11-13T20:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: PDB Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174257#M1394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn’t explicitly enable anything in the NVIC, but I think my environment already has this set up.  I’m not having any issues with any other interrupts such as UART, SPI, FTM, etc.  A quick scan in my debugger shows every NVIC register value at 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 21:11:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174257#M1394</guid>
      <dc:creator>pmt</dc:creator>
      <dc:date>2012-11-13T21:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: PDB Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174258#M1395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;All zeros is the NVICs reset state. All Zeros will stop all interrupts above Int 15 from being passed through. Interrupts 0-15 are not connected through the NVIC. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should see one bit set for each active interrupt in the NVIC_ISER0 - NVIC_ISER31 registers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The PDB's interrupt must be enabled through one of the NVIC_ISERx registers. If I did my math correctly, it would be NVIC_SER2 bit 8. ( Register = ((Int 88-16) /32), Bit = ((Int 88-16)%32) ) That bit needs to be set for the PDB interrupt to get through to the core. The PDB interrupt will not work without the NVIC bit being set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I enable the NVIC bit at the same time I enable the interrupt. Your environment may be doing this for the other interrupts. Check to make sure this is happening.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 21:47:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174258#M1395</guid>
      <dc:creator>ndavies</dc:creator>
      <dc:date>2012-11-13T21:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: PDB Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174259#M1396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yea, sigh…. That was it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NVIC_EnableIRQ(PDB0_IRQn);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interrupt is working now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 22:01:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174259#M1396</guid>
      <dc:creator>pmt</dc:creator>
      <dc:date>2012-11-13T22:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: PDB Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174260#M1397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a follow up.  There seems to be a race condition with this interrupt.  Using this ISR code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Instrumentation&lt;/P&gt;&lt;P&gt;static volatile uint_32 PdbCounter = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void PDB0_IRQHandler(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;                              PdbCounter++;&lt;/P&gt;&lt;P&gt;                              PDB0-&amp;gt;SC &amp;amp;= (~PDB_SC_PDBIF_MASK);&lt;/P&gt;&lt;P&gt;                              // Insert NOP to avoid ISR exit race condition&lt;/P&gt;&lt;P&gt;                              __asm("nop");&lt;/P&gt;&lt;P&gt;                              return;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On every software trigger my PcbCounter increments by 2 when the __asm(“nop”); is removed, but increments by 1 with the nop included.  Seems like the interrupt flag condition does not clear fast enough.  Perhaps because the peripheral clock is slower than the core clock?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 14:48:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174260#M1397</guid>
      <dc:creator>pmt</dc:creator>
      <dc:date>2012-11-14T14:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: PDB Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174261#M1398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've seen this on other ARM processors as well - what you're seeing is not unique to Kinetis. It's because the interrupt clear hasn't had time to propagate through the NVIC before you exit the ISR, resulting in you immediately re-entering your ISR. One solution is what you suggest, putting a nop at the end of your code, to give a little more time after the clear. Another possibility (and is what I do) is to clear the interrupt at the very start of your ISR. In your ISR example, swap the first two lines of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 16:20:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Interrupt/m-p/174261#M1398</guid>
      <dc:creator>frankvanhooft</dc:creator>
      <dc:date>2012-11-27T16:20:20Z</dc:date>
    </item>
  </channel>
</rss>

