Introduction

Authors: Henrik Moe Arnesen and Phillip Olk, Microchip Technology Inc.

The Communication Device Class (CDC) is a general-purpose way to enable all types of communication over the Universal Serial Bus (USB). This class makes it possible to connect telecommunication devices, such as digital telephones or analog modems, and networking devices, such as ADSL or cable modems.

While a CDC device enables the implementation of quite complex devices, it can also be used as an easy method for communication over the USB. An example of this is a CDC device that can appear as a virtual COM port, which simplifies the application programming on the host side.

This document will explain the USB CDC basics. It will describe the advantages of using the AVR® DU with the USB Device Stack offered in MPLAB® Code Configurator and how it can replace external translators to enable USB communication.

The document will describe two examples that show how to utilize USB CDC communication. The first will be a simple application that shows the basics of CDC and how it interacts with the host. The other example will show a USB to USART bridge application that can be the basis of any application needing to translate external serial communication to USB. Both examples have manual terminal interactions and an automated Python script showing how to integrate it into a host-side application. Links to the example code and step-by-step instructions for setting it up are provided in the Simple CDC Communication & CDC to USART Bridge sections.