USB in python
Brian Allen Vanderburg II
BrianVanderburg2 at aim.com
Mon Jan 26 15:55:01 CET 2009
astan.chee at al.com.au wrote:
> Tim Roberts wrote:
>> Sorry, but you have NOT created a USB device, and I sincerely hope
>> you do
>> not try to plug it in to a real USB port.
> Sorry, by USB device, I meant a device that is powered/activated by a
> bunch of wires that I want to control using a computer and since I had
> a spare USB jack lying around, I used that instead. But so far I
> haven't tried it, nor will try it if it wont work properly. Yes, it is
> not a proper USB device, because I didnt build it to specifically
> interface with the USB port; but I had to start somewhere. Also, the
> device requires more power than the standard parallel port can give.
> Anyway, it looks like the easiest solution for my case is a
I've played around in this area a little bit. Microcontrollers still
require hardware programming and for simple circuits I think it is
overkill. If you want to use USB then you may be able to use the FTDI
chips. They have both serial (FT232) and parallel (FT245) chips and are
quite cheap. They are surface mount devices though, but you can get a
kit that includes USB port, the chip already connected to a board with a
DIP plug and some essential circuits. libftdi, which runs on top of
libusb, can control both of these and they require no programming
(unless you want to change the USB configuration settings such as vendor
ID, etc, from the default value)
This is the FT245 chip which is basically USB-to-Parallel.
The spec sheet for the board seems quite simple. It's pin out is
similar to that of a parallel port in that you have your data lines
DB0-DB7, etc. It can also be connected in bus-powered configuration
(~100mA) or self-powered configuration. The kit is more expensive than
the chip itself, but probably easier especially if you don't have any
experience with surface mount.
You could build it into your device. You could also create a simple
switch box out of it to control external devices, maybe connecting each
of the data lines to relays to turn on/off eight devices, etc.
Brian Vanderburg II
More information about the Python-list