I’m using a pr16-4 relay board, Pr54-2 Featherlite IOT with Particle Photon2, Pr2-8 I/O.
I am using the DebounceSwitchRK and the MCP23008-RK from Rickkas7 Github.
I believe that continuously looping thru and polling the Inputs is the wrong approach and i should use the Interrupt on the MCP23008
- Do I have to physically connect the Interrupt for each MCP23008 on the PR2-8 board? I see some traces on the board labeled INT, are these interrupt?
- What input pins are available for this using the featherlite IOT for Photon2 with this hardware?
Thank you!!
Hi,
Yes, those INT pads on the board are the interrupt lines for the MCP23008. You can connect that to any available GPIO on the Particle module to monitor. However keep in mind we are powering the MCP23008 at 5VDC and the GPIO lines on the Particle module are 3.3VDC tolerant. This is why we do not connect them directly. We use a level shifter on the I2C lines to protect the CPU modules connected.
You are right, using the interrupt line would be better. However the best solution would be a multi core CPU so one core could be dedicated to monitoring the interrupt line while the main core handles application tasks. It looks like the Particle Photon 2 unfortunately is a single core processor. Something like the ESP32 S3 on the other hand is a two core processor and could handle this more efficiently.
Thank you,
Travis Elliott
Travis, Thanks for the reply.
It sounds like the hardware I have is not going to support using the Interrupt lines because of accessibility and voltage levels.
-
I have 2 of the PR2-8 I/O modules on the I2C. Would I need to get Interrupt access and connect to CPU I/O for each of the PR2-8 modules?
-
Do you have an adapter solution for the ESP32 S3 recommendation that resolves the Interrupt accessibility and voltage level issues?
I am finding that when rapidly continuously polling the I2C in a loop to detect a change in a switch or limit sensor that intermittently this fails and reports a false switch reading which leads to unexpected actions by the machine. I was hoping using the hardware interrupt on the MCP23008 would resolve this but it sounds like that is not reasonable.
Does NCD have products that will resolve these issue or what would you suggest?
Thanks!