Using 74hct08 to move usb signal from one device to another

I am working on a PCB that has 2 ESP32-S3 on it and I was thinking of using a switch, together with 4 and-gates to redirect the signal to different microcontrollers. I found out, that the frequency of the usb-protocol is usually 12MHz but could also be more and I wanted to know if it is a good idea to use the 74hct08 IC or if there is another way for me to move the signals.

My implementation has one pin of the switch connected with D+ and D- on 2 gates, while the other pin is connected with them on 2 other gates. Both outputs of the switch are pulled down and the common pin is connected to 5V.

I could not find any help on this and the only idea that i had was to compare the period of the usb-protocol and the transition time of the IC. Anyone know if this would work? And if not, Should I use a Tri-State buffer instead?

USB is differential and bidirectional so an HCT08 would not work.
Use a switch intended for USB.
Why not just use a USB hub?

Here is one possible IC

1 Like
  • Have you considered using an FTDI module and then SN74LVCxxx gates.

  • When discussing a circuit show a schematic instead of texting a jumble of words.

Thank you for the recommendation. I was stupid. I completely forgot that the esp needs to send data back through the usb port.

My schematic is mixed up. I have split it into multiple sheets but the amount of elements on each sheet makes it hard to single out the circuit. I will upload pictures of the schematic from now on.

Has nothing to do with the ESP.
ALL USB communications send data both ways no matter which way you are sending.

just use a DPDT relay to switch D+ and D- between the 2 ESP...

one like these should do the trick IMHO https://uk.rs-online.com/web/p/hf-rf-relays/6839731P

An output from your CAD package would be prefered. Most can output an image file or a pdf.

From what I can see in the datasheet of the TS3USB221DRCR, OE is just to enable if the data is sent further or not. Correct me if I'm wrong, but could I simply connect it to ground? I was also wondering how exactly the S pin works. I'm guessing the input is connected to 1D+ and 1D- when S is low and with 2D+ and 2D- when S is high.

Datasheet:

  • On the controller side of an FTDI chip, a couple SN74LVC2G66 gates can be configured as a transfer switch.

Thank you for the recommendation. I have implemented the TS3USB221DRCR IC. However, I would still like to know how the S pin influences the output. If 1D+ and 1D- are connected to the output when S is 0 or 1.

Also to consider is the data rates are negotiated between TWO devices at startup. A second device will NOT know the current data rate between the PC and the first device. Also you will NOT want to switch while a message transmission is in progress!

Hello, That is not my intention. I use the switch to choose which microcontroller is connected to the USB connector. It will mostly communicate with only one of the 2 esp32, since the other is used as peripheral manager, so it will be programmed once with a bridging program, allowing the 1st esp32 to tell it which pins should be turned on and off.

  • I am only familiar with the ESP-WROOM-32

  • Can you connect the ESP32-S3 directly to USB differential signals ? :thinking:

Yes. It has a built-in USB to UART converter.

1 Like
  • Good to know

Yes

I'm guessing the input is connected to 1D+ and 1D- when S is low and with 2D+ and 2D- when S is high.

Yes

When S=0

Why would it need to know?

Alright, thank you very much for the clarification