Electronic – USB Chain Connections

usb

I have two questions related with the USB connections on a pcb:

1- Is it possible to connect D+ line between 2 devices and 1 host? something like SPI fashion where MISO and MOSI lines are shared between all slaves? Or like I2C where every node listens to the bus and replies only when the given address is called? The same with the D-.

2- I'm designing an embedded application with 2 devices, one of the is a USB-device and the other one is a USB-OTG. When the communication is between them, I believe there is no problem, the OTG behaves as a host and the second one as a device.
However, my question comes when I need to connect them (both as devices) to an external PC, is it possible to share the signal lines to the external PC, so I will have 3 devices connected on the line: uC USB-device, USB-OTG programmed as device and the PC USB-host.

Best Answer

1- Is it possible to connect D+ line between 2 devices and 1 host? something like SPI fashion where MISO and MOSI lines are shared between all slaves? Or like I2C where every node listens to the bus and replies only when the given address is called? The same with the D-.

No.

2- I'm designing an embedded application with 2 devices, one of the is a USB-device and the other one is a USB-OTG. When the communication is between them, I believe there is no problem, the OTG behaves as a host and the second one as a device. However, my question comes when I need to connect them (both as devices) to an external PC, is it possible to share the signal lines to the external PC, so I will have 3 devices connected on the line: uC USB-device, USB-OTG programmed as device and the PC USB-host.

If you want to make this work you will likely need a USB hub chip and two USB mux chips. The hub connects to the external PC, then the muxes are used to connect the on-board devices either to each other or to the hub chip as needed.