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; }
Hi Kieran, Probably the fastest response you can get is when the fast external interrupt triggers a PEC transfer to the output port data register. But it is not possible to set individual port bits this way. To get the fastest possible response with the interrupt handler you have to make sure that the instruction that sets the output port is as close to the entry point of the interrupt handler as possible. You can always put it right in the interrupt vector table, and that would involve assembler, of course. The other issue is program execution speed from external RAM. If the external bus interface is not in 16-bit demultiplexed mode with no extra delays, than the interrupt handler will run faster from on-chip RAM. By the way, 5.4uS sounds like ages. Are you sure you chose the fastest possible CPU clock frequency? Regards, - Mike