PCF8575 vs MPC23017

I'm planning to control 16 MOSFETs/transistors using either a PCF8575 or MPC23017 I/O i2c expander.

Additionally, I'll be using another I/O expander for a 4x4 keypad input matrix
(Also 8 input endstop switch )

So one pcf8575/mpc23017 for output and one for input

Questions:

  • Initial State of PCF8575 Outputs:
    • I've read that when a PCF8575 powers on, all outputs are initially high. Is there a way to mitigate this behavior, or does the MPC23017 have a different default state?

Also i read in forum that sometimes they can false make pins low/high because of noise. is this true?

  • Input Matrix and Interrupts:
    • For the 4x4 keypad input matrix, I'm considering using interrupt pins to detect key presses and then read i2c data (so i dont make infinit loop). Is this a good approach?

    • Which I/O expander (PCF8575 or MPC23017) would be more suitable for output and input and why you think so?

Please share your recommendations and insights.

I'm open to suggestions and alternative approaches. Thank you for your help!

Which Arduino (or other "compatible" MCU board)?

MCP23017 defaults its pins to input mode with no high output state. so it may be more suitable.

It's true, and can be mitigated with extra components. But the mitigation may be more complex than using MPC23017 instead.

Yes, the pins default to floating inputs. So you will need to connect pulldown resistors to avoid your MOSFETs from switching on randomly.

Yes, this should work, provided only one keypad key will be pressed at the same time. There are some Arduino libraries for using I/O expander chips with keypads but I don't know if they support using interrupts. So you may have to write your own code for this.

Both are designed for that task. The PCF chip is simpler and maybe cheaper, but it does have drawbacks in certain situations, including the one you mentioned already. The MCP chip is more complex, more flexible and probably more expensive. There is also SX1509.

This may be of interest

a7