Hi, Himanshu,
Regarding your question, for the code:
void M0_TIMER0_IRQHandler(void)
{
if(msec)msec--;
counter++;
LPC_TIMER0->IR = TIM_IR_CLR(0);
NVIC_ClearPendingIRQ(M0_TIMER0_IRQn);
}
How about using the code:
void M0_TIMER0_IRQHandler(void)
{
if(msec)msec--;
counter++;
//LPC_TIMER0->IR = TIM_IR_CLR(0);
LPC_TIMER0->IR |= 0x01; //clear flag
//delete the following line NVIC_ClearPendingIRQ(M0_TIMER0_IRQn);
//NVIC_ClearPendingIRQ(M0_TIMER0_IRQn);
}
BR
Xiangjun Rong