Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

I've got a project where the customer wants to use a long (5M+) USB cable to connect our PSoC5LP-based USB HID.  The issue being that USB Full-Speed max cable length is 3M.

Can I do anything to reduce the PSoC5LP to a Low-Speed device rather than Full-Speed to meet this requirement?  Would the host perhaps automatically switch to LS if it can't communicate over FS?

Would there be other concerns regarding speed at that point?  The PSoC USBFS component is configured as a composite Mouse+Keyboard device, 2 Endpoints at 8 bytes each, which I think should be OK?

This project also has the PSoC USB device being sent out to the customer through an integrated USB hub, which may negate the issue?

0 Likes
2 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Kyle,

If I remember correctly, lower USB speed compliance is built into the USB Fast standard.

There may be 4 ways to achieve this.  

  1. Have the slave USB port once connected to the USB master communicate the compliance level.   I don't know how to but I'm willing to bet it exists.   Hopefully someone else on this forum can tell us how.
  2. Attach the longer (>3M cable) and try sending at max speed.   There may be a ISO low level routine that sees too many bit errors and force the next USB conversations to a lower data rate to improve BER reliability.   In this mode, this is automatically done for you as a part of the OSI-level communication in the USB stack.
    Here's a snip from the USB wiki:

    "From the computer user's perspective, the USB interface improves ease of use in several ways:

    • The USB interface is self-configuring, eliminating the need for the user to adjust the device's settings for speed or data format, or configure interrupts, input/output addresses, or direct memory access channels.[13]"
  3. Attach the PSoC with a longer cable to a USB hub that is only compliant to the lower data rate.  The hub probably uses "1." to achieve the forced lower rate.
  4. You can purchase USB repeaters that pass on the USB signals and buffer them.  They add a latency to the overall data transfer but might be an acceptable solution for application.

Suggestion for an experiment:   

  • Create a simple USB comm project that sets up the PSoC USBFS and tries to transfer data at maximum speed.   
  • Note: The USB standard uses a CRC on each Tx packet for data integrity.  This is handled at both ends.
  • Using the Systick (or Timer) calculate the estimated Tx data rate. Use the PSoC UART port to display the estimated Tx data rate.
  • Using a 3M or less cable, test the project.   Note the estimated data rate.  This is your USB 'Fast' reference.
  • Now use a greater than 3M cable.   Note the estimated data rate.   If significantly less than the reference, then the data rate is automatically backed down due to transmission errors.
  • As a further test, keep adding more USB cable length using USB extenders.

The 3M for USB Fast is a recommendation based on standard cable line losses and impedance/inductive/capacitive delay issues.   The longer the cable:

  • the more series resistance (line losses)
  • the more the inductive delays (current delays)
  • capacitive delay (voltage delays via RC tau) This is the primary cause for longer rise and fall times which limit the maximum transfer frequency.
  • Longer and potentially more significant signal reflections due to less than optimal line termination and the speed of light of electron movement in the wires.

The reality is that better long USB cables can be found that provide 3M-equivalent performance (except for speed of light factor reflections) at a cost.  Note:  You can extend the cable length with extenders.   Not advised.  There is usually a 0.5dB to 1.5 dB connection loss at each connector.  If extenders are needed, gold-plated terminals are usually better.

Question:  What is the minimum aggregate data rate you are trying to achieve in your application?

If it's relatively slow (200Kbps), then you can use other communication methods such as RS485.   

If it needs to be fast but at a distance, think WiFi.   WiFi can travel very long distances (with ever increasing latencies) using repeaters.   Think of data over the internet.  Cabling costs and installation are negligible.  But depending on the distance, it might require routers/repeaters.

Len
"Engineering is an Art. The Art of Compromise."

Len,

Thanks for the in depth answer!
We are unfortunately tied to USB by spec, and are now realizing this could be a potential risk.  We also don't have information on the host the customer is connecting to (it could be quite old, as many industrial machines can be)  I think you're right in that some more testing will be required.  Time to buy some very long USB cables and see what we can find.

What I'm hoping for is that since we are using a powered hub (on the PCB alongside the PSoC) between the PSoC and host, that will provide the transmission strength needed to carry over some longer cables.  We don't know what the customer is using for their host machine, but maybe we can get some info out of them to determine if this will actually be an issue worth worrying about.  If the host is USB 2.0 compliant, even if they're only using a FS/LS data transfer rate, the 2.0 spec calls out longer cable lengths so It's possible it could negate the issue entirely.

Thanks again!

0 Likes