Multiplexer debug

Hello.
For some reason my project always return the same signal: https://www.tinkercad.com/things/lWUBLKpaEZ5?sharecode=fXgNdaD5z7-5tEf058wUVXXFQIriAu0zrazh4DCXoPk
This is the project of an multiplexer 2:1 with and gates.
What's the reason?

So what testing/investigation/debugging have you done?
What have you learned from it; eg, what bits are working as you expect?

That requires a login. :frowning_face:

I do have a Tinkercad login, but that project either no longer exists or the link is wrong...

image

I'm testing passing a bit from Arduino to signal select to the nand and testing with two oscilloscope.. possibly I need to change privacy definitions in the project

I refreshed the provided link in original post and here is the nerw link Circuit design Brilliant Duup | Tinkercad . It works like i we define the sel signal.

Ok, but the wiring is pretty hard to understand:
image

Just some tips to draw a better circuit:
First, use colors for the wires. Red for +5V, black for GND, and possibly different colors based on scope (e.g. yellow for signals, blue for LEDs, etc).
Second, use curves. To connect distant pins, don't go straight to the other side, make a cleaner wiring by clicking intermediate points where the wire will "bend". I mean this kind of connections:
image

Lastly, based on your description, your project just multiplexes the inputs using a couple of NANDs, so an even hand drawn schematics could help us a bit more.

Ok improvements done I used brown for signal inputs, black and red for 5v an ground, pink for signal output, blue for internal connections and finally green to the select. But we yet have the same bug. Always get the same result.

I don't see bugs, except the code where the input switch is missing, you just set the control pin to HIGH all the time:

void setup()
{
  pinMode(7, OUTPUT);
}

void loop()
{
  digitalWrite(7, HIGH);
  delay(10); // Delay a little bit to improve simulation performance
}

To switch you need to change it LOW or HIGH depending on the input you need to get to the output, and you need enough delay to be able to see the resunt on the virtual oscilloscope:

void setup()
{
  pinMode(7, OUTPUT);
}

void loop()
{
  digitalWrite(7, HIGH);
  delay(300);
  digitalWrite(7, LOW); // you missed this!
  delay(300); // and this
}

With this code, I see the two waveforms switching form one to the other.

Thanks. Next challenge: build the demultiplexer.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.