NCD24 GPIO Breakout

Can someone point me to some additional information on how to utilize the “8-Channel Programmable Digital Input/Output” on the 24 relay board for the Photon?

The information is largely covered in the datasheet for the MCP23017: https://media.ncd.io/sites/2/20170721134516/MCP23017-47.pdf

I believe the registers are 0x00 for the first bank and 0x01 for the second bank.

The default mode is as an input. You would need to need to change the corresponding bit in in the byte written to the target registry to change it to an output. i.e. byte(0xfe) to register byte(0x01) would set gpio 1 on bank 2 to be an output.

Once it is set as an output it can be controlled like a relay.

If it is an input you can monitor it the same as a relay.

From a software perspective it doesn’t matter if there are relays on-board or just GPIOs. It just matters if the channel is set as an input or an output and what the desired state is.

Obviously if its a relay though you’d want to set it as an output.

I’m specifically curious about the following gpio’s, which I don’t see referenced in the above documentation. And for my purpose, I would be looking for them to be inputs, assuming they don’t interfere with the ability to use the included relays.

Those inputs form the entirety of bank 2 on the second MCP23017. They are defaulted to inputs so you just need to query the second MCP23017 for the status of bank 2.

What language/platform are you using to control the device?

I am using a particle photon. I also do some control via Node-Red on Home Assistant.

We have two libraries I we recommend for that board and Particle:

This one is cleaner in my opinion:

This one is easier to use in my opinion:

With the second library you can just call readAllInputs(); to get the status of the inputs. The status is returned in a single byte.