Pages: [1]   Go Down
Author Topic: Any interrupt controllers for arduino?  (Read 3031 times)
0 Members and 1 Guest are viewing this topic.
Central MN, USA
Offline Offline
Tesla Member
***
Karma: 76
Posts: 7307
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged


Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 42
Posts: 5612
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 228
Posts: 14053
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink



Logged

Rob Tillaart

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

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 76
Posts: 7307
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6806
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6806
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged


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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A0-A5 are D14-D19 on the Uno. Read them just like regular data pins.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6806
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26638
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


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

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 76
Posts: 7307
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Pages: [1]   Go Up
Jump to: