Hi
the code given below needs to run the ISR when a cpature event occurs. But on simulating the code and running it on debugger it doesnot switch to irq mode and hence does not go to ISR for that event.
I have tried running the simplest IRQ code given in hitex.pdf. Even in that case irq ISR is not executed.
can someone please help with this.
Thanks in advance
#include <LPC21xx.H> /* LPC21xx definitions */ void T0isr()__irq; int main (void) { VPBDIV=0x2; PINSEL1=0x2000; IODIR0=0x0; IODIR1=0xff0000; T0TCR=0x2; T0CCR=0x7; T0TCR=0x00; VICIntSelect=0x0; VICIntEnable=0x10; VICVectCntl0=0x24; VICVectAddr0=(unsigned long)T0isr; T0TCR=0x01; while(1); } void T0isr()__irq { static int value; value=T0CR0; T0IR=0x1; IODIR1 = 0x00FF0000; IOSET1 = 0xffff; VICVectAddr=0x00; }
The problem is that the control doesnot go to the ISR routine on an capture event.It works upto that : ISR address is loaded into VICVect Address register. After that it doesnot go to IRQ mode.
Help in this direction is appreciated.
The code within the ISR is OK. It can be changed. That does'nt matter.
Thanks