hi
im using µVision 3, with LPC2129
I whrite this code to generate an interruption each 1 second,
at the execution it detects the interruption of the timer well but it does not leave there .
#include “lpc21xx_keil.h”
#define LED1 10
#define LED2 11
void DefISR (void) __irq {
;
}
void tc0 (void) __irq { //fct d’int
IOCLR0=(1<<LED1);
T0IR = 1; // efface l’int
VICVectAddr = 0;
// ??
}
// config timer0
void init_timer (void) {
T0MR0 = 14999999; // 10mSec = 150000-1
T0MCR = 3; // int et reset sur mr0
T0TCR = 1; // Timer0 actif
VICVectAddr0 = (unsigned long)tc0; // adresse int
VICVectCntl0 = 0x20 | 4; // validation timer0
}
main (void) {
int i;
IODIR0 = (1<<LED1)|(1<<LED2);
IOSET0 = (1<<LED1)|(1<<LED2);
init_timer();
VICDefVectAddr = (unsigned long) DefISR; // ??
while(1) {
VICIntEnClr |= 0x00000010;
for(i=0;i<1000;i++){;}
IOCLR0=(1<<LED2);
VICIntEnable |= 0x00000010;
for(i=0;i<10000;i++){;}
IOSET0 = (1<<LED2);
}
}