Author Topic: Converting USB 2.0 to full duplex  (Read 21311 times)

ramananb

  • Member
  • ***
  • Posts: 1
Converting USB 2.0 to full duplex
« on: September 19, 2011, 09:35:06 pm »
Hi !

We are a group of students looking to transmit the data line of usb over a laser link. The link consists of a transmitter and a receiver on either side - so there is a distinction between the transmitted and received right at the start itself.

Does anyone know how to resolve the data from the USB 2.0's D+/D- based on its direction on the bus? so that we can use it for redirection of a data from the PC / data line into either the Tx or Rx ?

It would be something like a USB to Serial interface, just that we don't want the speeds to get degraded to the levels of a COM port.

Thanks!


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Converting USB 2.0 to full duplex
« Reply #1 on: September 19, 2011, 11:06:54 pm »
You can design and program a USB communications-devices-class virtual-serial-port device that looks like a COM port to the host computers but uses whatever protocol you want for the wireless link. The host computers don't have to know or care what happens in the wireless link. The devices can ignore baud rate, etc.

For example CDC firmware, see:

http://www.lvr.com/serport.htm#usb_virtual_com_ports

You'll want to use some kind of error-checking protocol for the wireless link.

You could also use WinUSB or libusb to communicate between the host computers and devices.

Jan

JulianC

  • Member
  • ***
  • Posts: 2
Re: Converting USB 2.0 to full duplex
« Reply #2 on: September 20, 2011, 02:37:21 am »
Hi Jan,

I'm from the same group of students as ramananb. Thank you very much for your prompt reply and advice, that is indeed one way we can go about establishing a wireless link.

However, we are thinking along the lines of modifying a USB2.0 bridge cable to include a laser link, as our focus is more on the hardware component instead of software. Our objective is to be able to transfer large files (e.g. a 5MB .mp3 file) between two PCs at hi-speed (480Mbps).

The problem we have been trying to overcome for the past week is how we can convert the half-duplex signal D+/- in the USB2.0 bridge cable into full-duplex signals, Tx+/- and Rx+/- so that we may integrate the signals with our laser drivers and demodulators. Chapters 3 and 4 of your book "USB complete: Second edition" gave us great insight as to how data packets are transferred for USB protocol, however we are still unable to utilize this knowledge to solve the problem we face above. Do you have any advice for us regarding this?

We would also like to ask another question pertaining to USB3.0 - is it possible for SuperSpeed to operate at less than 4.8Gbps (say, 3.5Gpbs)? We have submitted a proposal to our school library to get a copy of the fourth edition of your book which includes USB3.0, but the approval process will be rather lengthy so we hope to seek your understanding in this matter.

Thanks once again!

Guido Koerber

  • Frequent Contributor
  • ****
  • Posts: 72
Re: Converting USB 2.0 to full duplex
« Reply #3 on: September 20, 2011, 04:54:13 am »
First of all you are trying to use a hammer to drive a screw.

USB ist not a network interface, it is a peripheral interface. Using it to connect two computers is basically the wrong idea. The USB protocol is not designed to be used to connect two computers. And your attempt to go for a connection at a low protocol level is doomed to fail since the USB protocol has quite tight timing restrictions that you can not match when you insert any kind of additional communication protocol.

What you can do is build network devices that use the USB to connect to the computers. And that is what Jan tried to point out to you.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Converting USB 2.0 to full duplex
« Reply #4 on: September 20, 2011, 11:27:45 am »
To convert wired USB to a high-speed wireless interface, you would need to design and fabricate a chip to do the conversion. You can't do it with a few off-the-shelf components. To get an idea of what's involved, see the Wire Adapter chapter in the Wireless USB spec:

http://www.usb.org/developers/wusb/docs

SuperSpeed, like the other USB speeds, uses a constant signaling rate on the bus. The throughput of useful data is less than the signaling rate.

I'm assuming you have a special reason for wanting to use the laser link rather than wireless USB,  wireless networking, or Bluetooth.

Thanks for asking your library to order USB Complete 4th Edition!

Jan
« Last Edit: September 20, 2011, 11:36:56 am by Jan Axelson »

Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: Converting USB 2.0 to full duplex
« Reply #5 on: September 21, 2011, 01:56:39 am »
Hi ramananb and JulianC,

Sound like you are making a USB repeater (extender) over the laser link.
Then, you may be aware of these rules on USB transactions.
1. The first packet (Token phase) of every transaction (including SOF) is initiated by the host side.
2. The direction of the second packet (Data phase), and the third (Handshake phase), if any, is determined by the type of the token packet.
3. The timing of packets in a transaction are tightly tied by the requirement of bus turn-around time/ inter packet delay

Refer to these section of the USB2.0 spec (usb_20.pdf, http://www.usb.org/developers/docs/usb_20_071411b.zip )
7.1.18.2 High-Speed Bus Turn-around Time and Inter-packet Delay
7.1.19.2 High-Speed End-to-end Delay
7.1.14.2 High-speed Hub Signaling Timings

You may also be aware of bus events
a) Bus idle
b) Bus reset and high-speed chirp
c) Resume

A ULPI (or UTMI+) transceiver chip will make your life easy. It decodes bus signaling of USB into a 60MHz parallel bus. A FPGA splits the timing for the laser link TX/RX.
Code: [Select]
                                +---> Laser link TX >---+
USB (upstream) ---- ULPI === FPGA                       FPGA === ULPI ---- USB (downstream)
                                +---< Laser link RX <---+
Digikey sells SMSC and TI transceiver chips

ULPI and UTMI+ specifications
http://www.ulpi.org/documents.html

Tsuneo

JulianC

  • Member
  • ***
  • Posts: 2
Re: Converting USB 2.0 to full duplex
« Reply #6 on: September 22, 2011, 03:08:23 am »
Hi Jan and Tsuneo

Thanks for your input; it really helped us to understand the complexity of the problem better.
We are looking into the last option as suggested by Tsuneo - about using an FPGA to implement the necessary conversions.

On a side note, what if we were to use USB3.0 instead, and directly connect the Tx+/- lines to our transmitter while connecting the Rx+/- lines to our receiver while ignoring the D+/D- lines (i.e. no USB2.0/1.1 compatibility).

The question is whether a USB 3.0 cable without the D+/- pair would still work , although only at SuperSpeed mode.

Thanks once again!

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Converting USB 2.0 to full duplex
« Reply #7 on: September 22, 2011, 09:09:12 am »
I hadn't thought about using an ULPI, which is the chip that normally resides upstream of the connector (inside the host).

But every USB communication is between a host and a device. (USB 3.0 defines a host-host interface but I don't know of any hardware support for it yet.)

If your goal is to connect two PCs, what you need is two USB devices that exchange data via a shared buffer or other means. That's what USB host-to-host bridge cables contain.

Jan