Go Down

Topic: How to connect inhibitor / enable with several multiplexers? (Read 353 times) previous topic - next topic

Imbecillen

Hello,

I'm building a project with several multiplexers, the 4067 one specific. My thoughts is about the inhibitor pin, or enable as some call it. I see a lot of people just set it to ground in the hardware, and some that connect it to a multiplexer pin, and code it low instead.

I'm wondering about the advantages or disadvantages about this. I get that you loose some pins on your controller if you connect it so, because the inhibit need one pin each right? Not possible to connect together like the control pins and just use one pin on the MC?

In my specific project I use code where I can set the amount of potentiometers I want to read per multiplexer, does this affect in any way how I use the inhibitor/enable? Since I can adjust how many pins I want to read I don't really need to shut of the whole multiplexer (I just set the 16 pins to 0). And if I understand right, the microcontroller reads the multiplexer in a good order even if I don't code up anything about the inhibitor right?

Say I use 4 multiplexers and set all the inhibitors to GND, it will read automatically and just loop the 4 muxes in series?


groundFungus

Quote
Not possible to connect together like the control pins and just use one pin on the MC?
Yes it is possible, if you want to enable/disable all of them at once.  If you have no reason to disable the multiplexers, just tie all of the the enable pins to ground.

Imbecillen

Yes it is possible, if you want to enable/disable all of them at once.  If you have no reason to disable the multiplexers, just tie all of the the enable pins to ground.
Nice! It's not possible to make an array and turn off individual multiplexers when they are set to the same pin? Probably they can just recognise 1 or 0, which makes it impossible I guess..

Thanks for your answer anyway!

PieterP

This is what I use in my Control Surface library: https://github.com/tttapa/Control-Surface/blob/8a845f7da369107153200ae4493538d842f3f4e3/src/Hardware/ExtendedInputOutput/AnalogMultiplex.h

The principle is very simple: set the address, pull the enable line low, read the input twice (discard the first read), pull the enable line high again.

All multiplexers share the same address lines, and are connected to the same input, but each mux has its own enable line. This allows you to share one analog pin across multiple muxes, at the expense of one digital pin per mux.
If you are using only one multiplexer, you can just tie the enable line to ground, of course.

Pieter

Go Up