Content originally posted in LPCWare by brattchess on Thu Jan 29 02:19:40 MST 2015
Hello,
I am trying to capture the value of the timer32_1 every rising edge from CT32B1_CAP0.
This is my config:
#define CONF_COUNTER_32_B1\
LPC_IOCON->R_PIO1_0 = 0x00C3; /* */\
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<10); /*enable clock to CT32B1 (sec. 3.5.14)*/\
\
LPC_TMR32B1->MCR= 0x0000;/*disable all operation with match registers*/\
LPC_TMR32B1->PWMC= 0x00;/*disable all operation with pwm mode*/\
LPC_TMR32B1->EMR= 0x00;/**/\
LPC_TMR32B1->CCR = 0x05;/*capture on CT32B1 rising edge and interrupt on CT32B1 event*/\
LPC_TMR32B1->CTCR = 0x00;/*timer mode: every rising PCLK edge*/\
\
\
/* Enable the CT32B1 Interrupt */\
NVIC_EnableIRQ(TIMER_32_1_IRQn);
The interrupt jumps but the CR0 value is always 0.
And the IR value is 0x16.
I don't know why CR0 has not value. And Why IR is 0x16 when it must be 0x10.