Propellor as USB Master?
John Kauffman
Posts: 653
In my projects, I occasionally have to leave Parallax products and move to a mini-PC format in order to control a USB slave device. I do not know of a way that any Parallax product can be a USB master. (Do I need some remedial work on what Parallax products can do?)
Will Propeller be able to act as a USB master?
Will Propeller be able to act as a USB master?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
There may, however, still be light at the end of your USB Master tunnel. But you need the answer to this critical question : Does the slave ever drive the USB clock? If not, then a master operating at a reduce speed might be well within your reach, provided your not using something require too much bandwidth.
Not too long ago I posted a simular question about the BS2. I recieved a bunch of posts stating that the USB master has to do this and that, and after carefull and diligent research and tinkering, YES, any device that can communicate with the USB protocall chip can be a USB master providing: The master can talk the "language" of the slave.
Now, before another person starts up with the "now, and what abou's" read this:
The only difference between a master and slave are:
#1:The MASTER device is the ONLY device that can start a data exchange.
#2:The MASTER device can "choose" to ignore a slave, but a slave can't ignore a master.
#3:The MASTER device MUST know the commands to be given to the SLAVE, and understand the resulting data from the slave.
All that is needed to know about the slave is it's methods and it's "commands", period, end of report.
A USB mouse can be read, very easily, by any device with the correct hardware, (A USB connector and protocall chip, like the ones Parallax sells).
It was simply a matter of finding that device on the USB, (what is called enumeration), and using the correct commands.
A PC does this by loading (and unloading) drivers for ANY and ALL USB devices. The issue here is the DRIVER contains the commands needed to access and use the device.
If you are using a uC, you aren't going to try to make your USB interface read ALL or lots of usb slaves, only the ones that are of interest to you.
A Phidget device uses simple commands to send and get data. Enumeration of the devices is a standard programming chore, but if you already know the device address space or command identifiers, you don't need to enumerate the devices to find it and talk to it.
The commanding USB device determins the speed used (1.0 ~ 2.0 and v 3.0 is on the way), so the speed of the incomming data is already tended to by the chips. This also includes clocking the data through the USB subsystem. Simply stated, the protocall chip you use, when properly installed deals with 100% of the issues of talking the USB protocall, all that remains is the commands needed to access (or reply if you are creating a SUB slave device).
The only remaining isses are getting the data into the uC fast enough to do something with.
Now, to finally put it all to rest: If you are reading a slower device, such as a HID, or the device supports the suspend and resume commands (like the USB 2 hard drives, CD readers and writers), speed is not that important, you need only "discover" the command sets needed to access it.
With all that said, I will add the following:
Drivers simplify the usage of all USB devices. It's the drivers job to make a command set available for the slave. If you don't have a driver, it wont work. This is true for both the PC and uC envirments, BUT, the driver in the uC envierment is YOUR code, not something provided by the manufacturer. Finally, you don't need all of the abilities of PC to be a USB master. You don't need the ability to load / unload drivers when a usb device is plugged in, drivers for many devices; only the command set required to access the single pice of equipment on the usb subsystem you are trying to use.
..
Ok, I'll hop off my soap box and go back to playing in the sandbox...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
·
In the meantime I got a GHI-Electronics USB master interface for US$30. I figure that was· cheaper then the anti-acids & aspirin I would need trying to implement the above suggestions with my limited skills. And as you can see from the photo, I don't have much hair left to pull out.
http://www.ghielectronics.com/USBwiz.htm· In the site picture it looks like a single chip. What I got was a small PCB similar to a BoeBot AppMod. It supports two USB and an MMC card. I'm thinking this baby might provide several soutions at once.
I will be trying it with STAMP and SX over the next few weeks & will post results.
Thanks again for the break-down on USB master.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1+1=10
The chip you are using is one of several new combination USB HOST and Microcontroller chips that will be showing up over the next year. Due to the nature of the USB protocol, it has taken chip manufacturers some time to figure out how to provide high speed throughput to embedded USB hosts while leaving time for the main CPU to do other things. There are at least two US manufacturers who will be introducing similar products. I would like to keep up with your progress using the chip you selected. I am curious to see how much software will need to be developed to support the communications between the host and the chip.
Regards,
Oliver
I'm working with the GHI engineers to come up with sample code.