LPC2368 VIC INTURRUPT NOT HAPPENING

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC2368 VIC INTURRUPT NOT HAPPENING

886 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nmariner on Fri May 02 07:00:27 MST 2014
Further to my original problem with the IDE not showing all the VIC registers, I still seem to be having problems getting an interrupt routine to be called.
I have code:

void timer2_handler()

{
//code for handler
}

VICIntEnClr=(1<<26); // disable timer 2
VICVectAddr26=(unsigned long)timer2_handler; // set address for IRQ26 - TIMER2
//timer 2 setup code
VICIntSelect&=~(1<<26); // use IRQ and vector interrupt controller
VICIntEnable=(1<<26); // timer 2 interrupt enabled

Even though the interrupt register is showing that timer2 interrupt flag is set, a breakpoint in timer2_handler() is never hit in debug mode.
I copy VICVectAddr26 into a temp variable that I watch and can see that the correct handler address is in the VIC interrupt address register (when compared to the dissasembly addresses in debug).

There is obviously something I am missing but I cannot see it a the moment. Any ideas?

Regards,
Nigel.
0 Kudos
Reply
2 Replies

813 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nmariner on Mon May 05 06:07:34 MST 2014
I have looked through example code and cannot see anything obvious that I am not doing.
I put LED blink in interrupt routine and found that interrupt would hit once and blink LED but then would never hit again even though timer2 is still running. I can see timer2 int is enabled in the VIC still by reading the vicintenable register which is 0x4000000.
Also vicIRQstatus is 0x4000000 indicating timer2 should interrupt again.

Regards,
Nigel.
0 Kudos
Reply

813 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri May 02 07:41:57 MST 2014
So it might be useful if you could confirm if you have tried the things we posted previously in one of your previous threads…

http://www.lpcware.com/content/forum/debug-problem-lpc2468-vic#comment-1136987

In particular...
- Try powering you board up in ISP mode before attaching the debugger
- Compare your setup and exception handler to code to the example that we posted

I would also suggest getting your timer interrupt to do something so that you can see whether it is taking place when the debugger is not attached (e.g. blink a LED).

If you are still having problems, then please confirm details of which version of the tools you are using, which debug probe (LPC-Link1 ?), which target board and preferably some example code that shows up the problem.

http://www.lpcware.com/content/faq/lpcxpresso/how-importexport-projects

Regards,
LPCXpresso Support
0 Kudos
Reply