Created Sat, 25 Jan 2014 12:32:26 +0000 by Adonosonix
Sat, 25 Jan 2014 12:32:26 +0000
I am using a Max32 development board and I would like to handle 3 external interrupts. I have selected INT0 (pin3) INT1 (pin3) and INT3 (pin7). My test setup makes the board toggle ON/OFF three LEDs when an interrupt is detected.
INT0 appears to work fine. INT1 does not work INT2 works, but each time it is triggered, the orange LED on the RJ-45 connector of the network shield blinksâ€¦
So, I am confused, and it seems like the network shield is using some of the interrupts pins.
My question is : are there 3 interrupt pins that are safe to use when having a MAX32 board with a network shield attached ?
Obviously, not INT1 and INT2â€¦
Thank you for reading me.
Sat, 25 Jan 2014 22:58:34 +0000
Any of the Change Notification pins with my Change Notification library?
Sat, 25 Jan 2014 23:05:03 +0000
Thank you for your reply. Since I could not solve the issue, I did resort to polling from a timer triggered every 5 ms. The pulses I wish to detect are 30 ms long. Unfortunately is sometimes work (the pulse is detected), sometimes, it doesn't. And I don't know why.
I will check out your library. Thank you for sharing it.
Sat, 25 Jan 2014 23:18:23 +0000
You're welcome. The code is quite old - I wrote it a while back (it may have been my first library for the chipKIT...) so I don't know how well it works any more.
It's on my list of libraries to overhaul and move to GitHub.
Wed, 29 Jan 2014 21:09:32 +0000
Going back to your original question of if there are 3 interrupts that are safe to use with the network shield: it depends on what else you are using with the shield.
There are 5 interrupt pins on the MAx32. As you were noticing you can use INT0 on pin 3. Doing some digging in the Network Shield reference manual gives you some idea as to which interrupts will and will not work ([url]http://www.digilentinc.com/Data/Products/CHIPKIT-NETWORK-SHIELD/chipKIT%20Network%20Shield_rm.pdf[/url]).
Here's the brief overview on the other 4 interrupts.
INT1 on digital pin 2 is tied to the power distribution switch for the Network shield and cannot be used simultaneously as the USB controller.
INT2(digital pin7) is tied to the active low reset signal of the ethernet transceiver. I'm not quite sure why the orange led is blinking when this interrupt is triggered, but I'm guessing it has to do with the both this reset signal and the rest of your setup.
INT3(digital pin21) and INT4(digital pin 20) are tied to SCL1 and SDA1 on the Network shield, so they cannot be used as an interrupts if the I2C1 bus is being used (so these interrupts cannot be used if the EEPROM is being used).
If you don't need the EEPROM or I2C1, you could have three interrupts. But if you do want full functionality of the shield, majenko's Chance Notification library sounds much more promising.
Wed, 29 Jan 2014 21:18:39 +0000
Thank you very much for your reply.
Since I already use a timer (originally to perform periodic tasks every 60 seconds), I have tuned down the timer interrupt frequency to 3.3 ms and use it to read the status of the three pins I need.
I actually need to detect 30 ms wide pulses, but one of the devices seems not to respect the specification, and the only way for me to catch its pulses was to dial down the timer interrupt to 3.3 seconds.
Turns out this is not really an issue. It has been working well continuously for 48 hours now.
Thank you for the information you provided. They are really useful in helping me to understand the shield better.