Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By buzzy
#78523
martinayotte wrote:Why not using a simple I2C GPIO Expander such MCP23017 ?
It is much simplier to use than trying to mux pins using those 74HC165 ...


Well, according to documentation and videos online, it's not suppose to be hard to use the 74HC165 either. Not sure why it's not working for me. Also, the MCP23017 cost 10 times more than the 74HC165. 10 cents vs 1 dollar. If I need 10 of those in one device, it adds up.

Btw, the 74HC165 is not a multiplexer, it's a shift register. The code of using it is almost identical to the I2C expanders, so it's not clear to me why using the MCP23017 would be easier? In what way? If anything, it's slower than SPI :)
User avatar
By martinayotte
#78535
buzzy wrote:Btw, the 74HC165 is not a multiplexer, it's a shift register.

I know, I've used them more than 30 years ago for video output. But the way you are using it with switches at the inputs is equivalent of a multiplexer ...
buzzy wrote:The code of using it is almost identical to the I2C expanders, so it's not clear to me why using the MCP23017 would be easier? In what way? If anything, it's slower than SPI :)

If it only to read switches, no speed requires, it becomes easier using a MCP23017 since it requires only 2 wires, and a third one if you wish interrupts capabilities...
User avatar
By buzzy
#78536
martinayotte wrote:
buzzy wrote:Btw, the 74HC165 is not a multiplexer, it's a shift register.

I know, I've used them more than 30 years ago for video output. But the way you are using it with switches at the inputs is equivalent of a multiplexer ...
buzzy wrote:The code of using it is almost identical to the I2C expanders, so it's not clear to me why using the MCP23017 would be easier? In what way? If anything, it's slower than SPI :)

If it only to read switches, no speed requires, it becomes easier using a MCP23017 since it requires only 2 wires, and a third one if you wish interrupts capabilities...


Ok, so can you tell what is wrong with my wiring/code? Thanks!
User avatar
By martinayotte
#78539
buzzy wrote:Ok, so can you tell what is wrong with my wiring/code? Thanks!

According to your schematic, it seems that your SW1 switch is shorting power and ground, it is not on the right side of the pulldown resistor.

Also, can you provide the code your are using since the issue maybe there ?