# PCF8575 vs MPC23017

**URL:** <https://forum.arduino.cc/t/pcf8575-vs-mpc23017/1317977>\
**Category:** General Electronics\
**Created:** [November 3, 2024, 3:35am UTC](https://forum.arduino.cc/t/pcf8575-vs-mpc23017/1317977 "2024-11-03T03:35:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arpa123](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/arpa123/32/1098836_2.png) [@arpa123](https://forum.arduino.cc/u/arpa123)\
**Post date:** [November 3, 2024, 3:35am UTC](https://forum.arduino.cc/t/pcf8575-vs-mpc23017/1317977/1 "2024-11-03T03:35:35Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![JCA34F](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jca34f/32/340148_2.png) [@JCA34F](https://forum.arduino.cc/u/JCA34F)\
**Post date:** [November 3, 2024, 4:16am UTC](https://forum.arduino.cc/t/pcf8575-vs-mpc23017/1317977/2 "2024-11-03T04:16:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aliarifat794](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@aliarifat794](https://forum.arduino.cc/u/aliarifat794)\
**Post date:** [November 3, 2024, 8:45am UTC](https://forum.arduino.cc/t/pcf8575-vs-mpc23017/1317977/3 "2024-11-03T08:45:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [November 3, 2024, 9:12am UTC](https://forum.arduino.cc/t/pcf8575-vs-mpc23017/1317977/4 "2024-11-03T09:12:38Z")

</div>

> [@arpa123](#):
>
> when a PCF8575 powers on, all outputs are initially high. Is there a way to mitigate this behavior

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

> [@arpa123](#):
>
> does the MPC23017 have a different default state?

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

> [@arpa123](#):
>
> interrupt pins to detect key presses and then read i2c data

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.

> [@arpa123](#):
>
> Which I/O expander (PCF8575 or MPC23017) would be more suitable for output and input

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.

---

<div class="post-metadata">

**Author:** ![alto777](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/alto777/32/317385_2.png) [@alto777](https://forum.arduino.cc/u/alto777)\
**Post date:** [November 3, 2024, 1:44pm UTC](https://forum.arduino.cc/t/pcf8575-vs-mpc23017/1317977/5 "2024-11-03T13:44:54Z")

</div>

This may be of interest

> [@Interfacing MCP23017 E/SP with arrays in Arduino IDE](https://forum.arduino.cc/t/interfacing-mcp23017-e-sp-with-arrays-in-arduino-ide/1309545/25):
>
> Maybe something [like this (on Wokwi)](https://wokwi.com/projects/413365936912881665) Edit : I used an other library because the one you used isn't easily available on Wokwi but the general idea remains the same : use arrays, subtraction and modulo. Did you notice that GPA7 & GPB7 should not be used as inputs despite what the configuration registers allow. As [stated by Microchip](https://microchip.my.site.com/s/article/GPA7---GPB7-Cannot-Be-Used-as-Inputs-In-MCP23017), it can lead to SDA signal corruption or even malfunction in the host bus under some conditions.? The SPI version of the chip (MCP23S17) doesn't seem to have the f…

a7

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 2, 2025, 1:45pm UTC](https://forum.arduino.cc/t/pcf8575-vs-mpc23017/1317977/6 "2025-05-02T13:45:23Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
