Emulating RS-232 over USBB&W - Microchip Technology · The emulation of RS-232 over USB provides an easy migration path for ... Emulating RS-232 Over USB 20 HyperTerminal: Important
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
This presentation is only about 20 minutes long and not every thing can be explained here. The goal of this presentation is to describe what the RS-232 Emulation over USB is, what it is useful for, what Microchip is providing, and where to find more information.
l USB – Universal Serial Busl CDC – Communication Device Class
CDC stands for Communication Device Class. This is a device level protocol specification defined by the USB association body. It defines the rules of how a USB host and a USB peripheral should communicate as a communication device. Specifically, the CDC specification defines a wrapper protocol layer around other communication protocols allowing them to be transported over the USB interface. A standardized specification also allows a USB host and a USB peripheral to be developed independently.
As I will explained later on in this presentation, no work or modification is required on the PC side to implement the RS-232 emulation over USB. This is so because Windows 2000 and XP already come with a driver which provides the RS-232 emulation capability as defined in the Communication Device Class Specification.
Therefore the only things left to do is for the embedded device to have the hardware and firmware supports that conform to the CDC specification.
l USB – Universal Serial Busl CDC – Communication Device Class
l VID – Vendor ID
VID stands for Vendor ID.
Vendor ID is a 16-bit number assigned by the USB organization body. This number has to be purchased by each manufacturer in order tomarket and sell a product.
The emulation of RS-232 over USB provides an easy migration path for an embedded application. The serial communication has traditionally been the most common method of transferring data between a PC and an embedded device.
This slide shows that traditional method of transferring data over the RS-232 interface. The top half represents a personal computer and the bottom half represents an embedded application. The HyperTermina l is a Windows program that is used here as an example of an end application.
Many computers no longer have a serial port. This fact causes a headache for many embedded system designers and a new solution is needed.
This slide shows the migration path from RS-232 to USB.
The UART physical layer is replaced with the USB hardware layer.
Since CDC is a standard USB class, Microsoft has implemented a driver which supports the RS-232 interface emulation. On the PC side, the CDC driver provides the linking layer between the USB hardware and the UART driver. This allows the end application to remain unchanged because from its perspective, it still sees the RS-232 interface.
As for the embedded application side, the PIC18F4550 has a full-speed USB peripheral. In addition, Microchip also provides the CDC RS-232 Emulation Reference Project which provides necessary applicationprogramming interfaces.
l Assume that the CDC RS-232 Emulation Reference Project is programmed on the microcontroller
I would like to introduce you to the PICDEM FS USB Demo Board. This board can be purchased from buy.microchip.com or any Microchip’s distributors. It provides a hardware platform for demonstrating the USB capability of the PIC18F4550 family of devices.
Assuming that the board has the CDC RS-232 Emulation Reference Project loaded, I will next show you how the demo board would berecognized by Windows Operating System.
l Before physically disconnecting a USB device, you must hang up the connection first, otherwise, the program must be closed and opened again the next time a USB device is connected.
l Let’s take a look at the APIs
Let’s take a look at the APIs provided by the CDC reference project.