USB ids

Thread Starter

Michael Nusair

Joined Oct 21, 2015
16
Hi, i have a basic question. sorry for bad English.
I have a product, which has a usb connector, and it only uses power, and it doesn't really communicate with the computer.
my question is, how can i make this cable recognized by the computer? i have the D- D+ lines free, but what shoud the connect to? do i need a microcontroller to present itself with usb ids? i only need to see the name of the device on the computer and than i can make a software that will autorun when its connected but no really communication is necessary.
 

Thread Starter

Michael Nusair

Joined Oct 21, 2015
16
Thanks, but can you shortly answer this question?:
What is the cheapest and easiest way to make identify a simple cable as a device?
i can only think about putting a microcontroller, program my app to recognize specific vendor and product id, and the microcontroller wont actually be used except presenting itself.
 

GS3

Joined Sep 21, 2007
408
In general, if it only draws power then the computer will give a limited amount without asking. You only need two wires. I have many devices like that. Like a rechargeable shaver which recharges with USB. The cable that came with it only has two wires and cannot be used by devices which use data.

If the device needs more power then it needs to negotiate that with the computer using data wires.
 

DerStrom8

Joined Feb 20, 2011
2,390
Thanks, but can you shortly answer this question?:
What is the cheapest and easiest way to make identify a simple cable as a device?
i can only think about putting a microcontroller, program my app to recognize specific vendor and product id, and the microcontroller wont actually be used except presenting itself.
You want a short and quick answer? Here you go:

Learn how USB works.
 

Papabravo

Joined Feb 24, 2006
21,225
If you can figure out a way to negotiate with the upstream device without a microcontroller, then you might actually have something worthwhile.
 

Thread Starter

Michael Nusair

Joined Oct 21, 2015
16
and if i don't, what is the simplest microcontroller that i can program his ids (at least some of them, of course not the vendor id) or even if i cant program, what is the simplest electronic component that will send ids?
 

GS3

Joined Sep 21, 2007
408
If all you want to do is charge you are better off just getting a USB charger for a couple bucks and save the computer USB port for better uses.
 

Thread Starter

Michael Nusair

Joined Oct 21, 2015
16
If all you want to do is charge you are better off just getting a USB charger for a couple bucks and save the computer USB port for better uses.
Lets say i have a simple LED lamp that needs 5v, and i don't care how much power (current)
i just want my screen brightness to change automatically when its connected, i don't need data from the lamp, i only need to know when its connected.
 

GS3

Joined Sep 21, 2007
408
Oh, I see. Well why don't you use any device which already has or you add the LED. Any old webcam or other discarded device. The computer recognizes it. Now you have to write the driver so that it does what you want.
 

Papabravo

Joined Feb 24, 2006
21,225
USB allows for one-way data transfer after a connection has been established. Establishing a connection is a two way thing. The short sad truth is that there is no simple way to do this. This was not one of the design requirements as articulated by the original consortium of companies that put the first specification together in the early 1990's. If you want minimal and no requirements you're just going to have to roll your own.
 

Thread Starter

Michael Nusair

Joined Oct 21, 2015
16
Because, this isn't my real problem, i gave an equal problem just that you will understand, in my problem i need to do the correct solution.
can you shortly explain how can it be done?
Tank you very much anyway
 

Thread Starter

Michael Nusair

Joined Oct 21, 2015
16
and how will i identify my device? how can a pullup resistor present ids?
if there isn't a way without a microcontroller its ok, but what is the simplest way with a microcontroller?
 

GS3

Joined Sep 21, 2007
408
and how will i identify my device? how can a pullup resistor present ids?
if there isn't a way without a microcontroller its ok, but what is the simplest way with a microcontroller?
So you have a device the computer can identify. Now what? Are you going to write the necessary driver and program yourself? Because that's the most important part.
 

GS3

Joined Sep 21, 2007
408
If you are capable of writing a driver for a USB device I would think the part you are asking would be very easy for you. You should be familiar with the whole USB protocol and specs.
 

Thread Starter

Michael Nusair

Joined Oct 21, 2015
16
If you are capable of writing a driver for a USB device I would think the part you are asking would be very easy for you. You should be familiar with the whole USB protocol and specs.
i know it sounds weird, that because i did not explain my project exactly, thanks for the help
 
Top