This application demonstrates how to use the Communication Device Class (CDC) to create a virtual COM port on a host computer. Such a device can be used as a bridge between legacy applications still using RS-232 ports, and computer without serial ports.
This package can be used with the following Atmel evaluation boards:
When the evaluation board is plugged to the host with a USB cable, it enumerates using the CDC class. The operating system may ask for a driver to install the device.
After the device is installed, a new serial port should become available. The data sent through this port is echoed on the USART of the device; Conversely, data received on the USART is forward to the USB host.
Here is a snapshot of the traces output by the application over the DBGU when it is working properly:
-- CDC serial driver example --
CDCDSerialDriver_Initialize
USBD_Init
Conn Conn Hlr Res
Hlr Res
Hlr EoBRes CfgEpt0
Hlr Susp
Hlr Res
Hlr EoBRes CfgEpt0
Hlr Ept0 Stp NewReq Std gDesc Dev Write0(18)
...
Hlr EoBRes CfgEpt0
Hlr Ept0 Stp NewReq Std sAddr Write0(0)
Hlr Ept0 Wr 0 EoT SetAddr(1)
Hlr Ept0 Stp NewReq Std gDesc Dev Write0(18)
...
Hlr Ept0 Stp NewReq Std gDesc Cfg Write0(9)
...
Hlr Ept0 Stp NewReq Std gDesc Cfg Write0(67)
...
Hlr Ept0 Stp NewReq Std gDesc Qua Stall0
Hlr Ept0 Sta
Hlr Ept0 Stp NewReq Std gDesc Str0 Write0(4)
...
Hlr Ept0 Stp NewReq Std gDesc Str1 Write0(28)
...
Hlr Ept0 Wr 4 EoT
...
Hlr Ept0 Stp NewReq Std gDesc Str0 Write0(4)
...
Hlr Ept0 Stp NewReq Std gDesc Str1 Write0(28)
...
Hlr Ept0 Stp NewReq Std gDesc Dev Write0(18)
...
Hlr Ept0 Stp NewReq Std gDesc Cfg Write0(67)
...
Hlr Ept0 Stp NewReq Std sCfg SetCfg(1) CfgEpt3 CfgEpt1 CfgEpt2 Write0(0)
Read1(4Hlr Ept0 Wr 0 EoT ConfigurationChanged
0) Hlr Ept0 Stp NewReq gLineCoding Write0(7)
...
Hlr Ept0 Stp NewReq sControlLineState(0, 0) Write0(0)
WARNING: on the SAM7X/XC evaluation kit, the project only works in internal flash.
-- USB Device CDC Serial Project 1.4 --