<?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 Capture problem with SCT on LPC824 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646482#M25573</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;I'm trying to use the SCT for decoding the RC-5 (remote control) protocol.&lt;/P&gt;&lt;P&gt;I've configured the SCT to count the low and high bit times, using an input pin and two events. Unfortunately, in my interrupt handling code, the captured times are often (not always) reported to be 0. If they are non-zero they usually have a value that can be expected. Any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've added a drawing of a shorted RC-5 pulse train and where I expect the events.&lt;/P&gt;&lt;P&gt;Event 2 is configured to capture on a rising edge, start the counter and limit the counter&lt;/P&gt;&lt;P&gt;Event 3 is configured to capture on a falling edge, limit the counter and request an interrupt&lt;/P&gt;&lt;P&gt;Event 4 is configured to stop and limit the counter after a match condition (to catch a timeout).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My configuration is as follows:&lt;/P&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Enable the SCT Timer for PWM and RC-5 decoder&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SCT);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;Chip_SCT_Init(LPC_SCT);&lt;/CODE&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;//Configure the input pin for input 0
&lt;/CODE&gt;&lt;CODE class=""&gt;Chip_SWM_MovablePinAssign(SWM_SCT_IN0_I, 17);&lt;/CODE&gt;
&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;CODE class=""&gt;Chip_INMUX_SetSCTInMux(LPC_INMUX,SCT_INMUX_0,SCT_INP_IN0);
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Regs 2 and 3 are capture, reg 4 is match (0,1 are in use by the L counter as match regs for PWM)&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;REGMODE_H=(1&amp;lt;&amp;lt;2)|(1&amp;lt;&amp;lt;3);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Set the capture regs to capture on the events&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;CAPCTRL[2].H=(1&amp;lt;&amp;lt;2);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;CAPCTRL[3].H=(1&amp;lt;&amp;lt;3);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Set the match reg for the timeout&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;MATCH[4].H=2*MAX_FULL_BIT;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;MATCHREL[4].H=2*MAX_FULL_BIT;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Configure the events&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[2].CTRL=(1&amp;lt;&amp;lt;4) | (0x1 &amp;lt;&amp;lt; 10) | (0x2 &amp;lt;&amp;lt; 12); &lt;/CODE&gt;&lt;CODE class=""&gt;//Select H timer, Rising input only&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[3].CTRL=(1&amp;lt;&amp;lt;4) | (0x2 &amp;lt;&amp;lt; 10) | (0x2 &amp;lt;&amp;lt; 12); &lt;/CODE&gt;&lt;CODE class=""&gt;//Select H timer, falling input only&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[4].CTRL=(4) | (1&amp;lt;&amp;lt;4) | (0x1 &amp;lt;&amp;lt; 12); &lt;/CODE&gt;&lt;CODE class=""&gt;//Select H timer, match reg 4 only&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Enable the events in state 0 (the only state used)&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[2].STATE=0x1; &lt;/CODE&gt;&lt;CODE class=""&gt;//Enable in state 0&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[3].STATE=0x1; &lt;/CODE&gt;&lt;CODE class=""&gt;//Enable in state 0&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[4].STATE=0x1; &lt;/CODE&gt;&lt;CODE class=""&gt;//Enable in state 0&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Configure the start, stop and limit behaviour&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;LIMIT_H=(1&amp;lt;&amp;lt;2)|(1&amp;lt;&amp;lt;3))|(1&amp;lt;&amp;lt;4); //All events limit&lt;BR /&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;START_H=(1&amp;lt;&amp;lt;2); &lt;/CODE&gt;&lt;CODE class=""&gt;//Start when a rising edge is detected&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;STOP_H =(1&amp;lt;&amp;lt;4); &lt;/CODE&gt;&lt;CODE class=""&gt;//Stop after the timeout&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Enable the interrupts&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EVEN=(1&amp;lt;&amp;lt;3)|(1&amp;lt;&amp;lt;4);&lt;/CODE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;CTRL_H = (31&amp;lt;&amp;lt;5) &lt;/CODE&gt;&lt;CODE class=""&gt;| 0x2&lt;/CODE&gt;&lt;CODE class=""&gt;; &lt;/CODE&gt;&lt;CODE class=""&gt;//Divide by 32 for microsecond resolution, set counter in stop mode&lt;/CODE&gt;&lt;/P&gt;&lt;DIV class=""&gt; &lt;/DIV&gt;&lt;DIV class=""&gt;The interrupt code is as follows:&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;CODE class=""&gt;void&lt;/CODE&gt; &lt;CODE class=""&gt;SCT_IRQHandler(&lt;/CODE&gt;&lt;CODE class=""&gt;void&lt;/CODE&gt;&lt;CODE class=""&gt;) {&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;if&lt;/CODE&gt; &lt;CODE class=""&gt;(LPC_SCT-&amp;gt;EVFLAG&amp;amp;SCT_EVT_4) {&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;//Timeout, check received bits
&lt;/CODE&gt;&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;&lt;CODE class=""&gt;Chip_SCT_ClearEventFlag(LPC_SCT, SCT_EVT_4);&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;} &lt;/CODE&gt;&lt;CODE class=""&gt;else&lt;/CODE&gt; &lt;CODE class=""&gt;{&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;Chip_SCT_ClearEventFlag(LPC_SCT, SCT_EVT_3);&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;int&lt;/CODE&gt; &lt;CODE class=""&gt;lowTime=LPC_SCT-&amp;gt;CAP[2].H;&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;int&lt;/CODE&gt; &lt;CODE class=""&gt;highTime=LPC_SCT-&amp;gt;CAP[3].H;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Do actual decoding of bit(s). But lowTime and highTime are often 0....&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;}&lt;/CODE&gt;
&lt;CODE class=""&gt;}&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;CODE class=""&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;In the debugger the capture registers are never 0, but between the time the breakpoint is hit and the IDE is updated, a lot of additional events occur I assume...&lt;/P&gt;&lt;P&gt;I've no idea on how to proceed from here...&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;Remco Poelstra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Apr 2017 10:38:36 GMT</pubDate>
    <dc:creator>remco2</dc:creator>
    <dc:date>2017-04-04T10:38:36Z</dc:date>
    <item>
      <title>Capture problem with SCT on LPC824</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646482#M25573</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;I'm trying to use the SCT for decoding the RC-5 (remote control) protocol.&lt;/P&gt;&lt;P&gt;I've configured the SCT to count the low and high bit times, using an input pin and two events. Unfortunately, in my interrupt handling code, the captured times are often (not always) reported to be 0. If they are non-zero they usually have a value that can be expected. Any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've added a drawing of a shorted RC-5 pulse train and where I expect the events.&lt;/P&gt;&lt;P&gt;Event 2 is configured to capture on a rising edge, start the counter and limit the counter&lt;/P&gt;&lt;P&gt;Event 3 is configured to capture on a falling edge, limit the counter and request an interrupt&lt;/P&gt;&lt;P&gt;Event 4 is configured to stop and limit the counter after a match condition (to catch a timeout).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My configuration is as follows:&lt;/P&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Enable the SCT Timer for PWM and RC-5 decoder&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SCT);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;Chip_SCT_Init(LPC_SCT);&lt;/CODE&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;//Configure the input pin for input 0
&lt;/CODE&gt;&lt;CODE class=""&gt;Chip_SWM_MovablePinAssign(SWM_SCT_IN0_I, 17);&lt;/CODE&gt;
&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;CODE class=""&gt;Chip_INMUX_SetSCTInMux(LPC_INMUX,SCT_INMUX_0,SCT_INP_IN0);
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Regs 2 and 3 are capture, reg 4 is match (0,1 are in use by the L counter as match regs for PWM)&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;REGMODE_H=(1&amp;lt;&amp;lt;2)|(1&amp;lt;&amp;lt;3);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Set the capture regs to capture on the events&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;CAPCTRL[2].H=(1&amp;lt;&amp;lt;2);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;CAPCTRL[3].H=(1&amp;lt;&amp;lt;3);&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Set the match reg for the timeout&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;MATCH[4].H=2*MAX_FULL_BIT;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;MATCHREL[4].H=2*MAX_FULL_BIT;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Configure the events&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[2].CTRL=(1&amp;lt;&amp;lt;4) | (0x1 &amp;lt;&amp;lt; 10) | (0x2 &amp;lt;&amp;lt; 12); &lt;/CODE&gt;&lt;CODE class=""&gt;//Select H timer, Rising input only&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[3].CTRL=(1&amp;lt;&amp;lt;4) | (0x2 &amp;lt;&amp;lt; 10) | (0x2 &amp;lt;&amp;lt; 12); &lt;/CODE&gt;&lt;CODE class=""&gt;//Select H timer, falling input only&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[4].CTRL=(4) | (1&amp;lt;&amp;lt;4) | (0x1 &amp;lt;&amp;lt; 12); &lt;/CODE&gt;&lt;CODE class=""&gt;//Select H timer, match reg 4 only&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Enable the events in state 0 (the only state used)&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[2].STATE=0x1; &lt;/CODE&gt;&lt;CODE class=""&gt;//Enable in state 0&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[3].STATE=0x1; &lt;/CODE&gt;&lt;CODE class=""&gt;//Enable in state 0&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EV[4].STATE=0x1; &lt;/CODE&gt;&lt;CODE class=""&gt;//Enable in state 0&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Configure the start, stop and limit behaviour&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;LIMIT_H=(1&amp;lt;&amp;lt;2)|(1&amp;lt;&amp;lt;3))|(1&amp;lt;&amp;lt;4); //All events limit&lt;BR /&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;START_H=(1&amp;lt;&amp;lt;2); &lt;/CODE&gt;&lt;CODE class=""&gt;//Start when a rising edge is detected&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;STOP_H =(1&amp;lt;&amp;lt;4); &lt;/CODE&gt;&lt;CODE class=""&gt;//Stop after the timeout&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;//Enable the interrupts&lt;/CODE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;EVEN=(1&amp;lt;&amp;lt;3)|(1&amp;lt;&amp;lt;4);&lt;/CODE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;CODE class=""&gt;LPC_SCT-&amp;gt;CTRL_H = (31&amp;lt;&amp;lt;5) &lt;/CODE&gt;&lt;CODE class=""&gt;| 0x2&lt;/CODE&gt;&lt;CODE class=""&gt;; &lt;/CODE&gt;&lt;CODE class=""&gt;//Divide by 32 for microsecond resolution, set counter in stop mode&lt;/CODE&gt;&lt;/P&gt;&lt;DIV class=""&gt; &lt;/DIV&gt;&lt;DIV class=""&gt;The interrupt code is as follows:&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;CODE class=""&gt;void&lt;/CODE&gt; &lt;CODE class=""&gt;SCT_IRQHandler(&lt;/CODE&gt;&lt;CODE class=""&gt;void&lt;/CODE&gt;&lt;CODE class=""&gt;) {&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;if&lt;/CODE&gt; &lt;CODE class=""&gt;(LPC_SCT-&amp;gt;EVFLAG&amp;amp;SCT_EVT_4) {&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;//Timeout, check received bits
&lt;/CODE&gt;&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;&lt;CODE class=""&gt;Chip_SCT_ClearEventFlag(LPC_SCT, SCT_EVT_4);&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;} &lt;/CODE&gt;&lt;CODE class=""&gt;else&lt;/CODE&gt; &lt;CODE class=""&gt;{&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;Chip_SCT_ClearEventFlag(LPC_SCT, SCT_EVT_3);&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;int&lt;/CODE&gt; &lt;CODE class=""&gt;lowTime=LPC_SCT-&amp;gt;CAP[2].H;&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;int&lt;/CODE&gt; &lt;CODE class=""&gt;highTime=LPC_SCT-&amp;gt;CAP[3].H;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Do actual decoding of bit(s). But lowTime and highTime are often 0....&lt;/CODE&gt;
&lt;CODE class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;CODE class=""&gt;}&lt;/CODE&gt;
&lt;CODE class=""&gt;}&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;CODE class=""&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;In the debugger the capture registers are never 0, but between the time the breakpoint is hit and the IDE is updated, a lot of additional events occur I assume...&lt;/P&gt;&lt;P&gt;I've no idea on how to proceed from here...&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;Remco Poelstra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2017 10:38:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646482#M25573</guid>
      <dc:creator>remco2</dc:creator>
      <dc:date>2017-04-04T10:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Capture problem with SCT on LPC824</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646483#M25574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Remco Poelstra,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I share a LPC824 SCT capture code with you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can find it from the attachment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; This code has been test on my side, the captured data is changing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please check my attached project, this is the test result on my side:&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/18911i069C98A07724EE72/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;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 09:16:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646483#M25574</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-04-07T09:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Capture problem with SCT on LPC824</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646484#M25575</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;Thanks! I'll check it out!&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;Remco Poelstra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:10:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646484#M25575</guid>
      <dc:creator>remco2</dc:creator>
      <dc:date>2017-04-07T15:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Capture problem with SCT on LPC824</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646485#M25576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Remco Poelstra,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; You are welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please check it at first, any question, just let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Apr 2017 04:51:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646485#M25576</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-04-10T04:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Capture problem with SCT on LPC824</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646486#M25577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/kerryzhou"&gt;kerryzhou&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we count the frequency using capture, my capture is working. What is the basic of Timer Capture&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 18:02:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646486#M25577</guid>
      <dc:creator>athmesh_n</dc:creator>
      <dc:date>2019-01-17T18:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Capture problem with SCT on LPC824</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646487#M25578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ATHMESH NANDAKUMAR,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Capture will get the counter, then use the counter can calculate the frequency, as you know, each counter time is you own defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2019 01:13:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Capture-problem-with-SCT-on-LPC824/m-p/646487#M25578</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-01-18T01:13:31Z</dc:date>
    </item>
  </channel>
</rss>

