Giter Club home page Giter Club logo

dude-dirty-usb-disconnect's Introduction

dude-dirty-usb-disconnect

GitHub version Build Status License: WTFPL

GitHub last commit

USB CDC-ACM uart like controlled USB Hub:

  • 1.5A fuse;
  • Power switch with overcurrent, undervoltage and overtemperature protection;
  • ESD Protection diodes on the USB lines;

Todo

Why?

I needed something to remotely disconnect and reconnect an USB device from my workstation, aka managed USB hub, the commercially available options where either expensive or needed drivers. So the idea here is an device that does not need external power and works as a USB CDC-ACM and one can simply send hub_ports_off over the terminal to turns the USB ports off.

How?

As per USB-C standard, if you are bored read section 4.6.2.1, an USB-C source device should at least source 1.5A, as it is written:

All exposed USB Type-C Current ports shall have the ability to offer the same power capabilities.

  • All ports shall initially offer 1.5 A.

With that being said we can use the HUB with USB2.0 devices (500mA) with no problems. The device monitor the CC pins and it can detect if the source is able to provide the minimum required current (1.5A):

Table 4-36 indicates that a minimum of 0.7V should be read on CC for a 1.5A capable source, so we should be good with a USB-C to USB-C cable.

If you have an old laptop like me and it does not have an USB-C port, one can override the source check and send hub_setings override_cc 1 and the HUB ports will be enabled even if the source does not provide enough power. On that case you may experience some weirdness on the final USB device, but hey, if you are here, you should have some idea of what you are doing.

One can also issue hub_status and see what the status is, for example:

dirty_usb_disconnect> hub_status
FW version: v0.0.1a
Hub is: Enabled
Fault: None
USB Host does not provide 1.5A

The CDC-ACM USB driver is based on espressif example, you will find how it works there... the PID is 0x303A and VID is 0x0009. In case you are building the debug version the output will be over the USB-JTAG controller, PID:VID 0x303A:0x1001 (here you can also debug over USB, cool ๐Ÿ˜„)

Firmware

Available commands

  • Type help on the terminal

LED

  • Blue - idle, ports off;
  • Green - ports on;
  • Red - fault;

Hardware

  • 1.5A fuse;
  • TPS2065C: 1A load, 86mฮฉ USB power switch with overcurrent, undervoltage and overtemperature protection;
  • Device itself draws ~40mA;

  • On the boards I made I changed all the resistors to 5.1KOhms for simplicity, the schematic did not update;
  • Jumper 1 allows to use the HUB without crystal, saving 0.05USD ๐Ÿ˜„;
  • Jumper 2 and 3 changes the ADC to channel 2 as the channel 1 has a boot glitch (it should be ok). Bear in mind that ADC2 does not work with WiFi (rtfm);

Note

Outro

dude-dirty-usb-disconnect's People

Contributors

ldab avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.