Emulate serial port via USB - How hard can it be?

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi again,

Based on my previous post, it seems very likely our next design will involve a -U Xmega with USB support.

Is there any app notes or code examples on how to make the Xmega emulate a USB serial port in Windows? How hard can it be?

Any feedback welcome.
/Bjorn

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ASF has USB-CDC/ACM examples.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It turns out this is very easy to do. If you have an xplain board, the samples load up and work out of the box. Easy to follow, easy to duplicate.

There is one thing (windows issue not an atmel issues) when using usb. If you're debugging or resetting frequently - the usb connection is lost and re-established. (or not re-established if breakpoints are in the middle of the transmission) This always forces a re-establishing communications on the windows box. When you this, I miss the startup debugging messages. If you are simply using usb for debugging, I personally prefer to use a serial port and a ftdi connector.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good point Erg144. Serial port and FTDI connector it is.

Cheers!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

While it doesn't solve the problem of missed debug messages if you do want to develop a USB CDC device I suggest looking at Terminal by "Br@y". It has a handy feature where it disconnects from the serial port when the window loses focus, preventing it from crashing every time you reprogram the AVR.