USB terminal

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

I'm currently a very happy user of atmega16 and an RS232 amp. With TeraTerm I can control every bit of my device and application.

For the next generation of the device I've been wanting to use USB instead of RS232, but still have it show up as a UART on the computer. I use TeraTerm and a selfmade cat program to dump keyboard instructions and files.

I'm new to using USB in this way. Where should I start? Should I hook a USB device (which?) onto the 'mega16? I'm already using SPI, so that should be a small add-on. Or is there a better way to do this? I'd like to keep some of my legacy 'mega16 code, but that is not at the very top of my list. Hardware simplicity also matters.

Thanks,
Borge

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

Three options:

1) add an FTDI to any AVR (such a m16) and on the AVR side it "looks" just like a UART device while on the PC side it transports over USb cable but, using a CDC class appears to be a virtual comm port.

2) on any AVR use V-USB which is "soft USB". It can be HID (mouse/keyboard) but it can also be a VCOM under CDC class so again looks like a UART at the PC end having transported over the USB cable. The downside (compared to (1) and (3)) is that it uses quite a lot of the AVR "horsepower" to do the USb "simulation" trick.

3) use a USB specific AVR - there's the older AT90USB82/162 which are 8K/16K devices. If you can track them down a newer series of chips are the ATmega16U2, ATmega16U4, ATmega32U2, ATmega32U4 which are 16K and 32K chips with USB built in. These do US "properly". Almost all USB overhead is in the silicon so the CPU is left with almost all its bandwidth to do the real job. Using Dean's LUFA software on these chips you can do virtually any USB device class you choose including HID, CDC, MTD, MIDI, Printer

(2) costs the least, then (1), then (3).

Most folks probably dip their toe in the USB pond using FTDI in fact. (you may have already done it if you connected your current AVR to the PC using a USB to RS232 converter cable - almost all simply have an FTDI chip buried in the device (sometimes "Prolific" instead)

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

Following on from Cliff's advice, I have just purchased a few more of these, that I graft onto boards which I am retrofitting. http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=160460239916
Incidentally these devices have a 3.3V output when powered of USB bus, which can be used to power a Butterfly board as well as providing USB interface to Butterfly. Nice!

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

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

The FTDI chips ( some of them at least ) have a 2nd advantage. They have programmable GPIO pins. I have used these in several designs to form a built-in emergency SPI programmer. Just in case the boot-loader or fuses on the AVR get corrupted. It even has a clock-output if you manage to set the oscillator to "external".

It just makes me feel better about units in the field :)

Mike Adams
ADI Development, Inc.
http://www.adidev.com

... When it has to actually work.