This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

IAR LPC2129 TIMER INTERRUPT PROGRAM not work

i try to debug the timer program with IAR and olimex LPC2129
but the program don't jump in
can you help me please

where is the problem ? this program is the program of
www.nxp.com/.../AN10414.pdf

this is the code of my program

#include "LPC21xx.H"

void Initialise(void);
__irq void timer_ISR();
__irq __arm void spurious_handler();
//************************ MAIN *******************************
int main (void)
{ int i,j;
// Routine that initialises the LPC2000 device
Initialise();
// This for loop helps in identifying the start of the application
// Port Indicator: P0.9
for(i=0;i<10;i++)
{ IOCLR0=0x1000;
for(j=0;j<100000;j++);
IOSET0=0x1000;
for(j=0;j<100000;j++);
} // Start Timer1
T1TCR=0x1;
// Loop forever
while (1)
{ // Port Indicator: P0.13
//IOCLR0=0x2000;
//****************** Step2 ********************
// Uncomment the below block for Step2
VICIntEnClr=0x20;
WDFEED=0xAA;
WDFEED=0x55;
VICIntEnable=0x20;
//IOSET0=0x2000;
} }
//************************ INITIALISE *******************************
void Initialise()
{ // GPIO
IODIR0 = 0xFFFF;
IOSET0= 0xFFFF;
// Setting pclk same as cclk
VPBDIV=0x1;
// Timer 1 Configuration
T1TCR=0x0;
T1TC=0x0;
T1PR=0x0;
T1PC=0x0;
// Setting the Match value
T1MR0=0xffff;
// Reset and interrupt on match
T1MCR=0x3;
// VIC Configuration
VICIntSelect=0x0; /* Timer 1 selected */
VICIntEnable= 0x20; /* Timer 1 interrupt */
VICVectCntl0= 0x25; /* Address of the ISR */
VICVectAddr0=(unsigned long)timer_ISR;
//****************** Step3 ********************
// Uncomment below statement for Step3
VICDefVectAddr=(unsigned long)spurious_handler;
//****************** Step2 ********************
// Uncomment the below block for Step2
//Configure the Watchdog
WDTC=0xFFFFFFFF;
WDMOD=0x1;
WDFEED=0xAA;
WDFEED=0x55;
} //************************ TIMER ISR *******************************
__irq void timer_ISR()
{ // Port Indicator: P0.13
IOCLR0=0x2000;
// Clearing the interrupt and updating the VIC
T1IR=0x1;
VICVectAddr=0xFF;
IOSET0=0x2000;
} //******************** SPURIOUS INTERRUPT HANDLER*********************
__irq __arm void spurious_handler()
{ // Port Indicator: P0.15
IOCLR0=0x2000;
// Clearing the interrupt and updating the VIC
T1IR=0x1;
VICVectAddr=0xFF;
IOSET0=0x8000;
}

0