The Stack Overflow podcast is back! Listen to an interview with our new CEO.
24

Full-Size USB B Full-Size USB B Full-Size USB B Full-Size USB B Full-Size USB B Full-Size USB B Full-Size USB B Full-Size USB B Full-Size USB B The full-sized USB B connector is far more reliable then mini or micro B connectors. It's also much more mechanically robust. Really, the only valid reasons for using the Mini or Micro connectors are space-...


24

What exactly are the differences between a USB host and device? The host initiates all communication on the bus, the device only responds when asked by the host. For Details see the specs on usb.org. When two devices connect [...] One must behave as the host and the other as the device. Details can be found in the USB OTG Specs. Can one device acts ...


23

As pointed out, you can't directly connect two hosts to a device - so if you just wired them together and somebody plugged it in on both ends, you'd have a problem. However you also have a problem if only one end is plugged in. USB, especially high-speed (480Mbps) mode is controlled impedance. If you wire both connectors data lines together you end up with ...


21

USB has several layers, which are described in the USB 2.0 Specification. If you're familiar with the OSI layered network model, you can think of it like this: Session layer = Chapter 10 USB Host Hardware and Software (device drivers) Transport layer = Chapter 9 USB Device Framework Network layer = Chapter 8 Protocol Layer (bitstream) Data Link layer = ...


18

With a self powered device don't connect it's 5V to the host's 5V, you may blow the either power supply. GND and D+, D- will do fine. Mind you that levels for D+ and D- are rated for +3.6V max, not to 5V as you might expect!


17

Mini-USB is a disaster waiting to happen (in my opinion and experience). Insertion-removal lifetime is low - one of the major factors addressed with micro-USB was an increase in cycle life. If I was doing what you describe I would choose USB-B (ie full size) as the working choice for development and only change it if there were major reasons to. I had just ...


14

How about using an alternative circuit like this: Q4 is a P-mosfet, kept off when there is a voltage in the main supply (USB in this case). When the main supply is disconnected the gate is pulled down and the mosfet conducts and provides output from the battery source. The diodes are Schottky type for low Vf and the mosfet should apparently be ...


12

This depends on what endpoint types your device is using. A quick summary taken from USB in a nutshell: Interrupt Transfers Guaranteed Latency Stream Pipe - Unidirectional Error detection and next period retry. Isochronous Transfers Isochronous Transfers provide Guaranteed access to USB bandwidth. Bounded latency. ...


12

If you have a USB transceiver already on the breadboard and you just need to connect USB somehow, they make little breadboard adaptors like the one pictured below: You can find these things buy Googling "USB breadboard adapter." An example is here. If on the other hand you do not have a USB transceiver and would like to communicate with your circuit by a ...


12

I am not sure what exactly you want to make, but if it is a host device you indeed don't need an USB VID/PID. The USB VID/PID of a slave device is used by the host to identify the driver(s) to be used for the slave device. A host device does not need to identify itself to the slave, hence it does not need a VID/PID.


11

You seem to want to interface to an USB port, so you will need some form of USB interface. The easiest route is an off-the-shelve usb-serial converter, then a max232 or the like, then the UART of your microcontroller. You apparently want to step beyond this. A next step is to use an usb-serial converter chip, without the extra stage of going to RS232 levels ...


11

This does not work. You will need a USB hub. The USB Y cables you have seen use two USB Type A male plugs to one USB B type plug. Only the power lines are split to the extra plug. This is not conform the USB specification. But it is a small hack to have more than the standard 2.5 Watts of power available, it is used for 2.5" hard disks that can't spin-up ...


11

Is there some method that could monitor a device for very long periods of time with millions of packets going by and find the source of the error? Yes. The device is called "USB protocol analyzer". If you monitor only the host software side, the maximum you can see is that there was some "transaction error", and the port can or can't recover after ...


10

The USB can either be in device mode or in OTG mode. You cannot have OTG on the same USB bus as a host like a computer. Multiple OTG devices can switch between host & device mode using "HNP" (Host negotiation protocol) but you can't do that with a pure host. You would need two separate USB busses - one between the PC and the PIC, and one between the ...


10

except if the data length is an even multiple of 256 bytes Its 64 bytes actually (MaxPacketSize). USB bulk transfers "end" with transfers that are not MaxPacketSize - normally 64 bytes long. If your transfer is an integer multiple of that, you send a zero packet after the data. This signals the transfer end to upper USB software stacks, which will return ...


10

It's worth having a USB cable with ferrite 'stoppers' on it, to attenuate conducted emissions along the cable. This will reduce the chance of hash from the switch mode power supply and other PC generated interference 'getting into' the audio circuits of the ADC that's doing the recording. With an electrically noisy PC, and a cheap ADC, a cable without ...


10

The real problem is not the unprotected USB port, the real problem is that your device puts you and your devices at risk of being connected to higher-voltage, relatively high-current sources. You can solve transient overvoltage with clamping diodes, but these won't help if you power supply is strong enough – they will just fail, and then you're in the same ...


9

Some cheap usb hubs, are really really cheap, and do not follow appropriate standards. Some are so cheap, that they have all of four components. An all in one usb hub IC, a crystal clock, a decoupling capacitor, and an led. Input VCC is tied together to all the output VCC. These are not the best devices in the world. That said, because VCC is tied together, ...


9

Multiplexer as suggested by Tom Carpenter is a good solution. But for full speed USB (12 Mbps), the stubs in the signals are not particularly important. If the distance between the stub ends remain below 1/10th of wavelength, i.e. below ~2 meters, the reflections will not distort the waveform much. Also, the voltage levels on D+ and D- pins will remain ...


8

Maybe this is what you're looking for: I never tried so I can't tell you if it works, but the idea seems to mimic a satellite dish, using the aluminium foil as a parabolic reflector. Source


8

I believe the original 1 ms (1 kHz) start of frame interrupt was to give devices to cheap but accurate timing. The accuracy spec on that is rather tight. If you don't need to do accurate timing, or you have your own crystal, then you don't need to know when USB frames start. The host initiates all transactions, even when you send, so your hardware and ...


8

The metal shroud around USB connectors is called "shield". The shield serves two purposes, (1) To protect from over-the-air ESD events, and (2) to shield internal high-frequency noise from being emitted out and meet emission regulations for EMI levels. These two processes have different electrical characteristics, so the treatment of shield connection must ...


8

It will work, if that's what you're asking. And there is no law saying you must buy a VID from the USB-IF in order to use USB - you only get in trouble if you use the name and logo without permission. Some things to consider: If you do want to insert a computer, to do debugging or something, life will be easier if you have a unique VID/PID combo and can ...


8

With 22 pF to ground, the link won't work. Having 22 pF is a brutal violation of USB 2.0 signal requirements. When you loaded the data bus with such huge caps, the HS (480 mbps, 240 MHz) signals are severely degraded, below borderline of HS communication. Yet the initial speed negotiation (chirping sequence), which occurs on 10 kHz rate (50 us pulses), ...


8

First of all, the USB is not being fed directly to the phone’s battery. It’s actually being fed to the battery charger circuitry inside the phone. You cannot safely directly connect a normal regulated voltage source to a lithium ion battery without the distinct possibility of an explosion and/or fire! The charger circuitry adjusts the voltage and current fed ...


7

I expected this to be a problem of an OEM-only part with everything under NDA and binary drivers provided. You'd need to be planning a large-volume order (and have the company letterhead to prove it) to get anything that could help you write a driver for many components like this. So no, don't expect this to be as simple as Googling the part number and ...


7

I have worked on commercial KVM units and can attest to the fact that they are way more than a trivial exercise to design and get working. One of the challenges in such a design is capturing the analogue waveforms of the VGA/SVGA/XGA/WXGA video signals from an arbitrary computer and converting that into a digital format that can then be processed in the ...


7

USB 2.0 is quite inefficient, compared to USB 3.0. There are Link commands and other transactions, meant to keep the link healthy and operational, that do not carry data. There are ACK packets for nearly every received data packet, and because the bus is uni-directional, those disrupt the data transfer. There is error detection and correction information ...


6

What about a software solution? On Windows, you can intercept the mouse actions with an application, which can be as simple as this AutoHotKey script: #NoEnv SetBatchLines -1 Process Priority,,R BlockInput Mouse ; user mouse input is ignored during MouseMove CoordMode Mouse, Screen ; absolute coordinates SysGet m, Monitor ; get the screen ...


6

I'd like to point out one thing that was overlooked in other answers and that is the target audience. We already know that mini and micro B plugs are small and therefore in some situations they are also more difficult to connect. For example if the device is going to be put in a corner somewhere and not be moved much, full size B would be easier to connect ...


Only top voted, non community-wiki answers of a minimum length are eligible