Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
External interrupt
- 03-26-2007
- galapogos
March 26, 2007, 3:07 am

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.
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

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

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

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

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

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

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

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
Site Timeline
- » Xilinx EDK and Custom Peripheral: error occur when generating bitstream
- — Next thread in » Embedded Programming
-
- » URGENT: A Question about ZIF and Master Sockets
- — Previous thread in » Embedded Programming
-
- » Using C preproc to uniquely identify structure members
- — Newest thread in » Embedded Programming
-
- » Подвох
- — The site's Newest Thread. Posted in » Electronic Circuits (Russian)
-