Shop OBEX P1 Docs P2 Docs Learn Events
Generic USB Drivers — Parallax Forums

Generic USB Drivers

Aaron193Aaron193 Posts: 27
edited 2009-08-02 23:19 in Propeller 1
I've always been wondering...

Has anyone attempted or is anyone going to attempt to make a generic USB driver for the Propeller.

I ask this question with relation to Propeller operating systems; if a computer can run USB devices, why can't a Propeller? I understand it is extremely hard to provide protocols for all USB devices in one Propeller object, but I am still curious to know if anyone is trying to scale that wall.

Aaron.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-01 02:06
    By USB driver, I assume you mean a host driver. It's been tried. About the best that can be done is a HID driver for keyboards, mice, joysticks, etc. The Propeller is just too slow to handle full speed hosting of anything else without some kind of external hardware support. Handling a wider range of devices is also very memory hungry and the Propeller really doesn't have enough. The Propeller was worked hard to do even that and had to cheat a little on the USB specs to get the HID stuff to work.

    A computer can do it by having lots and lots of main memory along with a hard disk to hold optional stuff. Computers also have a USB engine that handles most of the low level work and DMA for high speed transfer of data to/from the low level controller's buffers.
  • BradCBradC Posts: 2,601
    edited 2009-08-01 02:07
    Aaron193 said...
    I've always been wondering...

    Has anyone attempted or is anyone going to attempt to make a generic USB driver for the Propeller.

    I ask this question with relation to Propeller operating systems; if a computer can run USB devices, why can't a Propeller? I understand it is extremely hard to provide protocols for all USB devices in one Propeller object, but I am still curious to know if anyone is trying to scale that wall.

    A little searching might show you that question has been asked and answered plenty of times in this forum already.

    The propeller can perform as a low speed USB slave, however there are very few devices that will function at low speed (high speed is a mandatory host requirement) and the propeller is just too slow to run at high speed (12MBPS).

    If you were very clever and ran the propeller at 96Mhz, it is possible to make it perform as a low speed master to talk to keyboards, mice and joysticks. That is about as far as you'll get.
    I'm happy to help with the HID enumerator code if anyone gets that far.

    The current client code is capable of having the propeller emulate a keyboard or a CDC-ACM serial port but it's not been pushed further than that. In theory anything that uses a bulk endpoint is a gross violation of the spec at low speed. (that includes mass storage, printers, scanners and almost anything except HID)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • LeonLeon Posts: 7,620
    edited 2009-08-01 05:59
    High-speed USB is actually 480 Mb/s! 12 Mb/s is full-speed.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • BradCBradC Posts: 2,601
    edited 2009-08-01 10:13
    Leon said...
    High-speed USB is actually 480 Mb/s! 12 Mb/s is full-speed.

    My bad. You are of course right..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-08-01 11:24
    I am sure that some of the AVR projects, such as the serial to ISP programmer, have used bulk endpoints. They state it is a violation of the rules, but get away with the "sin".

    They always use 1.5M bit/sec low speed bit bashed from a 12MHz clock and tight code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-08-01 15:35
    I've been thinking along the same lines...

    Wouldn't it be possible to create a PIC based board slaved to the Propeller
    and some objects to communicate for USB host compatibility?

    I'm guessing here, because I don't have knowledge of PIC, but
    I know we have some who know the territory.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • LeonLeon Posts: 7,620
    edited 2009-08-01 15:48
    Some of the newer 16- and 32-bit PICs have USB OTG, which offers limited USB host capability. Here is a typical device:

    www.microchip.com/wwwproducts/Devices.aspx?dDocName=en531079

    It could be interfaced via the PIC PMP for high-speed data transfer, but would use up a lot of the Propeller I/O.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 8/1/2009 3:54:45 PM GMT
  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2009-08-01 19:11
    Has anybody posted code/schematics for a Propeller USB-slave HID device??? Or even PS/2?

    I have been searching for a way to have my prop emulate a USB keyboard so that it can transmit key presses to a PC. I currently have to use a hacked keyboard or an expensive adapter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thomas Talbot, MD
    Gunpowder, MD, USA
  • Aaron193Aaron193 Posts: 27
    edited 2009-08-01 19:38
    Geez...those guys that developed the PC really have a working wonder. Can any of those FTDI chips do the trick as a slave to the Propeller?
  • LeonLeon Posts: 7,620
    edited 2009-08-01 20:02
    The only FTDI part that can act as a USB host is the Vinculum chip.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • BradCBradC Posts: 2,601
    edited 2009-08-02 12:19
    Invent-O-Doc said...
    Has anybody posted code/schematics for a Propeller USB-slave HID device??? Or even PS/2?

    Yes.

    http://forums.parallax.com/showthread.php?p=675656

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • BradCBradC Posts: 2,601
    edited 2009-08-02 12:20
    Toby Seckshund said...
    I am sure that some of the AVR projects, such as the serial to ISP programmer, have used bulk endpoints. They state it is a violation of the rules, but get away with the "sin".

    They only get away with it on OSX and Win32. Unpatched linux disallows this particular spec violation.

    Most of the AVR ISP stacks use interrupt endpoints to work around this where possible.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-08-02 16:09
    It was a bit of a kludge to get it going on W32. I just assumed it was me not undersanding something (everything). In the end I went back to using RS232. I wanted to be a bit more proofed aginst the evil day when all "legesty" ports dissapear.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • hippyhippy Posts: 1,981
    edited 2009-08-02 23:19
    Mike Green said...
    It's been tried.
    Has it actually been tried ? I haven't checked previous posts and I note what BradC has said, and said in the past but, AVR has software for Host USB on a fairly constrained device and I've seen other discussion/code for doing that. I don't how limited that is, but a Host capability for common HID dvices ( keyboard / mouse ) would be a good start even if 'bodged' ( "kludged" ).
Sign In or Register to comment.