Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Datasheet/Parts Requests


Datasheet/Parts Requests Request a datasheet or enquire about part equivalents and/or difficult-to-find parts here.

Reply
 
Thread Tools Display Modes
Old 4th September 2007, 02:33 PM   (permalink)
Default Priority Interrupt Controller

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 is offline   Reply With Quote
Old 4th September 2007, 02:40 PM   (permalink)
Default

Probably better if you mention what you're trying to do, and what processor you're using?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 4th September 2007, 03:23 PM   (permalink)
Default

I'm using a PIC mcu, and I'd like to have 8 external interrupts with a minimum number of pins.
Stellarcore is offline   Reply With Quote
Old 4th September 2007, 03:34 PM   (permalink)
Default

Quote:
Originally Posted by Stellarcore
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'.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 4th September 2007, 05:23 PM   (permalink)
Default

Quote:
Originally Posted by Stellarcore
I'm using a PIC mcu, and I'd like to have 8 external interrupts with a minimum number of pins.
hi,
Look here: http://www.intersil.com/data/an/an109.pdf
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 4th September 2007, 07:06 PM   (permalink)
Default

Quote:
Originally Posted by ericgibbs
Not likely to save the OP many pins on his PIC as I count 14 pins needed to configure and utilize this device..

Lefty
Leftyretro is offline   Reply With Quote
Old 4th September 2007, 07:36 PM   (permalink)
Default

a well known PIC is 82C59 but requires 8+ i/o lines for access
is better if you can find a serial access PIC
tavib is offline   Reply With Quote
Old 4th September 2007, 10:11 PM   (permalink)
3v0
Default

You have still to answer Nigel's question regarding what it is you are trying to do. It makes a difference.

You could program a 2nd PIC to act as an interrupt controller. Again it depends on you application.
3v0 is offline   Reply With Quote
Old 5th September 2007, 03:32 PM   (permalink)
Default

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.
Stellarcore is offline   Reply With Quote
Old 5th September 2007, 03:39 PM   (permalink)
Default

hi,
For reference, look at the HEF4532B, 8 input priority encoder.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 5th September 2007, 03:41 PM   (permalink)
Default

Quote:
Originally Posted by Stellarcore
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!.

Quote:

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 11th September 2007, 12:49 AM   (permalink)
Default

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 by mneary; 11th September 2007 at 12:53 AM.
mneary is offline   Reply With Quote
Old 12th September 2007, 04:53 PM   (permalink)
Default

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.
Stellarcore is offline   Reply With Quote
Old 12th September 2007, 08:20 PM   (permalink)
Default

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.
mneary is offline   Reply With Quote
Old 13th September 2007, 04:13 PM   (permalink)
Default

the expander I have been trying is the MCP23016, but I am most likely switching to the MAX7313 for its added LED intensity control.
Stellarcore is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Help with timer and interrupt please.. AntRoFiZ Micro Controllers 2 29th May 2007 11:48 AM
what is a microcontroller made of ? pinblaster73 Micro Controllers 9 16th May 2007 04:48 AM
Question about Interrupt tinhnho Micro Controllers 3 11th February 2007 07:07 PM
Xbox 360 Tilt Controller adamthole Electronic Projects Design/Ideas/Reviews 0 20th January 2007 05:24 PM
HANDLING THE INTERRUPT. alamy Micro Controllers 6 26th March 2005 03:37 PM



All times are GMT. The time now is 12:54 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.