Page 1 of 1

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

Posted: Thu Jan 12, 2012 2:00 am
by chlor

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.

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

In the source it looks like it almost de nothing at all. It simply just use the generic serial device code with no hooks: ... 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:
(it is just text files)


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

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

Posted: Thu Jan 12, 2012 11:27 am
by Daid
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

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

Posted: Sun Jan 15, 2012 9:40 am
by chlor
Thanks Daid, ATMega8U2 is really a better solution for me. And proto type board is awailable like "USB Serial Light Adapter" and others.