| Electronics > Projects, Designs, and Technical Stuff |
| How to detect USB version device plugged to – determinate max available current |
| (1/1) |
| 3dgeo:
Hello, I'm making RGB LED keyboard (ATmega32u4 MCU) with changeable cable and would like to dynamically change LED MAX current according to available power. My goal is to set 800-850mA limit on USB3 and 400-450mA on USB2. According to this video (link below) USB3 type-C has "CC1" and "CC2" pins for orientation detection (they are pulled up), I assume all I have to do is to look for voltage on one of those pins. If 5V present – it's USB3, otherwise it's USB2: Any ideas, better way to detect? EDIT: I realize that this solution will only work with Type-C, not with USB3 Type-A, so still need a solution. USB3 type C pinouts: |
| NiHaoMike:
I don't think it can be made to work on type C, but on type A and B, check if the USB 3 ground is actually connected to ground. |
| 3dgeo:
--- Quote from: blueskull on December 24, 2018, 01:29:02 am ---...just fuck the specification and draw 900mA as you wish. --- End quote --- :popcorn: and watch the world burn :) I'm planing to sell them, so no specification raping. Other idea I have is to look for voltage/resistance on extra differential pairs on USB3, tho I have no idea if this will work (I'll try it soon). If I don't find hardware solution I have to look in to software... |
| 3dgeo:
--- Quote from: blueskull on December 24, 2018, 03:23:06 am --- --- Quote from: 3dgeo on December 24, 2018, 02:59:08 am --- :popcorn: and watch the world burn :) --- End quote --- Many USB devices don't confirm to USB spec, and this is not a big deal. Ironically, LeCroy's USB protocol analyzer (Mercury T2 as I own) itself doesn't observe maximum suspend current limit. Also, many USB hard drives exceed 500mA limit, especially those ultra fast SSD ones. If you plug an USB3.0 SSD into an 2.0 port, and run a synthetic benchmark on random write or secure flash erase, it will almost guarantee to exceed the limit. --- End quote --- Well, I might add "let the world burn" option in my solution list for this issue, tho I have to do some testing first. |
| NiHaoMike:
--- Quote from: blueskull on December 24, 2018, 01:45:49 am ---USB3.0/3.1 spec requires no more than 500mA without USB3.0 enumeration. Even if it is a USB3.0 port, you are not SUPPOSED to draw more than 500mA, tough it will work. --- End quote --- Were the standards designers really that stupid? I would have said something to the effect of that a device connected to a USB 3.0 port can use up to 900mA as long as it can determine it is in fact connected to a USB 3.0 port, and even suggest a simple circuit for that purpose. There's also USB CDP and DCP, as well as type C having a lower resistance pullup to signal high current and a digital protocol to change voltage. |
| Navigation |
| Message Index |