<?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: LPC54102 - SCT does not interrupt for each event wanted! in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623102#M24455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the implementation of the Chip_SCT_ClearEventFlag function. It should contain a plain assignment to EVFLAG, not a read-modify-write operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wrong: &amp;nbsp;&amp;nbsp; pSCT-&amp;gt;EVFLAG |= evt;&lt;/P&gt;&lt;P&gt;Right: &amp;nbsp;&amp;nbsp;&amp;nbsp; pSCT-&amp;gt;EVFLAG = evt;&lt;/P&gt;&lt;P&gt;I've seen that mistake in other LPCOpen versions before, not sure about the LPC5410x version though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Sep 2016 08:54:52 GMT</pubDate>
    <dc:creator>rolfmeeser</dc:creator>
    <dc:date>2016-09-16T08:54:52Z</dc:date>
    <item>
      <title>LPC54102 - SCT does not interrupt for each event wanted!</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623101#M24454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want SCT of&amp;nbsp;LPC54102 to interrupt 3 times on 3 distinguished events, but it will interrupt only one time showing flags of interrupts for all of them in the&amp;nbsp;EVFLAG register. And when I clear one flag, it will clear all.&lt;/P&gt;&lt;P&gt;I mention that I set each event&amp;nbsp;to happen only on a match condition, and the 3 events have different&amp;nbsp;&lt;SPAN&gt;matching values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I copy the code here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The interrupt soubroutine:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;void SCT0_IRQHandler(void)&lt;BR /&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;numInt++;&lt;BR /&gt; evFlag = LPC_SCT-&amp;gt;EVFLAG;&lt;/P&gt;&lt;P&gt;if ( LPC_SCT-&amp;gt;EVFLAG &amp;amp; SCT_EVT_0)&lt;BR /&gt; {&lt;BR /&gt; numInt0++;&lt;BR /&gt; Chip_SCT_ClearEventFlag(LPC_SCT, SCT_EVT_0);&lt;BR /&gt; evFlag0 = LPC_SCT-&amp;gt;EVFLAG;&lt;BR /&gt; }&lt;BR /&gt; if ( LPC_SCT-&amp;gt;EVFLAG &amp;amp; SCT_EVT_1)&lt;BR /&gt; {&lt;BR /&gt; numInt1++;&lt;BR /&gt; Chip_SCT_ClearEventFlag(LPC_SCT, SCT_EVT_1);&lt;BR /&gt; evFlag1 = LPC_SCT-&amp;gt;EVFLAG;&lt;BR /&gt; }&lt;BR /&gt; if ( LPC_SCT-&amp;gt;EVFLAG &amp;amp; SCT_EVT_2)&lt;BR /&gt; {&lt;BR /&gt; numInt2++;&lt;BR /&gt; Chip_SCT_ClearEventFlag(LPC_SCT, SCT_EVT_2);&lt;BR /&gt; evFlag2 = LPC_SCT-&amp;gt;EVFLAG;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I display the variables incremented inside the ISR, and I can see that&amp;nbsp;&lt;SPAN&gt;numInt =&amp;nbsp;numInt0 = 1,&amp;nbsp;evFlag = 0x7, and after first clear&amp;nbsp;evFlag0 = 0x00.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Never it will reach the other checking.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So it will interrupt only one time instead of 3 times at different time values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And here it is the code of initialization:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Chip_SCT_Init(LPC_SCT);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chip_SCT_Config(LPC_SCT,&lt;BR /&gt; SCT_CONFIG_32BIT_COUNTER | SCT_CONFIG_CLKMODE_BUSCLK);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Chip_SCT_SetMatchCount(LPC_SCT, SCT_MATCH_0, 100);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SCT-&amp;gt;EVENT[0].CTRL = (1 &amp;lt;&amp;lt; 12);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SCT-&amp;gt;EVENT[0].STATE = 0x00000001;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chip_SCT_SetMatchCount(LPC_SCT, SCT_MATCH_1, 200);&lt;BR /&gt; LPC_SCT-&amp;gt;EVENT[1].CTRL = (1 &amp;lt;&amp;lt; 12);&lt;BR /&gt; LPC_SCT-&amp;gt;EVENT[1].STATE = 0x00000001;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chip_SCT_SetMatchCount(LPC_SCT, SCT_MATCH_2, 300);&lt;BR /&gt; LPC_SCT-&amp;gt;EVENT[2].CTRL = (1 &amp;lt;&amp;lt; 12);&lt;BR /&gt; LPC_SCT-&amp;gt;EVENT[2].STATE = 0x00000001;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chip_SCT_EnableEventInt(LPC_SCT, SCT_EVT_0);&lt;BR /&gt; Chip_SCT_EnableEventInt(LPC_SCT, SCT_EVT_1);&lt;BR /&gt; Chip_SCT_EnableEventInt(LPC_SCT, SCT_EVT_2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NVIC_EnableIRQ(SCT0_IRQn);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chip_SCT_ClearControl(LPC_SCT, SCT_CTRL_HALT_L);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would really apreciate some help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Doini&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 03:07:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623101#M24454</guid>
      <dc:creator>doini</dc:creator>
      <dc:date>2016-09-16T03:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 - SCT does not interrupt for each event wanted!</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623102#M24455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the implementation of the Chip_SCT_ClearEventFlag function. It should contain a plain assignment to EVFLAG, not a read-modify-write operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wrong: &amp;nbsp;&amp;nbsp; pSCT-&amp;gt;EVFLAG |= evt;&lt;/P&gt;&lt;P&gt;Right: &amp;nbsp;&amp;nbsp;&amp;nbsp; pSCT-&amp;gt;EVFLAG = evt;&lt;/P&gt;&lt;P&gt;I've seen that mistake in other LPCOpen versions before, not sure about the LPC5410x version though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 08:54:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623102#M24455</guid>
      <dc:creator>rolfmeeser</dc:creator>
      <dc:date>2016-09-16T08:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 - SCT does not interrupt for each event wanted!</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623103#M24456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rolf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your answer, I modified that to&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Right: &amp;nbsp;&amp;nbsp;&amp;nbsp; pSCT-&amp;gt;EVFLAG = evt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But still my problem persist: The program is supposed to interrupt first time after &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;MATCH_0 (100&lt;/SPAN&gt;) counts, to&amp;nbsp;&lt;SPAN&gt;interrupt&lt;/SPAN&gt;&amp;nbsp;the second time after &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;MATCH_1 (200) counts, and &lt;SPAN style="color: #3d3d3d;"&gt;to interrupt the&lt;/SPAN&gt;&amp;nbsp;third time after&amp;nbsp;&lt;SPAN&gt;MATCH_2 (300) counts. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;But it will interrupt only after&amp;nbsp;MATCH_0 (100&lt;SPAN style="color: #3d3d3d;"&gt;) counts, the&amp;nbsp;EVFLAG shows 3 pending interrupts, and after that it will not interrupt at 200 and 300 counts anymore.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;If I clear only one interrupt in the ISR, it will interrupt right away with the other pending flags, and again until all flags are cleared, but still the COUNT shows 100, and never will interrupt at 200 and 300 counts.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;I would really appreciate any&amp;nbsp;help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Doini&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 20:53:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623103#M24456</guid>
      <dc:creator>doini</dc:creator>
      <dc:date>2016-09-16T20:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 - SCT does not interrupt for each event wanted!</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623104#M24457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Doini,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok, so individual acknowledge of events is now working, that's fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking closer at your initialization code, I saw that all your events are triggered at the same time! Example:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;LPC_SCT-&amp;gt;EVENT[2].CTRL = (1 &amp;lt;&amp;lt; 12);&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;This leaves the MATCHSEL field unconfigured (=0), which means that event 2 (like event 0 and event 1) is triggered by a match of the counter with MATCH0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;I guess what you want is this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;LPC_SCT-&amp;gt;EVENT[2].CTRL = (1 &amp;lt;&amp;lt; 12) | (2 &amp;lt;&amp;lt; 0); &amp;nbsp;// Compare with MATCH2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;Rolf&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2016 09:22:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623104#M24457</guid>
      <dc:creator>rolfmeeser</dc:creator>
      <dc:date>2016-09-19T09:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 - SCT does not interrupt for each event wanted!</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623105#M24458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rolf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply, it was useful.&lt;/P&gt;&lt;P&gt;I set a MATCH register for each event and it worked for one of my examples.&lt;/P&gt;&lt;P&gt;But when I set the 3 SCT events to interrupt at very small intervals of time, in the order of several hundred nano-seconds (the system frequency is 96MHz), it interrupted only one time with the flags set for all 3 events.&lt;/P&gt;&lt;P&gt;And I have this problem also with the DMA interrupts on 3 channels triggered at&amp;nbsp;&lt;SPAN&gt;very small intervals of time, which interrupt only one time and not 3 times. I posted a question about that with the title:&amp;nbsp;&lt;A _jive_internal="true" data-content-finding="Community" href="https://community.nxp.com/thread/435140" style="color: #5e89c1; background-color: #f8fbfe; border: 0px; text-decoration: underline;"&gt;LPC54102 - DMA on 3 channels interrupts only one time instead of 3 times!&lt;/A&gt;&amp;nbsp;on this forum, would you like to take a look at that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would really appreciate your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Doinita&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 06:35:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-SCT-does-not-interrupt-for-each-event-wanted/m-p/623105#M24458</guid>
      <dc:creator>doini</dc:creator>
      <dc:date>2016-09-21T06:35:56Z</dc:date>
    </item>
  </channel>
</rss>

