USB  - Page 1
Forum section: electronics / beginners

author: amel
author_rank: Newbie
timestamp: May 17, 2021, 09:41:37 am
content: Hello,I found a problem with this schematic, there is no USB communicatio. what is the problem with this?thank you.

author: Renate
author_rank: Super Contributor
timestamp: May 17, 2021, 12:59:30 pm
content: The Vcc of the two sockets is not connected.You can't drive LEDs off the data lines.

author: amel
author_rank: Newbie
timestamp: May 17, 2021, 02:10:20 pm
content: Thank you for your response, but I know that when we use USB as a device it is not important to connect VCC (connecting just D+,D- and GND): you can correct that for me if it is'nt true.can you explain for me how i can't drive LEDs off the data lines.

author: bateau020
author_rank: Frequent Contributor
timestamp: May 17, 2021, 03:01:16 pm
content: Can you show where those labeled lines are going to? That might help.Do you connect leds between the resistors that are shown and ground?In that case, see 3 potential issues:1) USB requires the data line to be pulled high in the nominal case. You will need the VCC to pull high.2) the USB data lines are high speed lines. They are sensitive to the load on them. Better to use a driver to drive the leds. You will need the VCC for that.3) leds act as photocells when you shine light on them. That light may also disturb the signal. Again, drivers are preferred.

author: ataradov
author_rank: Super Contributor
timestamp: May 17, 2021, 04:08:58 pm
content: If your device is self powered, it may not need USB VBUS for power, but it still may need it for enumeration,And also, what do you expect to see on those LEDs? USB has constant SOF packets going, the LEDs will just be driven by a constant 1 kHz signal, so they will be constantly dimly lit.

author: Renate
author_rank: Super Contributor
timestamp: May 17, 2021, 07:10:09 pm
content: Yes, the spec calls for Vbus to be sensed to know when it's connected.That's not to say that some devices will work anyway.For initial determination whether a device is low speed or full speed a 1.5k resistor is connected to D+ (for FS) or D- (for LS) to 3.3V (not Vbus).A bare LED in either direction will disturb this.Quote from: bateau020 on May 17, 2021, 03:01:16 pmNo, USB does not use pullups in that sense (like the old PS2 keyboard interface that used open collector drivers).In high speed mode the data lines are basically DC ground with 400 mV signals (for +/- 400 mV differential signal).It's really quite simple:

author: amel
author_rank: Newbie
timestamp: May 21, 2021, 09:30:42 am
content: Hello,There is somone (hardware engineer) who propose to me to use Schmitt Trigger with USB data line to drive Leds! I think that is not possible.can you confirm to me this?Thank you.

author: bateau020
author_rank: Frequent Contributor
timestamp: May 21, 2021, 10:45:03 am
content: USB is a rather complicated protocol. You will not be able to control a led via a schmitt-trigger alone. You will need more.If all you want is to switch on or off a led, the easiest may be to go via an arduino, an ESP8266/ESP32 or boards like this:https://www.banggood.com/1-Channel-5V-HID-Driverless-USB-Relay-USB-Control-Switch-Computer-Control-Switch-PC-Intelligent-Control-Relay-Module-p-1555191.htmlorhttps://www.yoctopuce.com/FR/products/category/usb-actuators

author: amishasingh
author_rank: Contributor
timestamp: May 21, 2021, 11:14:16 am
content: Actually for what sort of use case you are going with this schematic

author: TK
author_rank: Super Contributor
timestamp: May 21, 2021, 01:17:00 pm
content: You need to minimize disturbing USB signals. Higher the speed, lower the tolerance in bus disturbance. i.e. just adding the banana plug sockets might disturb the signals and make it unusable. The same for the LED. And as other member already said, the LED will be lit all the time, if it works. I tried to make a USB Y cable to connect some logic analyzer probes and just by adding the wires made it unusable. I had to build everything on a PCB with the shortest wire length possible.

author: ataradov
author_rank: Super Contributor
timestamp: May 21, 2021, 05:24:19 pm
content: You need to describe what you expect to see on those LEDs. Adding a simple logic gate as a buffer would be fine in most cases. But all you will see is both LEDs be dimly lit when the devices are connected.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 24, 2021, 04:42:40 am
content: At what speed is that USB bus working?

author: Renate
author_rank: Super Contributor
timestamp: June 08, 2021, 05:02:03 pm
content: As we've determined, you really can't throw LEDs directly across a functional USB circuit.But...A device as the first step of enumeration throws a 1.5k pullup resistor between its internal 3.3V source to either D+ (for FS/HS) or D- (for LS).We can make a handy little tester to test this.Connect two LEDS directly between D+ or D- to ground.Feed your device with 5V and ground, but don't connect the D+/D- from your hub or whatever.Plug in a LS keyboard and the LS LED goes on.Plug in a FS/HS device and the HS LED goes on.Plug in your Omnicron666 µC that you're developing a custom USB lib for and see if a LED goes on.Plug in your ATMega32u4 with silly code and watch the LEDs toggle.