I need to implement a fast external interrupt with a C167CR micro on a Phytec phyCORE-167 board. At the moment, I have my external interrupt signal connected to pin P2.15 and program it as follows:
EXICON = 0x4000; // Set Ext Trigger Interrupt for rising edge response CC15IC = 0x4c; // Enables Ext Trigger Interrupt, Global Level = Lowest, Priority Level = Medium IEN = 1 ; // Enable Interrupts
void Boxcar_irq (void) interrupt CC15INT = 31 { CC15IC = 0x0; // Disable further interrupts EXTTRIG_GATE = 1; // Sets pin P2.1 High return; }
If you're running 20Mhz, the external interrupt latency is still 200usec, I believe. Then the push of registers will use up more. You can speed it up by using a separate register bank for the interrupt, (see 'using' keyword)
eg. void boxcar_irq( void ) interrupt CC15NT = 31 using rb_Boxcar { ... }