About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

Can multiple cards use the same GPIO pin for interrupts

231 Views - Created 12/05/2020

12/05/2020

Posted by:
PeterB

Users Avatar

Location:
Philippines

I want to move from a polling method to an interrupt-driven method for monitoring the digital inputs on multiple IO Pi cards.  I am aware that I have to reduce the voltage from 5V to 3.3V before connectiong to the GPIO ports.

My question is: Can I parallel up several cards on the same GPIO pin simply through voltage dividers, or is it advisable to use a separate GPIO pin for each card?

12/05/2020

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

Hello Peter

I have just tested an IO Pi Plus with the interrupt pins connected and set to go high when active.  It appears to work correctly with the interrupt trigger showing on my logic analyser so in theory you should be able to connect all of the interrupt pins together and use a single voltage divider.

Having said that the one issue I can see is if one of the interrupt pins is accidentally set as an open-drain pin instead of active high you could have a direct short to ground from the other interrupt pins, possibly damaging the chips on all of the IO Pi boards.

A better solution would be to use a logic chip to act as a buffer between the interrupt outputs and the GPIO pin.  You could use a CD4078 which is an 8-input OR/NOR gate.  With an OR gate if any of the inputs goes high the output will go high so you can combine the interrupts from 8 I/O chips into a single output while keeping them isolated from each other.

You will need to run the CD4078B at 5V to make it work with the interrupt pins so you will still need a voltage divider on the output but this should give you a safer way to use all of the interrupts on a single GPIO pin.

AB Electronics UK Tech Support

13/05/2020

Posted by:
PeterB

Users Avatar

Location:
Philippines

Thanks for doing the experiment, Andrew.  What if I use separate voltage dividers for each interrupt pin, but common up the outputs to a single GPIO pin? I'm guessing that I'd need to use a series resistor on the connection to the GPIO.

13/05/2020

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

Using separate voltage dividers should be ok.  If you use a fairly high value for the resistors in the dividers, such as a 10K and 15K, to give you 3V at a low current you shouldn't have to worry about it back feeding into any interrupt pins that are set as open-drain.

You shouldn't need to use an extra series resistor on the GPIO pin as the voltage dividers will be limiting the current.

AB Electronics UK Tech Support

20/05/2020

Posted by:
PeterB

Users Avatar

Location:
Philippines

It has occured to me that it would be be possible to invert the sense of the interrupt signal, put the GPIO pin into pull-down mode, and clamp the maximum input voltage with a 3V (or 3V3?) zener.  Then I would just need a series resistor - say 10k, or a little lower, from each 23017 interrupt output.  Can you see any pitfalls?

20/05/2020

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

I can not see any problems with the method you described.

Another solution that would need only one component would be to use a 74HC4050 non-inverting HIGH-to-LOW level shifter like the type we use on our Expander Pi and Arduino adapter to convert the 5V SPI signals to 3.3V.

The 74HC4050 can be powered from the 3.3V power rail and the inputs are tolerant of voltages up to 15V so you could connect each input to an interrupt pin on the IO Pi and join all of the output pins together and connect them to a single GPIO pin.

AB Electronics UK Tech Support

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.