USB considered as COM port - serial-port

Why most of devices connected to a PC via USB are considered as connected to COM port? As I've read, COM port is referred to RS232 serial port with DB9 connector, that is nowadays mounted rarely in devices.
There comes also another question - why most of devices connected to USB are using USB to UART converters? Is it because of high complexity level of USB standard?

Related

USB to USB serial communication from PC to PC

I am currently connecting 2 PCs using serial communication and at this time I am using a USB to Serial converter, then a serial cable, then another USB to Serial converter going into the other PC in order to get the communication sent and received.
Is there a way to program the USB ports as COM ports without these converters and still be able to transfer the serial data over the USB using software rather than hardware, thus eliminating the need for the conversions and rather have just a straight USB cable to USB cable connection?
Thanks!

Connecting 2 USB ports together over a "Null Modem" like in the old days with COM ports?

I was curious if anybody knows a way to connect two different computers together over a USB line and what API's exist to program this interface.
For Serial Ports its common to buy a "Null Modem" adapter to cross over the Transmit and Receive lines of the UART so that the computers can talk together. And then You would read and write them like normal windows files over special system files called "COM1", "COM2", etc.
I was wondering if there was an Adapter of some kind that could emulate this same behavior except for native USB protocol. I realize they have USB-to-UART adapters. That's not really what i'm interested in because the baud rate is very slow for uarts. I was looking for something with USB speeds to transfer from one computer to another that is not going over a network link such as ethernet or wifi.
This is what I have:
COMPUTER A<-->USB<-->UART<-->NULL_MODEM<-->UART<--->USB<-->COMPUTER B
Speed 110,000 Baud, whatever... to slow to transfer files... ok for text...
This is what I want:
COMPUTER A<-->USB<-->Crossover_Adapter<--->USB<-->COMPUTER B
Speed 480 megabits per second
Assuming this beast exists, how do you program it and where do you buy it?
The only solution that I know of is the "FTDI Chip USB-to-USB Null modem cable" that can transfer between computers two computers using USB ports at a rate of 3 MBaud (384 kbytes/s) That's a lot faster than using older serial ports with null modem cable that maxs out at say 115200 baud (14 kbytes/s). The FTDI chip cable can be programed in c/c++/c# just like a standard windows serial port by way of a virtual serial port.
http://shop.clickandbuild.com/cnb/shop/ftdichip?op=catalogue-products-null&prodCategoryID=92&title=Null+Modem+Cables
From Their Website:
USB NMC-2.5m
NMC In the era of legacy PCs with onboard RS232 COM Ports, it was
common practice to establish a simple communications network between
PCs using a cable popularly known as a Null-Modem cable. Typically,
such a cable would have DB9 female connectors on each end with the TX
/ RX and handshaking signals cross-connected so that the PCs could
communicate with each other via legacy COM ports.
On modern PCs the legacy COM Port connector is rapidly disappearing as
USB becomes the multi-function communication port of choice. However,
this presents a dilemma in application areas that previously relied on
legacy COM Ports for inter-PC communication.
A convenient solution to the problem is the FTDI USB NMC cable. From
the outside, this cable appears to be two USB type “A” sockets wired
together, however each of the USB sockets conceal a small PCB with a
FT232RQ based USB-UART converter IC plus support components inside.
The interconnect cable cross-connects the TXD / RXD data signals, RTS
/ CTS handshaking signals and interconnects the common GND reference
rail betwen the two converter PCBs.
When used together with FTDI’s supplied Virtual COM Port ( VCP )
drivers, the USB NMC cable may be used to establish inter-PC COM Port
based communication at baud rates of up to 3M baud. The standard USB
NMC cable p/n USB NMC-2.5m comes with an interconnect length of 2.5m (
8.2ft ) - other lengths may be available on request. Multiple operating systems are supported including Windows, Linux, Mac OS etc.
single cable
Another Alternative is to use Bluetooth which is also programmable just like a the older serial port.
I think I found the solution: Avnet Spartan-6 LX9 MicroBoard.
It has a USB on one end and an ethernet port on the other end.
http://www.xilinx.com/products/boards-and-kits/1-3i2dfk.html
I can put the fpga/microblaze-cpu in the middle to filter out traffic to make sure the link doesn't get hacked and maybe encrypted it as well.
Easy Computer Sync sells the null modem cable plus the data transfer software. The SW is versatile and easy to use. https://www.bravurasoftware.com/easy-computer-sync/ (I have no connection with other than being a satisfied user.)

Underlying hardware beneath virtual Com port

I have a device connected to USB port via USB cable to my PC and in device Manager it says - > "XYZ corp Virtual COM port (COM A)"
Is this is same as Serial Com Port.?What is the underlying hardware under it both at device side and Host Side - a Uart or a USB or both at either end respectively?
It sounds like your USB device uses a driver that provides a serial port interface inside your computer. This means that other software can use the serial port APIs that Windows provides to connect to it and use it as a serial port. That software doesn't need to know the details of your USB device; it just needs to know about using serial ports in Windows. Windows ships with a driver that is often used to do this, and that driver is named usbser.sys. Your device might be using usbser.sys or it might be using some other driver.
The serial data is transferred via your computer's USB port and a USB cable. If you look at the signals on the USB cable, you will not see typical serial signals: you will see regular USB packets that just happen to be carrying that data needed for a serial port.
The USB device on the end of that cable might then translate that data into serial signals and act like a normal serial port, or that data might just be used directly inside the device. Without a link to the product in question, it is hard to tell you more than that.

Developing my own modem

I would like to develop my own modem for a custom communication network that will be detectable on the serial port by PC automatically. What I'm uncertain about is the protocol part of the AT commands and how to make it work seamlessly so that computer will detect the modem automatically.
I plan to use ftdi UART to USB converter to interface my microcontroller with the PC using standard serial interface. The PC will then use AT commands to communicate with the microcontroller that will in turn connect to another microcontroller over radio tranceiver and establish a two way serial connection over radio. The idea is that the PC on the other end will run PPPD and listen on it's own modem connection for incoming call and then bridge the connection with it's other internet interface that is connected to internet. The first computer will get it's own IP address using PPPD and will be connected to internet over this custom microcontroller based modem.
But how do I implement the communication protocol between my controller and PC? What commands do I absolutely need to implement? How do I make sure that the computer recognises my controller which is connected over ftdi usb to serial adapter as a functional modem?
Where can I find a speciffication of the minimum command set that is required of a modem?
In practice linux usually discovers a 3G modem automatically for example. Does that have to do with the actual USB identifier of the modem? Is it possible to have linux automatically discover an ordinary serial port modem? I'm thinking that the modem will be sending an AT idle ping repeatedly when it's plugged in so that linux should be able to detect it.

What kind of port is the USB port?

I am developing a serial port communication java-J2ME-J2SE application. There is a mobile phone and a computer ( running Windows XP ). These two machines are communicating through the phone mobile's cable. And the phone mobile's cable is a USB cable. So what is the type of the port : is it COM1 or something else ?
I looked the device manager and I found that the mobile phone ( Alcatel OT-806D ) is in port COM4. Here is a captured image of the device manager:
An USB port is a kind of serial port that computers and devices can use to communicate. It defines the connectors and cables, as well as the physical and link layer protocols that devices must use to communicate over USB. In this sense, it's similar to Ethernet, Firewire or other communication protocols.
At a physical level, USB is a serial protocol, meaning that bits are sent in a serial fashion. Old serial RS-232 ports (traditionally named COMx under Windows) are not related to modern USB architecture. Old serial ports used a simpler and slower communication protocol (RS-232) that was usually handled by a family of chips called UARTs, whereas USB communication requires more complex hardware.
So, the physical and link-layer characteristics of these two protocols are very different. While both are serial protocols, USB allows for several devices to share the same bus (traditional serial ports don't) and communication speed is much higher in USB. Error detection and correction, flow control and other data transfer concerns are better handled in USB.
COM ports are a Windows abstraction to represent any communication port. In other operating systems other names are used. In Linux, the COM1 port is represented by the device /dev/ttyS0.
Note that this is no more than an abstraction. It is possible (and often done) to use serial ports that are not using the traditional, physical, serial port. In fact, you can create operating system drivers that provide serial ports that are in fact communicating over Ethernet, USB, IP or any other communication layer. The COM port at operating system level is no more than an abstraction to represent a communications port.
Mobile phones offer a variety of services through their USB port. This often includes raw serial communication (which you can use in your application), but in many other cases the USB port provides other "profiles" (usb mass storage, headphones, or whatever). All those profiles are standarized so you can plug your phone to a computer and establish a "serial communication" channel, among other things, without having to code communication drivers for the computer or the phone.
So, to answer your question, no, an USB port is not a COM port. It is an USB port. You can use it for serial communications, but you can also use it for other things.
USB means Universal Serial Bus. Generally all os the USB connections on PC will be linked on the same bus. All devices connected to the bus are assigned virtual port numbers. These port numbers will change depending on what is connected to the bus.
However, you won't be communicating with the phone directly but with any driver that is installed for it, unless you're writing the driver itself.
Some phones are not controllable in any way, others may appear as a modem, because that is the functionality that their manufacturer has assigned them through the drive.
My current phone installs as a device in itself (for use with a manufacturers piece of software), a modem and a storage device.
Have a look here for some more information.
um, depends what you mean by "type of port". I think you want to know the name of the port, but what you really need to know is what protocol your phone will understand.
You need to know what protocol (if any) the phone can communicate with over USB. Just because you can connect the phone to a USB cable doesn't mean that you can control the phone. This depends on the phone. Not all phones are built to understand the same protocols.
Also, USB is a serial bus because it transmits data serially on a single line (as opposed to transmitting in parallel over multiple lines), but it doesn't (necessarily) use the same RS-232 protocol as a computer's serial port. If you had a RS-232 device connected to a USB port, then you would connect to it using COM1 (or COM2 or COM3, your operating system assigns this port name).

Resources