Connect Usb Device To Serial Computer Port

  

USB Virtual COM Port The developers resource for computer interfacing, especially USB, serial COM ports, mass storage, and embedded networking. Formerly Lvr. comHome Articles. Create a USB Virtual COM Port. This article originally appeared in Circuit Celler. COM ports have long provided a convenient way for PCs and embedded systems to exchange information. The traditional COM port on a PC is an RS 2. Recent PCs often skip RS 2. USB. But with the right firmware, a USB device can appear as a virtual COM port that applications can access using. NETs Serial. Port class or other COM port APIs or libraries. Guide/Win7DueInstall_4.png' alt='Connect Usb Device To Serial Computer Port' title='Connect Usb Device To Serial Computer Port' />This article will show how to design and program a USB virtual COM port device using a general purpose microcontroller with an embedded or external USB controller. The device uses standard USB class drivers included with Windows and other OSes. Options for Devices. The COM port software interface provides a way for PCs to exchange data with devices for any purpose. A classic example is a modem that enables a PC to send and receive data over phone lines and responds to AT Hayes modem commands from the PC. Other COM port devices support vendor specific command sets for data acquisition, motor control, or other uses. Connect Usb Device To Serial Computer Port' title='Connect Usb Device To Serial Computer Port' />To communicate with a COM port, an application first reserves the resource by opening the port. For many devices, an application can also get and set port parameters such as bit rate, number of data bits per word, and flow control method. The application reads and writes to the port as needed and when finished communicating, closes the port to allow other applications access to it. A USB virtual COM port is a software interface that enables applications to access a USB device as if it were a built in serial port. Many USB virtual COM port devices function as bridges that convert between USB and RS 2. But a virtual COM port doesnt have to have a serial interface at all. Some virtual COM port devices convert between USB and a parallel interface. ICUSB232D.Main.jpg' alt='Connect Usb Device To Serial Computer Port' title='Connect Usb Device To Serial Computer Port' />Connect Usb Device To Serial Computer PortOr a device might just read and store sensor data from an on chip analog port and send the data to a PC via USB. One way to create a virtual COM port device is to use a dedicated chip such as FTDIs FT2. Mozilla Firefox Ro 2013 Cnet. R USB UART. The chip handles all USB specific communications in hardware and has an asynchronous serial port that can interface to a port on a microcontroller. FTDI provides drivers for Windows and other OSes. A similar chip is FTDIs FT2. R USB FIFO, which has a parallel interface instead of the serial port. These chips are a quick way to add a USB port to a design. Just about any computer that you buy today comes with one or more Universal Serial Bus connectors. These USB connectors let you attach mice, printers and other. Amazon. com TRENDnet USB to Serial Converter, Connect a RS232 Serial Device to a USB Port, Easy Installation, Universal Plug Play, TUS9 Electronics. USB 2. 0 to IDE or Serial ATA Drive Adapter Cable Externally connect one 2. IDEATAPI or SATA drive to your computer via USB 2. A USB port is a standard cable connection interface for personal computers and consumer electronics devices. USB stands for Universal Serial Bus, an industry standard. USBDeview is a software that lists all USB devices that connected to your computer, and allows you disable, enable or uninstall them. Turn on computer and make sure USB port is available. Plug in USB connector to USB port. The Add New Hardware WIzard should appear if not, then you can. USB-device.png?x14005' alt='Connect Usb Device To Serial Computer Port' title='Connect Usb Device To Serial Computer Port' />Many existing devices with asynchronous serial ports can use a USB UART to convert to USB with no firmware changes. Other companies with UART bridge chips include Mos. Chip Semiconductor Technology Ltd., Prolific Technology, and Silicon Laboratories. The device Ill describe takes a different approach. The design  doesnt require a specific vendors USB controller or driver. The device can use a general purpose microcontroller with an embedded USB controller or a CPU that interfaces to an external USB controller. The USB port can be full or high speed. Device firmware manages USB communications and whatever other tasks the device is responsible for. Instead of a vendor specific driver, the PC uses the USB communication devices class CDC driver included with Windows and other OSes. For Windows, an INF file matches the driver to the device. Several microcontroller vendors provide example firmware for USB virtual COM ports. The chips include Atmel Corporations AT8. C5. 13. 1, Microchip Technologys PIC1. F4. 55. 0, and NXP Semiconductors LPX2. These examples are good starting points for projects. If you dont have CDC example code for your CPU, you can base your firmware on other example code that transfers data using bulk or interrupt transfers. Any complete example firmware includes code for returning descriptors and responding to other control transfers and events on the bus. At the device, bulk and interrupt transfers are identical. The only difference is in how the host schedules the transfers. Partner Links. Duties of Firmware. For a quick review of USB basics, see the sidebar, 1 minute USB Crash Course. USB CDC firmware for a generic COM port device performs several tasks. During enumeration, the firmware responds to requests for descriptors that identify the devices CDC function. The device receives COM port data following OUT token packets addressed to the bulk OUT endpoint and sends COM port data or NAK in response to IN token packets addressed to the bulk IN endpoint. To send status information, the device returns notification data in response to IN token packets on the interrupt IN endpoint. A device with no information to send returns NAK. Ogre 3D Game Tutorials more. Most devices also respond to class specific control requests that set and get serial port parameters. Figure 1. A microcontroller with a UART and an embedded USB device controller can function as a USBRS 2. The RS 2. 32 port in this example includes two data lines and two lines for flow control. Figure 1 shows a CDC device that functions as a USB to RS 2. The microcontrollers asynchronous serial port interfaces to a Maxim MAX2. RS 2. 32 converter. Microcontrollers generally dont have dedicated port bits for RS 2. Typical RS 2. 32 signals used for flow control are RTS and CTS. The bridge performs the function of an RS 2. PC. The TX and RTS signals are outputs, and RX and CTS are inputs. In RS 2. 32 lingo, the port is configured as a DTE. The RS 2. 32 interface can connect to a serial port on a microcontroller, another component with a serial interface, or a via a null modem cable. For cables of up to 4. RS 4. 22 interface chip such as a Maxim MAX3. For a serial network, use an RS 4. MAX2. 32. If unneeded for modem control, the RS 2. DTR, DSR, RI, and CD can serve as general purpose IO bits or remain unused. Customizing the Descriptors. The USB 2. 0 specification defines the content and format of standard USB descriptors. The CDC specification defines additional class specific descriptors. Figure 2. A USB virtual COM port device can use the USB CDC class drivers provided by Windows and other OSes. A device that exchanges vendor defined data can use these descriptors. Figure 2 shows the descriptors in a typical CDC device that functions as a generic virtual COM port. Ill focus on device specific items you may need to change from values in example firmware. Every USB device has a device descriptor Listing 1. Device descriptorrom USBDEVDSC devicedsc    0x. Descriptor size in bytes. DEVICE descriptor type. USB version, BCD 2. Class CDC0x. 00,            Subclass none. Protocol none. 0x. Max. packet size, Endpoint 0. USB Vendor ID0x. 90. USB Product ID0x. Device release, BCD 1. Manufacturer string index. Product string index. Serial number string index. Number of configurations Listing 1. The device descriptor names the communication devices class CDC. The class code specifies CDC as the devices class. The Vendor ID and Product ID values identify the specific device. Every device with the same Vendor IDProduct ID pair should use the same driver on the host. The serial number string index identifies a descriptor that contains a serial number. A serial number prevents unwanted COM port proliferation. A device with a serial number retains its COM port number if moved to a different USB port on a Windows PC.