Hello,
I have problems on my board trying to use two capture pins on the same
timer.
My purpose is to use CAP0.2 (PIN0.28) and CAP0.3 (PIN0.29) on Timer0 in order
to generate two interrupt.
CAP0.2 is set to generate an interrupt on a Rising Edge and CAP0.3 on a falling
edge.
The problem is that if I use only CAP0.3 I have the Interrupt serviced and
handled correctly, If I add also CAP0.2, no interrupts are handled.
In debug I can see the Interrupt request on the VIC peripheral but no call to
ISR is done.
If I use only CAP0.2 again, no Interrupt is serviced even if the request is in
the VIC
It seems only CAP0.3 it is working properly.
Here is the simple code I'm trying to run:
void __irq timers_isr0 ( void )
{
if ( T0CR2 != StoreA )
{
StoreA = T0CR2;
countA++;
T0IR |=0x40;
}
if ( T0CR3 != StoreB )
{
StoreB = T0CR3;
countB++;
T0IR |=0x80;
}
T0TCR|=0x02;
//ResetCounter
T0TCR &= 0xFD;
VICVectAddr = 0x00;
}
int main (void)
{
PINSEL0 = 0x00000000;
PINSEL1 = 0x0A000000;
// Enable Debug Port
PINSEL2 |= 0x00000034;
// Do Not Remove
// configure timer 0
T0CTCR = 0x08 ; // bit 00001000
T0TC = 0; /* Set Timer 0 Counter */
T0PR = 0; /* Set Prescaler */
T0CCR = 0x00000D40;
T0MCR = 0x00;
T0MR0 = 0x01;
T0MR1 = 0x00;
T0MR2 = 0x00;
T0MR3 = 0x00;
T0TCR = 0x01; /* Start Timer */
VICIntSelect = 0x00; /* */
VICVectCntl1 = 0x20 | 0x04; /* */
VICVectAddr1 = (unsigned) timers_isr0; /* */
VICIntEnable = 1 << 0x04; /* */
T0IR |= 0xFF;
while (1);
} // timers_init
THanks to anyone who could provide a suggestion.
Gabriele