<?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 LPC4330 timer capture interrupt in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-timer-capture-interrupt/m-p/582864#M20761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by sophio on Mon Aug 05 09:11:04 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using LPC4330-Xplorer board. One intention of my project is to use one timer capture to generate an interrupt when a rising edge event happens. Here timer3 capture channel 1 was selected. If there is a rising edge event, the LED will turn on. It is simple, however the interrup never happens in this case namely the value of the IR register never changes. Could anyone help me? Thank you very much in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The related codes are copied as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
/*****************************************************************************
 * Private functions
 ****************************************************************************/
/* initialization routine for dual core examples */
static void prvSetupHardware(void)
{......}

void TIMER3_IRQHandler( void )
{

uint32_t reg_val;

reg_val = LPC_TIMER3-&amp;gt;IR;
if(reg_val &amp;amp; (1&amp;lt;&amp;lt;5))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //CR1 interrupt
{
&amp;nbsp; Board_LED_Set(1, 1); //led on
&amp;nbsp; Board_LED_Set(1, 0); //led off
&amp;nbsp; IP_TIMER_ClearCapture(LPC_TIMER3, 1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //reset interrupt
 }

}

void TIM_INT_Init(void)
{

&amp;nbsp;&amp;nbsp;&amp;nbsp; NVIC_DisableIRQ(TIMER3_IRQn);
NVIC_ClearPendingIRQ(TIMER3_IRQn);

IP_TIMER_Reset(LPC_TIMER3); //timer3 disable and reset
Chip_Clock_Enable(CLK_MX_TIMER3);

/* Pin2_1 is configured as T3_CAP1 and pull-down enabled*/
Chip_SCU_PinMux(2, 1,MD_BUK, FUNC6);//MD_PLN_FAST

/*Enable the rising edge capture interrupt of timer3*/
Chip_TIMER_CaptureRisingEdgeEnable(LPC_TIMER3, 1);

/*Enable the rising/falling edge capture interrupt of timer3*/
Chip_TIMER_CaptureEnableInt(LPC_TIMER3, 1);

Chip_TIMER_Enable(LPC_TIMER3);

NVIC_SetPriority(TIMER3_IRQn, IRQ_PRIO_REVCMD);
NVIC_EnableIRQ(TIMER3_IRQn);
}


/*****************************************************************************
 * Public functions
 ****************************************************************************/
/**
 * @briefMain for dual core examples
 *
 * @return&amp;nbsp; Function should not return.
 */
int main(void)
{
prvSetupHardware();

TIM_INT_Init();

while(1);

return 0;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:05:45 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:05:45Z</dc:date>
    <item>
      <title>LPC4330 timer capture interrupt</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-timer-capture-interrupt/m-p/582864#M20761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by sophio on Mon Aug 05 09:11:04 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using LPC4330-Xplorer board. One intention of my project is to use one timer capture to generate an interrupt when a rising edge event happens. Here timer3 capture channel 1 was selected. If there is a rising edge event, the LED will turn on. It is simple, however the interrup never happens in this case namely the value of the IR register never changes. Could anyone help me? Thank you very much in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The related codes are copied as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
/*****************************************************************************
 * Private functions
 ****************************************************************************/
/* initialization routine for dual core examples */
static void prvSetupHardware(void)
{......}

void TIMER3_IRQHandler( void )
{

uint32_t reg_val;

reg_val = LPC_TIMER3-&amp;gt;IR;
if(reg_val &amp;amp; (1&amp;lt;&amp;lt;5))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //CR1 interrupt
{
&amp;nbsp; Board_LED_Set(1, 1); //led on
&amp;nbsp; Board_LED_Set(1, 0); //led off
&amp;nbsp; IP_TIMER_ClearCapture(LPC_TIMER3, 1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //reset interrupt
 }

}

void TIM_INT_Init(void)
{

&amp;nbsp;&amp;nbsp;&amp;nbsp; NVIC_DisableIRQ(TIMER3_IRQn);
NVIC_ClearPendingIRQ(TIMER3_IRQn);

IP_TIMER_Reset(LPC_TIMER3); //timer3 disable and reset
Chip_Clock_Enable(CLK_MX_TIMER3);

/* Pin2_1 is configured as T3_CAP1 and pull-down enabled*/
Chip_SCU_PinMux(2, 1,MD_BUK, FUNC6);//MD_PLN_FAST

/*Enable the rising edge capture interrupt of timer3*/
Chip_TIMER_CaptureRisingEdgeEnable(LPC_TIMER3, 1);

/*Enable the rising/falling edge capture interrupt of timer3*/
Chip_TIMER_CaptureEnableInt(LPC_TIMER3, 1);

Chip_TIMER_Enable(LPC_TIMER3);

NVIC_SetPriority(TIMER3_IRQn, IRQ_PRIO_REVCMD);
NVIC_EnableIRQ(TIMER3_IRQn);
}


/*****************************************************************************
 * Public functions
 ****************************************************************************/
/**
 * @briefMain for dual core examples
 *
 * @return&amp;nbsp; Function should not return.
 */
int main(void)
{
prvSetupHardware();

TIM_INT_Init();

while(1);

return 0;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:05:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-timer-capture-interrupt/m-p/582864#M20761</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4330 timer capture interrupt</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-timer-capture-interrupt/m-p/582865#M20762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by inspire on Tue Feb 17 11:09:30 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;same problem here...is it necessary to do something with the GIMA?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:05:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-timer-capture-interrupt/m-p/582865#M20762</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4330 timer capture interrupt</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-timer-capture-interrupt/m-p/582866#M20763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by svenb on Fri Jul 10 09:34:11 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;In case anybody else stumbles upon this on Google: Yes, you have to select the Tn_CAPm as the input for CAP_n_m in the GIMA, see section 17.4 of the user manual. Then it works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:05:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-timer-capture-interrupt/m-p/582866#M20763</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4330 timer capture interrupt</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-timer-capture-interrupt/m-p/582867#M20764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by username88 on Mon Apr 18 03:38:10 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: svenb&lt;/STRONG&gt;&lt;BR /&gt;In case anybody else stumbles upon this on Google: Yes, you have to select the Tn_CAPm as the input for CAP_n_m in the GIMA, see section 17.4 of the user manual. Then it works.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;how do you solve?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:05:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-timer-capture-interrupt/m-p/582867#M20764</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:05:47Z</dc:date>
    </item>
  </channel>
</rss>

