Shop OBEX P1 Docs P2 Docs Learn Events
Propellor as USB Master? — Parallax Forums

Propellor as USB Master?

John KauffmanJohn Kauffman Posts: 653
edited 2006-04-21 13:37 in Propeller 1
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?

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-02-22 17:09
    I don't see why not, but it will not be released with the capacity to do so, a customer would have to write the software to implement the functionality. If you want a pre-existing product GHI-Electronics sells a USB master interface, but I am not aware of anyone who has interfaced this product with a Parallax controller yet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Alex HobbyAlex Hobby Posts: 4
    edited 2006-04-20 01:59
    Remember, as neat as it seems, the Propeller simply bit bangs I/O. Even at the 12Mb/s speed of USB 1.1, the 80MIPS speed of the Propeller (is that per COG or for all COGs), it would be difficult to envision doing everything in the necessary time, leaving only 6 or so clocks (optimistically) for each bit! I'm pretty sure this is why each COG has extra hardware to generate video. These video generators are probably best described as glorified shift registers, like the shift registers used in other cheap video designs (see Don Lancasters Video Cookcook and the Timex ZX80). A similar set of USB specific shift registers could certainly make your USB dream more realistic. Other shift registers could also make other high speed serial thingys (Ethernet, Firewire, etc.) possible. There may be enough coherence that one design might be able to encompass several advanced peripheral features.

    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.
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-04-20 14:49
    Just some notes:
    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
    ·
  • John KauffmanJohn Kauffman Posts: 653
    edited 2006-04-20 15:58
    Thanks for the analysis. It is deeper then I can carry out but it is great for me to understand at a high level what is needed.

    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.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-04-20 17:15
    Yes, please share your experience with the GHI solution, Ive been intrigued by it, but haven't decided whether to take the plunge or not.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • Oliver H. BaileyOliver H. Bailey Posts: 107
    edited 2006-04-21 11:58
    Hi John,
    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
  • John KauffmanJohn Kauffman Posts: 653
    edited 2006-04-21 13:37
    Can you share the names of the other two manufacturers?

    I'm working with the GHI engineers to come up with sample code.
Sign In or Register to comment.