capture problem in LPC2214
2006-05-13 by Mukadder CEYHAN
I have a problem with capture 0.0 channel in lpc2214.
There is no interrupt?
What is wrong the following code?
void initTimer0(void)
{
PINSEL0 |= 0x00000020;
// setup Timer 0 to count forever
T0TCR = TCR_RESET; // reset &
disable timer 0
T0PR = T0_PCLK_DIV - 1; // set the
prescale divider
T0MCR = 0; // disable
match registers
T0CCR = 0x05; // capture mode
enabled,risingedge
T0EMR = 0; // disable
external match register
VICIntSelect &= ~VIC_BIT(VIC_TIMER0); //
selected as IRQ
VICVectAddr2 = (unsigned long)tc0_isr; // set
interrupt vector in 2
VICVectCntl2 = VIC_ENABLE | VIC_TIMER0; // use it
for Timer 0 Interrupt
VICIntEnable |= VIC_BIT(VIC_TIMER0); // Enable
Timer0 Interrupt
T0TC = 0;
T0CR0 = 0;
T0TCR = TCR_ENABLE; // enable
timer 0
}
void tc0_isr(void) __irq
{
if (T0IR & 0x10)
{
T0IR = 0x10;
}
VICVectAddr = 0; // Acknowledge Interrupt
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com