Content originally posted in LPCWare by taoufik on Thu Sep 09 07:06:32 MST 2010
Hello,
I want to get the value of the TC when the level of the PIO1_8 changes, the interrupt is working when the level change but the value of the TC is always 0.. What am i doing wrong??
Thank you.
Taoufik
/*****************************/
unsigned int temTCval = 0;
void TIMER16_1_IRQHandler(void)
{
temTCval = TMR16B1CR0;
TMR16B1IR |= 0x10;
}
void initIRR_module(void){
SYSAHBCLKCTRL |= (1<<SYSAHBCLKCTRL_CT16B1_BIT);
//init io CT16B1_CAP0
IOCON_PIO1_8 = 1;
TMR16B1CTCR |= 1;
TMR16B1CCR = 7;
/* Enable the TC Interrupt */
ctl_unmask_isr(17);
}