question

SharpWindows avatar image
0 Votes"
SharpWindows asked DanielZhang-MSFT edited

Questions about USB ports and interactions

Hello everybody, i've found a lot of question here in microsoft Q&A and external sites about "Sending data through usb port" or "USB Ports" etc etc.
I've read every forum but i am still confused: (some questions)
1. a usb port is a com port?
2. why do a lot of people call usb port if usb is too generic?
3. once i've sent a message, how will the device interact with me?
4. what do drivers do when i send the message?
5. if i interact with a keyboard, do i need the driver?
6. can someone explain what happens when you plug a usb device? (yes i have found many sites explaining but i am not sure: where is the driver? Without a driver what will happen?

Thanks to everyone who answer this questions

Bye



not-supported
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

a usb port is a com port?

No. The attached USB device might emulate a COM port though.

why do a lot of people call usb port if usb is too generic?

This question is not clear.

once i've sent a message, how will the device interact with me?

Depends on the USB device. Read the manufacturer specifications.

what do drivers do when i send the message?

Drivers are software that communicate with hardware. Read the manufacturer specifications.

if i interact with a keyboard, do i need the driver?

Yes

can someone explain what happens when you plug a usb device? (yes i have found many sites explaining but i am not sure: where is the driver? Without a driver what will happen?

USB is hot swappable which is a handshake between the device and OS. The OS will load an appropriate driver for the device. A USB device will not work without a driver.
















1 Vote 1 ·

Hi VBnetcoder-0336,
This Visual C# forum mainly discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.
For questions about USB ports and interactions, I suggest you modify tag for more professional answer.
The supported products are listed over here (more to be added later on).
Thank you for your understanding.
Best Regards,
Daniel Zhang


1 Vote 1 ·

Thanks guys. I still have some questions:
1. "The attached USB device might emulate a COM port though" What does this exactly mean
2. When a usb device is plugged in, the os will "analyze" the device but without the specific driver, this means there is a standard usb driver that "communicates" with the os and reveal the kind of device, after this the right driver will be installed. is this right?
4. if i send a message to the device will it be received by the driver or by the device itself?
5. if i send a message to a usb flash drive the flash drive will not answer, right?
6. "The term "usb port" doesn't mean anything. The B in USB means "bus", it is a generic way for any kind of device to talk to the machine. A driver is required to make the device usable." taken from stackoverflow can someone explain this to me. This sentence is confusing me.
7. a device that requires com wont need a driver?




0 Votes 0 ·
AgaveJoe avatar image
1 Vote"
AgaveJoe answered

"The attached USB device might emulate a COM port though" What does this exactly mean

The device behaves like it is attached to a COM (serial) port. A better way to say this is, the USB driver emulates a UART which is/was a physical chip set on a serial board. There is no lack of information on serial ports and UARTs. This information is also found in engineering and computer science courses.

When a usb device is plugged in, the os will "analyze" the device but without the specific driver, this means there is a standard usb driver that "communicates" with the os and reveal the kind of device, after this the right driver will be installed. is this right?

USB is hardware. The communication between USB devices and the system hardware is an openly published specification. What the USB device looks like to software depends on the device driver. It could look like a COM port, disk drive, etc.

if i send a message to the device will it be received by the driver or by the device itself?

A device driver translates communication between software, that thinks the device is a COM port for example, and USB hardware.

if i send a message to a usb flash drive the flash drive will not answer, right?

A USB flash drive emulates the file system. What message are you sending to the drive and what do you expect to happen? If you issue a dir F: (Windows) where F is the USB flash drive then you'll should expect a directory listing.

"The term "usb port" doesn't mean anything. The B in USB means "bus", it is a generic way for any kind of device to talk to the machine. A driver is required to make the device usable." taken from stackoverflow can someone explain this to me. This sentence is confusing me.

Are you asking what a bus is??? A bus can be physicals wires within a cable, copper lines etched into a circuit board, or even virtual. A USB cable has 4 wires; Vcc (5V), ground, data+, and data-. The data lines are 180 degrees out of phase which is a common method to reduce noise, increase throughput and data rates over a wire. The 5V powers devices on the line.

a device that requires com wont need a driver?

The original COM port was a physical 9-pin serial port used for COMmunication between systems and/or external devices. Any device that emulates a COM port (UART) attached to a USB line requires a driver.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
1 Vote"
Castorix31 answered

About everything is in MSDN at Universal Serial Bus (USB)


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.