I am testing a communication scheme whereby an arduino communicates with 12 others through a network of multiplexers. By cycling through the demultiplexers much faster than the multiplexers, I hope to establish communication between connected nodes by putting one channel on HIGH on the multiplexer, then reading this out on the connected demultiplexer.
(The reason why I am doing this, as opposed to using a shift register, is that these pins can then double as TX and RX for serial communication between the arduinos. If you have any advice for performing serial communication over a shift register, I would be incredibly happy.)
Regardless,
To test this scheme, I have two arduinos connected through the Multiplexer/Demultiplexer pair (broken out in this way https://www.sparkfun.com/products/9056). The multiplexer's com is connected to Digital Pin 10 which is high and routed so that four of the pins look like this.
MULTIPLEXER:
0010
On the other side, the demultiplexer is connected to Pin 11 and set as an input pin. It then cycles through each of the inputs on the demux, and reads the value. However, it seems like once the input pin is pulled to high, it stays high. Thus for the given input configuration, the output configuration is:
DEMULTIPLEXER:
0011
Any idea why this happens and/or how to fix this?
Are you saying if you select an input (which is high) then select another input (which is low) the pin on the controller is always high?
Any idea why this happens and/or how to fix this?
It sounds to me like you have not connected all the multiplexer pins to something and some of them are floating.
LarryD:
Are you saying if you select an input (which is high) then select another input (which is low) the pin on the controller is always high?
Yes but only AFTER I've read the High input
So if the output I'm reading is
0010
The input I read is
0011
Grumpy_Mike:
Any idea why this happens and/or how to fix this?
It sounds to me like you have not connected all the multiplexer pins to something and some of them are floating.
yes some of the pins are floating, but only the ones that are neither sending information nor being read.
Do those need to be connected as well? I'll test that out today and report back to those of you that are on pins and needles waiting to find out if this works.
pun intended
but only the ones that are neither sending information nor being read.
There are not any of those.
This is because you are changing the pins one at a time and so for a very short moment you are probably switching to all the inputs even if you do settle down and read them.
Also have you enabled the pull up resistor or have a pull up or pull down resistor on the arduino input you are reading?