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