multiple port interrupts

Hi Guys
I am using all my port B pins as interrupts on a 40x2
SETINT OR %00000000,%11111111,B
I am wondering if it is possible to set interrupt across multiple ports.
ie. using combinations of PortA pins and B pins and C at the same time.
I hope someone can enlighten me
cheers
 

nick12ab

Senior Member
Apparently "only one input pattern is allowed at any time" so probably not. However you could try using 16 bits instead of 8 which might allow you to use port C and port B (specifying B as the port) because the C pin numbers come right after the B pin numbers.
 

westaust55

Moderator
Using a 16-bit value for the input state and mask will not help.
As the PICAXE manual states:

- input is a variable/constant (0-255) which specifies input condition.
- mask is variable/constant (0-255) which specifies the mask
If you enter a value with more than 8 bits only the lowest 8 bits will be used.
 

inglewoodpete

Senior Member
Hi Guys
I am using all my port B pins as interrupts on a 40x2
SETINT OR %00000000,%11111111,B
I am wondering if it is possible to set interrupt across multiple ports.
ie. using combinations of PortA pins and B pins and C at the same time.
I hope someone can enlighten me
cheers
Interrupts can only occur on the nominated port.

However, with efficient selection of pins, you can create diode-or functions by wiring diodes from pins of other ports to one pin of your nominated port. That "one pin" will need a pullup or pulldown resistor to keep the "normal" (off) state. Within the interrupt routine you will need to poll each of the appropriate ports to get a quick snapshot of the input conditions that triggered the interrupt.
 
Thanks guys, I appreciate your help

However, with efficient selection of pins, you can create diode-or functions by wiring diodes from pins of other ports to one pin of your nominated port. That "one pin" will need a pullup or pulldown resistor to keep the "normal" (off) state. Within the interrupt routine you will need to poll each of the appropriate ports to get a quick snapshot of the input conditions that triggered the interrupt.
This is very clever work around thanks, I'll have a play with it, cheers
 

Hans Michlmayr

New Member
If you need up to 16 input interrupts you could interface a PCA 9555 via i2c , the 9555 has its own interrupt output for input changes. This output can then be connected to one of the 3 normal PICAXE interrupts. The interrupt service routine then has to evaluate the state change(s) in the PCA9555 before deciding how to respond . (sounds more complicated than it is).
 

westaust55

Moderator
@ Hans,
Welcome to the PICAXE forum.

A good suggestion there if the user wishes to utilise an additional chip (sometimes PCB real estate is deemed to be an issue).

Another similar chip is the MCP23017 providing 2 x 8-bit ports with two interrupt outputs that can be combined.
 
Top