External interrupt

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,

I have a MCU project on a Toshiba MCU that only has 1 pin for external
interrupt. However, I need 2 external interrupts from 2 devices. I'm
wondering if there's a way to share that 1 pin between the 2 external
interrupt inputs? I'm thinking of wiring the MCU pin directly to the
inputs from the 2 devices A & B, and also wire those 2 devices to 2
other GPIO pins(say pin A and B). Then in my ISR, I can perform a
check to see if pin A or pin B is high/low in order to determine which
device caused the interrupt. Of course there will be priority given to
either A or B. Will wiring both devices to the single MCU pin be a
problem? I'm guessing I'll need a pull up/down just in case, but I'm
also wondering if device A driving the pin will cause any weird
behavior on device B, since they're essentially connected together.


Re: External interrupt
Quoted text here. Click to load it

should not be a problem once you have reviewed the datasheets for the
two devices. Why don't you ask your electrical engineer? Or is this a
school project?

here's a hint as to whether device A will affect device B:
you are connecting the two OUTPUT lines.

HTH, and read the datasheets.
   Ed


Re: External interrupt
Quoted text here. Click to load it

Not only that, but since you have joined A & B, how can you now
tell them appart ?

You need a AND gate to Merge A and B onto the INT pin,
(assumes it is active low) and then you can wire them to port pins.

http://en.wikipedia.org/wiki/AND_gate

Sometimes you can press a spare timer into service as an INT.
Set it to -1 count from overflow, then set for External Clock,
and a Clock edge on that, will fire the timer INT.
An unused UART can also do - Low IP will give a RX INT, with
a framing error.

-jg


Re: External interrupt
Quoted text here. Click to load it

I think he rather needs a OR gate from what I understand of his use
case.

But the problem will rather be on the GPIO side. Are your interrupts
signaled on a rising/falling edge, or on a level?
If you have an interrupt on edge, maybe the interrupt source
information is no longer there when you read your GPIO. You will need
something more complex, but not that complex. You need to be able to
memorize an interrupt information, read that information, and reset
it. Maybe something like a latch on the read GPIO will do the trick,
and another "clear" GPIO to reset the latch.
If you have an interrupt on level, I am pretty sure you will need an
extra GPIO too to clear the interrupt condition on your external
chips.

Stephane


Re: External interrupt
Quoted text here. Click to load it

Hey, that's a good idea. Maybe I'll do that. I actually have 2 more
external interrupts, except those pins are already being used as GPIO
for some other device. Using them would mean a new PCB layout, so I'm
looking for a quick and dirty way to do some testing first.


Re: External interrupt

Quoted text here. Click to load it

You need a diode from A to INT and an other from B to INT and possibly
a pull up/down resistor on the INT pin. However, watch for the voltage
drop in the diode and check that the active state voltage at the INT
pin is within specifications, even after the diode voltage drop.

Paul


Re: External interrupt
Quoted text here. Click to load it

Actually one of the "devices" already has a schottky diode on it. It's
actually not a device but rather the 5V power supply with a voltage
divider to lower it down to 3.3V. The application is detecting whether
the connector is inserted or not. The other device is a proper ASIC
that sends an error signal, which will interrupt my program.


Re: External interrupt

Quoted text here. Click to load it

For low level active interrupts, your system will work if you put a
diode in series with both interrupt pins, cathodes conneted to int
pins, anode connected together, and also to a pull-up resistor, and
also to MCU interrupt input pin.

Use schottky diodes preferably

Zara



Re: External interrupt
Hi,
I am just curious,may be I am not correct.Will it not be helpful to
have an external interrupt controller which can take 2 inputs and
provide one output?

Regards,
s.subbarayan


Re: External interrupt
Quoted text here. Click to load it

Such chips exist, or at least have existed.  They can also control
priority and edge/level sensitivity.

--
Chuck F (cbfalconer at maineline dot net)
   Available for consulting/temporary embedded and systems.
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline