Society of Robots - Robot Forum

Software => Software => Topic started by: vonlark on December 31, 2007, 04:19:19 PM

Title: Custom USB Drivers
Post by: vonlark on December 31, 2007, 04:19:19 PM
I'd love to be able to plug my projects into my computer's usb port and control them from my computer. Unfortunately I know next to nothing about usb communication. How can I get started writing drivers to interface with my custom usb devices?
Title: Re: Custom USB Drivers
Post by: Admin on December 31, 2007, 04:37:03 PM
I'm not an expert on this so others should definitely comment . . .

The method I do it is by using a chip called CP2102 which does a USB to UART conversion, then I use hyperterminal to send messages and commands.

this is my uart tutorial that might help you:
http://www.societyofrobots.com/microcontroller_uart.shtml
Title: Re: Custom USB Drivers
Post by: SomeSaba on December 31, 2007, 07:50:13 PM
So u dont need like a TTL to 10volt serial conversion then again another one from serial to USB?

If its just USB to UART i assume thats TTL and u can connect the converted signal straight to the pins on ur mcu?
Title: Re: Custom USB Drivers
Post by: SomeSaba on December 31, 2007, 08:02:59 PM
I just looked it up and i cant find a non-surface mount version o.0 is this correct?
Title: Re: Custom USB Drivers
Post by: frank26080115 on December 31, 2007, 09:29:43 PM
http://www.sparkfun.com/commerce/product_info.php?products_id=198

what's the big difference between a FT232 and the CP2102?

I'm also working on learning USB... It'd be cool to be able to grab frames from a webcam on a robot, right now all i know is I can get a bunch of info if i type lsusb into my terminal...
Title: Re: Custom USB Drivers
Post by: vonlark on January 01, 2008, 01:24:48 AM
I thought there was a pretty big difference between a high speed usb connection using a custom usb driver to interface a device with program on a pc and using hyperterminal to type messages to a robot.

For one, the first sounds much cooler.
Title: Re: Custom USB Drivers
Post by: dunk on January 01, 2008, 05:45:48 AM
Quote
I thought there was a pretty big difference between a high speed usb connection using a custom usb driver to interface a device with program on a pc and using hyperterminal to type messages to a robot.
using a USB to UART chip (such as the FT232 and the CP2102) means you don't have to write a driver. the chip manufacturer has done that for you and the chip will appear on your computer as a virtual serial port (COM port if you use windows).

you can then have any program running on your PC write text strings to the virtual serial port.
nice and easy.

writing USB drivers is somewhat complicated.
have a look here if you want to get involved in making USB devices without using a USB to UART chip: http://www.obdev.at/products/avrusb/index.html (http://www.obdev.at/products/avrusb/index.html)
(unfortunately the recent SOR web hosting problems wiped out the code from my own project there. i'll have it back up i the next few days.)


Quote
what's the big difference between a FT232 and the CP2102?
different manufacturer. read the datasheets for exact differences.


dunk.