Electronic – USB serial emulation: CDC or vendor-specific

microcontrollerserialusb device

When designing a device that requires communication with a PC via a virtual serial port over USB:

  • When would one use usb-serial port emulation chips with vendor-specific drivers (e.g. FTDI) and
  • when would one implement a Communication Device Class (CDC) device?

What are the advantages of each solution, what the limitations?

Best Answer

It will very much depend on the features your device offers.

The UART-over-USB is an attractive solution because you can use it on any microcontroller which can work with UART, even if it doesn't have the hardware and has to bit-bang it. The FTDI UART-to-USB bridges (there are others as well, like Silicon Labs, but FTDI is the most commonly used) hide all the USB details, so there are no requirement for the microcontroller concerning this. A microcontroller with 512 bytes of Flash and 2 I/Os can communicate with a PC this way.

CDC is different. It's a USB class, which means you need a USB stack, and the CDC driver. Especially the CDC driver may be a problem on low-end microcontrollers, while they may be available for an RTOS, but then you will probably be running on a more advanced platform. Since you will be running USB software you'll have to get a Vendor ID (VID) and Product ID (PID) if you want to identify it on a USB bus. A license costs money: 2000 dollar for the VID, without which you're not allowed to use the USB logo.

Using FTDI chips solves this problem: FTDI has a VID and PIDs, so that you don't have to worry about it. By default the PID won't be unique to your product (all FT232Rs will have the PID 0x6001, for instance), but the PID is stored in on-chip EEPROM and can be modified. FTDI can provide you with a block of unique PIDs. For your everyday project I would work with the FTDI chips, since they need no footprint on the microcontroller, and are proven technology.