Generic serial (RS232) driver - use a std on the PC

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
chlor
Posts: 2
Joined: Thu Jan 12, 2012 12:32 am

Generic serial (RS232) driver - use a std on the PC

Post by chlor » Thu Jan 12, 2012 2:00 am

Hi

I want to make a small device which just present itself to my PC as a generic serial port device like /dev/ttyUSB0 so I do not have to have a special driver on my PC. I expect the communication to look like:

Code: Select all

  echo "set mode=7" > /dev/ttyUSB0
  cat /dev/ttyUSB0 > data.log


The project is very similar to this EasyLogger which interfaces to the keyboard. A good concept unless you need to have 2 or more devices connected.
http://www.obdev.at/products/vusb/easylogger.html

So I looked for a small and simple USB-serial driver at my system:

Code: Select all

$ ls -S /lib/modules/$(uname -r)/kernel/drivers/usb/serial/ | tail -n 1
zio.ko


In the source it looks like it almost de nothing at all. It simply just use the generic serial device code with no hooks:
http://lxr.linux.no/#linux+v3.2/drivers ... rial/zio.c
It is a bit similar to a generic keyboard but for a serial port.

I know I am not supposed to present my device as another vendor:product but it looks like that if choose to use USB_DEVICE(0x1CBE, 0x0103) my system will automatically load the zio driver and I got a /dev/ttyUSB0 .

Will this work and is it possible to use V-USB for that?

Zilog has "drivers" for there device but they are just parameters for a default usb-serial:
http://www.zilogic.com/releases/zio-sw-1.1/drivers/
(it is just text files)

/hans

(I'm sorry if this question has been asked before. I could not find the answer)

Daid
Rank 2
Rank 2
Posts: 55
Joined: Mon Apr 18, 2011 12:19 pm

Re: Generic serial (RS232) driver - use a std on the PC

Post by Daid » Thu Jan 12, 2012 11:27 am

Using V-USB as serial driver will is problematic. Because the CDC profile is not allowed with low-speed (and V-USB is always low-speed). It is possible, but it requires some hacks on the computer side. Also new USB chips seem to refuse this in some cases, and Windows 7 has also made this harder. In my opinion, it's not worth the trouble.

If you want USB serial, use an AVR with USB build in. Like the ATMega8U2

chlor
Posts: 2
Joined: Thu Jan 12, 2012 12:32 am

Re: Generic serial (RS232) driver - use a std on the PC

Post by chlor » Sun Jan 15, 2012 9:40 am

Thanks Daid, ATMega8U2 is really a better solution for me. And proto type board is awailable like "USB Serial Light Adapter" and others.

Post Reply