Hi
If your are handling vectored interrupts directly, your interrupt routine needs to be declared as an interrupt rather than a subroutine [Keil uses
__irq]
eg.
void __irq InterruptEnc1 ( void )
{
....
acknowledge the IRQ here too
}
If this is not followed it will crash as the interrupt is returned from since the compiler has used a "return from subroutine" rather than a "return from interrupt".
If you are using an interrupt dispatcher (this can be seen from the irq vector address) the handler must be declared as normal subroutine and doesn't acknowledge the interrupt on exit (as in your example).
The easiest way to verify is to put a break point in the routine and step out watching the assembler code to see where it returns to and if it uses the correct assembler instructions.
Regards
Mark
www.uTasker.com