PFC8574 and/or MCP230XX on ESP32 #15796
-
Hi everyone, Quick question, is the PFC8574 driver available for the ESP32? Also, I checked the documentation and also #11176 and I see the expander has support for inputs. Do you think using a PFC8574 as inputs to connect momentary switches is a good idea, I mean is it as reliable as using the native GPIOs, or better to use only the native pins for this purpose and leave the expander for the outputs? I'm planning on building a 16 in/16 out board driven by an ESP32 and I'm evaluating my options. Thank you. Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
The PCF8574 is available on either ESP8266 or ESP32 but it isn't available in any default builds. Check : https://tasmota.github.io/docs/BUILDS/ The PCF8574 or the MCP230xx can be used for inputs but through rules (there is no direct software connection between a extender's input and a relay. So for your 16/16 device, I would choose to have the outputs on the extender and the inputs on native GPIO |
Beta Was this translation helpful? Give feedback.
-
Hello all, I see there is a new Mode 2 introduced in release 12.4 that enables I/O pins on expanders to function as native GPIOs. Is it really that simple? I mean, only a JSON template describing the I/Os and that's it? This is so cool! I developed an ESP32 board with 32 inputs and 32 outputs and ethernet, and I'm wanting to confirm this is really it before sending an order to JLCPCB. Also, I'm confused about using or not using the interrupt pins on the MCPs. Are they needed in Mode 2? And in Mode 1, what is the difference between using them or not? Doesn't the driver already poll the bus every 50ms to check for changes? So what is the use of an interrupt, make the ESP respond faster than the 50ms interval? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Ah, in the Web UI, now I see it. Sorry, I was thinking on how to put that info in the template and totally forgot about the Web UI. Thank you @barbudor and @arendst . |
Beta Was this translation helpful? Give feedback.
-
Added the following text to the docs:
|
Beta Was this translation helpful? Give feedback.
-
Hello all, Prototypes are working very well so far. There are still a few tests to do, like ethernet transfer speed, signals levels/integrity, and if Tasmota is correctly scanning the interrupt pins. I'll measure reaction times with and without interrupts configured and see what changes. There was one hiccup at the very start: a protection diode was inverted on the PCB. Gotta check better the components positions before confirming the order at JLCPCB next time. And also LEDs can be less bright :) Thank you very, very much for all the help and for making Tasmota the absolute wonder it is. What a piece of software! 🥇🥇 IMG_0572.MOV |
Beta Was this translation helpful? Give feedback.
The PCF8574 is available on either ESP8266 or ESP32 but it isn't available in any default builds. Check : https://tasmota.github.io/docs/BUILDS/
So you will have to build your own binary. See https://tasmota.github.io/docs/Compile-your-build/
The PCF8574 or the MCP230xx can be used for inputs but through rules (there is no direct software connection between a extender's input and a relay.
The disadvantage vs native GPIO is that you won't benefit from the debouncing so you will manage to have a clean signal on the hardware side.
On the other side, the extenders outputs can be used as Relay with same features as Relay on native GPIO
So for your 16/16 device, I would choose to have the outpu…