I have come across a problem with a spurious external interrupt on a BL2600 processor board (RCM3200). I have Int0 configured to trigger on the falling edge of an input pulse on PE4 with a priority of 2.
WrPortI( I0CR, &I0CRShadow, 0x10 + 0x2 );
The input signal is normally high (5.0V) and pulses low for 7us to generate the interrupt. A counter in the ISR shows two counts for each input pulse where there should only be one.
I added some code at the start of the ISR to toggle an output bit each time it fires. Actually that was the only code in the ISR for this test. When I scope out the pulse input and toggle output signals, I can see that the ISR usually fires on both the falling and rising edges of the input when it crosses the 2.0V threshold. Sometimes the ISR fires twice on the rising edge alone. The external input signal has about 1us fall time and 500us rise time.
I added an external 2K2 pull up resistor to 5.0V for the PE4 input which reduced the input signal rise time from 500us to 50us. This eliminated most of the spurious triggers but it still happens fairly regularly, maybe once in 10-20 interrupts compared to practically every one.
We already have a number of boards in the field so adding an external resistor as a fix is less than ideal. Spurious interrupts are still occurring anyway and I need to eliminate them. This seems more like a hardware glitch on the R3000 processor input pin (no hysteresis?). Is there some way to prevent the interrupt from firing on a slow rising edge as it crosses the input switching threshold? I'm looking for a software solution here rather than any hardware changes.
Thanks,
Doug