Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Priority Interrupt Controller

Status
Not open for further replies.

Stellarcore

New Member
I remember in one of my university classes discussing a device refered to as a "Priority Interrupt Controller". The device allows you to service many interrupts with only a single external interrupt on a microprocessor/controller.

The interrupt controller basically monitors a set of 8 (or more) inputs and when one of them is activated, it puts the interrupt in a queue and sends an interrupt to the micro. The micros interrupt service routine then queries the interrupt controller and proceeds to empty the queue of interrupts, servicing each one as it goes.

Does anybody know of a device like this? I've considered just using a big or gate but that makes it more difficult to figure out which of the eight devices triggered the interrupt and others could be ignored if they are asserted and removed while other interrupts are active. I've also considered using a 8-to-1 decoder, but then you get a problem when multiple interrupts occur at the same time.

Let me know what suggestions you have. I'd like to try and keep this down to a single device. Maybe I'll end up having to use another smaller micro and just program it to behave in this way.
 
Stellarcore said:
I'm using a PIC mcu, and I'd like to have 8 external interrupts with a minimum number of pins.

You still don't explain why you want 8 external interrupts, do you really need them at all? - that's why I asked.

But you might try looking at 'interrupt on change on PortB'.
 
a well known PIC is 82C59 but requires 8+ i/o lines for access
is better if you can find a serial access PIC
 
Hey,

Well, I've got 8 16-bit I/O expanders configured as inputs and they each have their own interrupt line. When I receive an interrupt from the expanders I'd like to be able to quickly determine which expander caused the interrupt and service it.

I've looked at the 82C59 device, but as mentioned it doesnt seem like it will save me much in terms of I/O on the PIC. Earlier I wasnt aware of any external interrupts other than on Port E, but my compiler does seem to support interrupts for the other ports as well, although oddly enough they dont cover the entire ports. I think I'll end up using A0-A4 and C4-C7 for my interrupts.
 
hi,
For reference, look at the HEF4532B, 8 input priority encoder.
 
Stellarcore said:
Hey,

Well, I've got 8 16-bit I/O expanders configured as inputs and they each have their own interrupt line. When I receive an interrupt from the expanders I'd like to be able to quickly determine which expander caused the interrupt and service it.

You're still not really telling us much about it, do you have any need to use interrupts at all? - it depends entirely on what the inputs are coming from - most often polling is more than fast enough, and cures all your worries!.

I've looked at the 82C59 device, but as mentioned it doesnt seem like it will save me much in terms of I/O on the PIC. Earlier I wasnt aware of any external interrupts other than on Port E, but my compiler does seem to support interrupts for the other ports as well, although oddly enough they dont cover the entire ports. I think I'll end up using A0-A4 and C4-C7 for my interrupts.

Like I said, decide if you need them first, but consult the PIC datasheet or reference manual, and checkout PortB.
 
Get one more I/O expander, hook up the 8 interrupts to its inputs. Then just hook the interrupt to one input on the MCU.
 
Last edited:
I tried that, didnt work too well because the I/O expander only remembers the state of the inputs at the last time *any* of the inputs change.

The problem is that the interrupt lines dont go high and remain high until serviced, they just fire a pulse. When the expander senses an interrupt on its input lines, it overwrites its internal buffer with the current state of the inputs. So in the event that an interrupt occurs and then another interrupt occurs before the first one has been serviced, the first one is forgotten.

I think I should be able to use straight I/O pins on the PIC to handle the interrupts.
 
Can you disclose what I/O expander you're using? Why is it so hard to get this information from you?

We really want to help.
 
the expander I have been trying is the MCP23016, but I am most likely switching to the MAX7313 for its added LED intensity control.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top