Author Topic: USB to USB bridge  (Read 1311 times)

0 Members and 1 Guest are viewing this topic.

Offline ZeroResistance

  • Frequent Contributor
  • **
  • Posts: 563
  • Country: gb
USB to USB bridge
« on: September 29, 2016, 04:14:22 pm »
What would it entail for a power supply of a PIC microcontroller based USB to USB bridge.

I am a bit unsure about the power supply section.

Basically it would be bus powered, the circuit has 2 uC's and these 2 are connected via a uart.

Each uC would be connected to a computer.

Each uC has a LDO regulator for itself my question is how to make the grounds common.

Would i need it to be optocoupled UART interface, or just short out the USB negative of both PC's.

Your comments would be highly appreciated.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 7932
Re: USB to USB bridge
« Reply #1 on: September 29, 2016, 04:25:06 pm »
If you direct couple them and one end's USB is plugged in and the other isn't you have the situation where one MCU is trying to power the other via the idle (high) level of its UART TX pin and the unpowered MCU's input protection diodes.  This can result in the other MCU failing to initialise properly when its USB is plugged in
This means you have to add extra circuits to shut off TXD if the other MCU isn't powered.  If you optocouple them, you don't get that problem + it no longer matters if thre is any ground potential difference between the PCs,
 
The following users thanked this post: ZeroResistance

Offline ZeroResistance

  • Frequent Contributor
  • **
  • Posts: 563
  • Country: gb
Re: USB to USB bridge
« Reply #2 on: September 29, 2016, 05:08:52 pm »
If you direct couple them and one end's USB is plugged in and the other isn't you have the situation where one MCU is trying to power the other via the idle (high) level of its UART TX pin and the unpowered MCU's input protection diodes.

If I understand you correctly. Power from TX of uc1 would flow into RX of uC2 and then forward bias the top input protection diode and feed into VDD of uC2. This would cause excessing current draw from TX of uC1 and might damage that pin. Did I get you right?
 

Offline Wilksey

  • Super Contributor
  • ***
  • Posts: 1153
Re: USB to USB bridge
« Reply #3 on: September 29, 2016, 05:26:25 pm »
Essentially when the USB is plugged in it gets power then it will try to enumerate, I think what Ian is saying, is that if you only plug one end of bridge in, it will pass power through to the 2nd PIC via the pull ups, so when you plug the 2nd PIC's USB into the computer it will already be "powered" and will not enumerate.  Using optocouplers will eliminate this issue as they will be isolated.
 
The following users thanked this post: ZeroResistance

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 7932
Re: USB to USB bridge
« Reply #4 on: September 29, 2016, 05:30:59 pm »
Not just risk of damage to the pins, but it may provide enough voltage to the core for it to to get in an unexpected state where it fails to come out of reset or comes out of reset with SFR values different to its normal power on defaults.   To a large extent it can be mitigated by enabling BOR on both MCUs and putting 1K resistors in series with the serial data lines, but that may reduce the max baud rate.
 
The following users thanked this post: ZeroResistance

Offline ZeroResistance

  • Frequent Contributor
  • **
  • Posts: 563
  • Country: gb
Re: USB to USB bridge
« Reply #5 on: September 29, 2016, 06:06:16 pm »
Ian.M / Wilsky

These are some really profound understandings...
Have some opto's lying around will check it out...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf