cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
2,071 Views
Registered: ‎11-02-2010

Why is the interrupt being triggered on both rising and falling edges?

Hello All,

 

I tried looking an answer for this in the forums, but no luck.

 

The interrupt controller has several inputs, but at the moment, only the external one is of my concern. The external trigger comes from a pin and, at the moment, I am driving it manually. The interrupt gets triggered and goes into its ISR, just as it is supposed to. The only problem is that its being triggered on both the rising and falling edges.

 

I added the external interrupt port in the MHS file like this:

 

PORT Trigger_Irq_Port = Trigger_Irq_Port, DIR = I, SIGIS = INTERRUPT, SENSITIVITY = EDGE_RISING, INTERRUPT_PRIORITY = HIGH

 

The interrupt controller is set as rising edge as well and has the Trigger_Irq_Port line connected to it (obviously, if not, it wouldn't trigger the interrupt controller).

 

Is there any special setting I need in software in SDk? I did the Setup, Connect and then Enable...

 

Anyone has tips on best practices when using a pin for an external interrupt (using internal pulldowns, or what not)?

 

I know its not a bouncing issue, as it the interrupt gets triggered exactly once when I connect the pin to high (2.5V) and then once again when I disconnect it.

 

Thanks,

Erick

0 Kudos
1 Reply
Highlighted
Professor
Professor
2,066 Views
Registered: ‎08-14-2007

"I am driving it manually"

 

If you're using a switch or any other mechanical means to drive this signal you

WILL have bouncing...

 

"I know its not a bouncing issue, as it the interrupt gets triggered exactly once when I connect the pin to high (2.5V) and then once again when I disconnect it."

 

Switch bounce can very well be over long before the software interrupt routine re-enables the

interrupt, thus masking out multiple bounces.

 

My suggestion:  Filter the source or connect it to some non-bouncing signal like a

pulse generator.  If you still don't believe you have bouncing, run the input to the

clock of a toggle flip-flop and show that the flip-flop only changes state when you

set the input high.  You can route the flip-flop output to an LED.  My best guess is

that you'll see the LED appear to change or not change randomly each time you

either connect or disconnect your input signal.

 

Regards,

Gabor

-- Gabor
0 Kudos