Using alternative multiplexers (74HC4067 )

I have a bunch of 74HC4067 breakout boards laying around. They’re pretty cheap and useful to quickly expand some controller’s gpio…
I’d like to use them in my zynthian box… what would be the best way to go about that?
I imagine writing a python script that bridges the MUX and zynthian’s virtual pins would work, but I believe there has to be a better way :o
Couldn’t find much documentation on that… most things refer to the MCP23017 but I’m cheap and would like to use what I have :slight_smile:
A “74HC4067” option in the hardware dropdown would be super sexy :eyes: if that’s not kind of a thing already…

1 Like

Unfortunately, we don’t have such an option yet, but i’m pretty sure you are perfectly capable of implement it, :wink:


I’d love to contribute <3 My c is a bit dusty, but I’ll see what I can do.
I just went over the code (webconf / & zyncoder.c) and I’m wondering what the best way to implement it would look like.
I’m guessing it would be similar to the MCP23017’s integration, but with some low level multiplexer handling instead of WiringPi and I2C .

I guess the easy way would be:

  • Input field for the 4 control pins and 1 passtrough pin
  • Reserving 16 pin numbers for the MUX, access to those gets routed through the MUX(is that kind of how the MCP23017 is integrated currently?)

Could even be expanded to use multiple MUXs
Could even be used recursively (chaining MUXs, using MUX pins as control pins for new MUX)!
Infinite MUXery!
Infinite pins!
Terrible idea probably!

When I built my first custom Zynthian I designed a hardware controller which sat on the I2C bus to provide rotary encoders, switch inputs and potentiometer inputs. This replaced the Zynthian’s own interface board. I planed to create PSUs for this (the designs are in the repo) and have a monster device with dozens of knobs and switches. I shelved those plans when other commitments took up my time (and when i obtained some official Zynthian devices) but may return to them in the future - although maybe not! There may be some nuggets of inspiration to be garnered from that project. The I2C interface for that project is supported by Zynthian. Someone else adapted the idea, losing the multiplexing to provide just the 4 encoders and switches for their custom Zynthian.