Author Topic: USB  (Read 1976 times)

0 Members and 1 Guest are viewing this topic.

Offline amelTopic starter

  • Newbie
  • Posts: 4
  • Country: fr
USB
« on: May 17, 2021, 09:41:37 am »
Hello,

I found a problem with this schematic, there is no USB communicatio. what is the problem with this?
thank you.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: USB
« Reply #1 on: May 17, 2021, 12:59:30 pm »
The Vcc of the two sockets is not connected.
You can't drive LEDs off the data lines.
 

Offline amelTopic starter

  • Newbie
  • Posts: 4
  • Country: fr
Re: USB
« Reply #2 on: May 17, 2021, 02:10:20 pm »
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.
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 260
  • Country: fr
Re: USB
« Reply #3 on: May 17, 2021, 03:01:16 pm »
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.
« Last Edit: May 17, 2021, 03:04:18 pm by bateau020 »
 
The following users thanked this post: amel

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11519
  • Country: us
    • Personal site
Re: USB
« Reply #4 on: May 17, 2021, 04:08:58 pm »
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.
Alex
 
The following users thanked this post: amel

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: USB
« Reply #5 on: May 17, 2021, 07:10:09 pm »
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.

USB requires the data line to be pulled high in the nominal case.
No, 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:
« Last Edit: May 17, 2021, 07:19:52 pm by Renate »
 
The following users thanked this post: amel

Offline amelTopic starter

  • Newbie
  • Posts: 4
  • Country: fr
Re: USB
« Reply #6 on: May 21, 2021, 09:30:42 am »
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.
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 260
  • Country: fr
Re: USB
« Reply #7 on: May 21, 2021, 10:45:03 am »
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.html or https://www.yoctopuce.com/FR/products/category/usb-actuators
 
The following users thanked this post: amel

Offline amishasingh

  • Contributor
  • !
  • Posts: 17
  • Country: ca
Re: USB
« Reply #8 on: May 21, 2021, 11:14:16 am »
Actually for what sort of use case you are going with this schematic
Amisha
 

Offline TK

  • Super Contributor
  • ***
  • Posts: 1722
  • Country: us
  • I am a Systems Analyst who plays with Electronics
Re: USB
« Reply #9 on: May 21, 2021, 01:17:00 pm »
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.
 
The following users thanked this post: amel

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11519
  • Country: us
    • Personal site
Re: USB
« Reply #10 on: May 21, 2021, 05:24:19 pm »
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.
Alex
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3596
  • Country: nl
Re: USB
« Reply #11 on: May 24, 2021, 04:42:40 am »
At what speed is that USB bus working?
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: USB
« Reply #12 on: June 08, 2021, 05:02:03 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf