Go Down

Topic: Any interrupt controllers for arduino? (Read 3156 times) previous topic - next topic

liudr

I need an interrupt controller for an arduino uno so I can monitor multiple inputs at the same time. I read the arduino attachInterrupt() function call and it seems to be able to attach interrupts to pin 2 and 3. If I can get an interrupt controller, like 8259A for IBM PC-XT, which I learned in the 90's, I would be able to attach its output to arduino pin 2 and expand it to sense 8 or 16 external interrupts. I would want to monitor pin change so both rising and falling edges are needed. Does anyone know of an easy-to-use interrupt controller? Thanks!

cr0sh


I need an interrupt controller for an arduino uno so I can monitor multiple inputs at the same time. I read the arduino attachInterrupt() function call and it seems to be able to attach interrupts to pin 2 and 3. If I can get an interrupt controller, like 8259A for IBM PC-XT, which I learned in the 90's, I would be able to attach its output to arduino pin 2 and expand it to sense 8 or 16 external interrupts. I would want to monitor pin change so both rising and falling edges are needed. Does anyone know of an easy-to-use interrupt controller? Thanks!


According to Jameco's website, they still sell the 8259 - if that will work for you (for some reason, Jameco has a lot of these old Intel parts, like the 8259 and 8255, among others in stock). Maybe there's something more "modern" available, but I don't know of anything off the top of my head...
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

robtillaart

Quote
I would want to monitor pin change so both rising and falling edges are needed. Does anyone know of an easy-to-use interrupt controller? Thanks!


Have you considered an Arduino with a pinChangeInterrupt - http://arduino.cc/playground/Main/PcInt - and send the result to another Arduino.


There is also a lib version - http://www.arduino.cc/playground/Main/PinChangeInt - but I could not get it working as is (did not try hard enough I guess ;)



Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

liudr

Thanks guys. I'll try the software solution first.

CrossRoads

Take a look here liiudr- skyjumper got them to work in a pretty straight forward manner

http://arduino.cc/forum/index.php/topic,71049.new.html#new
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

GaryP

I am trying to find the same solution; external interrupt controller. I used 8259A years back, but now it seems overkill, too big, and too many lines.

As usual, I'm running out digital pins, only pin 2 or 3 can be used for interrupt. Two quadruple encoders can be connected to analog iputs as well, just the get interrupt when state changes...

Any progress with finding hardware, or does the skyjumpers code work well enough?

Thanks!

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

westfw

What do you want this "interrupt controller" to do?  The 8259 relies on being able to tie into the x80/x86 bus's interrupt acknowledgment cycle, putting a vector and/or interrupt instruction onto the databus.  Using quite a lot of pins in the process.  The 8259-equivalent for the AVR is already inside the chip, and doesn't support the "cascaded" mode that lets you have additional levels of interrupt controller outside the chip.

A simple OR or XOR gate, or a "Priority encoder" might do what you want, but you are still faced with the  problem of how to get the info about which pin is interrupting into the AVR.

GaryP


What do you want this "interrupt controller" to do?  The 8259 relies on being able to tie into the x80/x86 bus's...



There' you go! Why ask and answer at the same time?

I have eight pins which need to be followed, but at the same time there's many other thing to be done, without unnessesary delays.
And also I have run out of digital pins, so I need to read in with Analog pins, and these pin don't provide interrupts. So I need to have 8 pins to give me a call with one pin common pin.

And there seems to be nice I2C device, MCP23017, that gives even more help. Just find that from older posts.

Thanks!

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

westfw

Quote
I need to read in with Analog pins, and these pin don't provide interrupts.

it looks to me like the analog pins (if configured for digital IO) support the same pin-change interrupts as the other general purpose digital pins.

Do you have an I2C bus already in use?  Is I2C going to be fast enough?  If so, some sort of bus expander IC seems like a natural choice; either some dedicated  device like the MCP23017 (and there seem to be a LOT of them out there.  TI has 23...), or a general purpose mcirocontroller programmed to do similar things (the MPCxxx IO expanders are almost certainly PICs with dedicated code in them...)

GaryP


Quote
I need to read in with Analog pins, and these pin don't provide interrupts.

it looks to me like the analog pins (if configured for digital IO) support the same pin-change interrupts as the other general purpose digital pins.

Do you have an I2C bus already in use?  Is I2C going to be fast enough? 


Yes, I have 3 arduinos talking to each other at the moment, SD21 servo controller and few other things. I2C is my choice for this matter.
Ok, I consider Mega1280 which is lying in my table, but it was too big. Features of 1280 was more than enough, but the size.

Pin-change interrupts are far away from my knowledge, I just started less than a year ago, C-language is still a mystery for me. :smiley-sad-blue:
If only I knew how to get the information that A0-A7 has changed state.

Cheers,
Kari

The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

CrossRoads

A0-A5 are D14-D19 on the Uno. Read them just like regular data pins.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

westfw

Quote
If only I knew how to get the information that A0-A7 has changed state.

On what sort of timescale?  You may not need interrupts at all if you need to detect events that last for multiple milliseconds...

AWOL

Quote
If only I knew how to get the information that A0-A7 has changed state.

If you're using something like a Nano with 8 analogue inputs, you need to remember that A6 and A7 are simply inputs to the A/D mux; they have no digital functionality.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

GaryP

Thank you fellows for your advices!

I just got two MCP23017's, so I try if that gives me the reasonable expansion for my project. After that, if/when that doesn't do the trick, I will try to learn more about atmel's pins!

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

liudr


Quote
If only I knew how to get the information that A0-A7 has changed state.

If you're using something like a Nano with 8 analogue inputs, you need to remember that A6 and A7 are simply inputs to the A/D mux; they have no digital functionality.


Thanks. I didn't know that.

Go Up