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.