Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:41 17 Sep 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Maximum number of interrupts?

Author Message
Bizzie
Senior Member

Joined: 06/07/2014
Location: Australia
Posts: 192
Posted: 12:16am 08 Mar 2015
Copy link to clipboard 
Print this post

Am I correct in thinking that the CGCOLORMAX2 from CircuitGizmo has the most "pin" interrupts of all the mites so far?

I need a system where I can monitor 10 lots of 4 (only 1 of the 4 will be closed at anyone time) digital inputs from reed switches. Rather than rely on the speed that you can loop through these I would like to use interrupts but I do not know of a mite which will give me 40 and still use I2C.

Also is there anyway to know which pin generated the interrupt other than checking each pin with the pin(x) function?
Rob White
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2447
Posted: 01:44am 08 Mar 2015
Copy link to clipboard 
Print this post

  Bizzie said  
Also is there anyway to know which pin generated the interrupt other than checking each pin with the pin(x) function?


i believe there is no other way apart from checking each pin. the only other solution offered by others in the past was to have a separate interrupt handler assigned to each pin. i do recall suggesting (during micromite beta testing) that the pin number should be accessible to the handler in some way, but was roundly outvoted by other forum members.

if it is essential to capture every single event, your safest approach is to use a hardware solution consisting of 40 latches that your micromite or maximite can then sit there polling.

if using micromites, there is no reason you can't have several working together.


cheers,
rob :-)
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10400
Posted: 02:34am 08 Mar 2015
Copy link to clipboard 
Print this post

  Quote   Rather than rely on the speed that you can loop through these I would like to use interrupts


The pin interrupts aren't true hardware interrupts, the pins are actually polled between the execution of each Basic command or in a continuous loop in a PAUSE statement.

Given this there isn't too much advantage to using the interrupts rather than polling in your program. If you use the PORT function you can check up to 23 inputs at once.
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 07:53am 08 Mar 2015
Copy link to clipboard 
Print this post

You may find a solution in this document . Also see this link .
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 08:42am 08 Mar 2015
Copy link to clipboard 
Print this post

Have a look at one of these.
These are I/O port expanders and are available in I2C and SPI versions.
They can be configured for input or output and can also generate an interrupt.
With I2C you can use up to 8 of them giving you a maximum of 128 i/o ports.
A lot cheaper then using uMites or other mcu's. The aded benefit is that they are also 5.5v tolerant and give you a separation between the switches and the mcu.
When configured to use interrupts a register will capture which pin it was so that even when the pin returns to its previous state the information is still available.
Also available in DIP for easy bread boarding.

Edited by TZAdvantage 2015-03-09
Microblocks. Build with logic.
 
Bizzie
Senior Member

Joined: 06/07/2014
Location: Australia
Posts: 192
Posted: 10:56am 08 Mar 2015
Copy link to clipboard 
Print this post

Thanks to you all for your very useful answers.
Am annoyed with myself about not thinking of the PORT() command/function!

Looks like I should not get too overwhelmed with all the available pins and go back to how I would of handled this in the past - multiplexing! but with BobD's I2C suggestion.

Thanks again

Rob

Rob White
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025