USB - lower level and programming

From Helpful
Jump to navigation Jump to search

⚠ This is for beginners and very much by a beginner / hobbyist

It's intended to get an intuitive overview for hobbyist needs. It may get you started, but to be able to do anything remotely clever, follow a proper course or read a good book.


Some basics and reference: Volts, amps, energy, power · batteries · resistors · transistors · fuses · diodes · capacitors · inductors and transformers · ground

Slightly less basic: amplifier notes · varistors · changing voltage · baluns · frequency generation · Transmission lines · skin effect


And some more applied stuff:

IO: Input and output pins · wired local IO · wired local-ish IO · ·  Various wireless · 802.11 (WiFi) · cell phone

Sensors: General sensor notes, voltage and current sensing · Knobs and dials · Pressure sensing · Temperature sensing · humidity sensing · Light sensing · Movement sensing · Capacitive sensing · Touch screen notes

Actuators: General actuator notes, circuit protection · Motors and servos · Solenoids

Noise stuff: Stray signals and noise · sound-related noise names · electronic non-coupled noise names · electronic coupled noise · ground loop · strategies to avoid coupled noise · Sampling, reproduction, and transmission distortions

Audio and video notes: See avnotes

USB: everyday · power · connectors · lower level · misc

Platform specific: : Microcontroller and computer platforms ·· Arduino and AVR notes · ESP series notes · STM32 series notes · Teensy series notes


Less sorted: Ground · device voltage and impedance (+ audio-specific) · electricity and humans · Soldering · landline phones · pulse modulation · PLL · Multimeter notes · signal reflection · Project boxes · resource metering · Radio and SDR · vacuum tubes · Unsorted stuff · 'E-fuse'

Some stuff I've messed with: Avrusb500v2 · GPS · Hilo GPRS · JY-MCU · DMX · Thermal printer ·

See also Category:Electronics.

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

Bandwidth and latency

tl;dr

"Do hubs, shared cables, etc. affect speed?"

On poll rate

Can we push USB latency lower?

More on scheduling

Related to coding

A primer, some terminology

On classes, and default class drivers

on libusb and platforms

HID

Keyboard limitations

Can I write and use my own USB drivers for a device?

Can I give my DIY device a custom name?

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

tl;dr:

not really, at least not easily
To get it to look distinct, you would really need a distinct VID-and-PID, and registration of such.


This would mostly just matter to what is shown in device manager.

This might be nice for the convenience of admins.

Or, in theory, to avoid getting confused which of the many attached Arduinos you need to upload to, except that the name for a device is essentially settled by its VID and PID, so that won't work.


What you probably don't want

In Windows there is a registry trick to effectively override the name reported by a driver - but that would be for all devices that that driver applies to, so won't help you distinguish one arduino from another, nor will it make your "make my project look distinct".

(you don't need to alter the driver itself, just the INF around it[1] which is within reach. Also, it will not do that on anyone else's PC.)


If you are a company

Even if

  • you can get a lot of USB-capable microcontrollers to communicate arbitrary VID and PID,
  • you can register it somewhere (without paying a lot of money)

...then it is now a new, unknown device, and now you would have to supply your own drivers.

If you want automatic installation in Windows, you then also have to deal with Microsoft driver certification[2].

This is probably only interesting for people who own a company and want to sell the result.


There's an inbetween if you can get people to accept your own custom drivers, but it is fidgety.

I have seen installers do this to their devices.