Olimex lpc e2294 board interrupt help - GNU C
2005-07-28 by boje_d
Hi im trying to make the interrupt work om a lpc2294. I am using
timer 0 and see the interrupt being enabled (test routine on display)
but the interrupt does NOT activate the interrupt routine. Ill put in
some code so maybe someone can see my error??? And give a little
help ??
than you (i hope)
Best regards
Boje Demant
interrupt routine
static void Timer0Interrupt(void) __attribute__ ((interrupt ("IRQ")));
static void Timer0Interrupt(void){
// (*timer_function)(); // Call timer callback function.
//
// T0_TCR=0; //stop timer
// T0_TCR=2; //Reset timer
// T0_TCR=1; //start timer
LIGHT_LCD_ON;
T0_IR = 0xff; // Clear timer 0 interrupt line.
VICVectAddr=0xff;
}
in main:
T0_PR=58982; //setup prescaler = 1msek
T0_TCR=0x00000002; //Reset timer
T0_MR0= 1500; //2 (2 sek for interrupt;
T0_MCR=0x00000003; //generate interrupt on match
VICProtection=0; //
VICIntEnClear=0xffffffff; //disable all interrupts
VICSoftIntClear=0xffffffff;
VICDefVectAddr=(unsigned long)&DefInterrupt;
VICIntSelect=0x00000000; //assigne interrupt timer 0 til type IRQ
VICVectAddr0= (unsigned long)&Timer0Interrupt; //opsæt vector
VICVectCntl0= 0x00000024; //enable vector iterrupt