Shop OBEX P1 Docs P2 Docs Learn Events
chip for usb HID — Parallax Forums

chip for usb HID

Erik FriesenErik Friesen Posts: 1,071
edited 2008-05-24 15:56 in Propeller 1
Is there a drop in chip similar to the ftdi 232 that can function as a HID?· Or can the 232 do it?· I am looking for something $5 or less.

Comments

  • LeonLeon Posts: 7,620
    edited 2008-05-21 21:34
    Microchip PIC18F2455.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • hippyhippy Posts: 1,981
    edited 2008-05-21 21:42
    Do you mean using the Propeller as a USB slave device or using the Propeller as a host to which other USB slaves can be connected to ?

    If the former, check out the work done by Brad C ...

    http://forums.parallax.com/showthread.php?p=675656
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-05-22 20:53
    Can I do the pic thing in assembly with minimal hassle or is it a full blown c compiler and the whole nine yards? $$$$? (I do have a pickit2) I checked out the usb object written by brad c and had it working somewhat. The question is, can John Doe off the street plug this into his computer and make it work in a handheld device? (with my interface program) Is there a way around the vendor ID legal thing?
  • BradCBradC Posts: 2,601
    edited 2008-05-23 09:52
    Erik Friesen said...
    Can I do the pic thing in assembly with minimal hassle or is it a full blown c compiler and the whole nine yards? $$$$? (I do have a pickit2) I checked out the usb object written by brad c and had it working somewhat. The question is, can John Doe off the street plug this into his computer and make it work in a handheld device? (with my interface program) Is there a way around the vendor ID legal thing?

    You can buy a block of 5 or 10 VID/PID pairs from a guy on the net.. so that's no issue really.

    With the PIC you can guarantee a USB compliant device and actually get it approved. The Propeller USB stack will never be USB compliant as
    it can't meet critical timing requirements. Having said that, I've tested it on every machine I've come across so far and not had one give me grief.

    I'm working on a generic vendor specific HID device and the python code to talk to it with libusb at the moment. That will allow it to operate on all unmodified OS (where at the moment you need a small patch to the linux kernel to allow low-speed BULK for the CDC-ACM device) .

    The other advantage of the pic is it will do low speed and full speed, where the prop will only do low speed.

    I guess you could call a prop based device something like "Device interfaces via PC USB port", but you could not call it a "USB Device".

    I'm using the prop already, so taking 3 pins and 2 cogs for the USB interface kinda made sense to me.

    Brad
  • hippyhippy Posts: 1,981
    edited 2008-05-23 14:31
    VID's can be bought but expensive, VID/PID pairs can be purchased / licensed in blocks from a number of sources as BradC notes and if they can be sub-licensed anyone buying a block could gift one or more to the Propeller community for their use.

    I was intending to do that but never pursued it. IMO that would be better than using the generic PID/VID currently used ( but could have consequences ), and the PID/VID can be locked by license to only being usable with a Propeller device.

    If I get some time I'll look into obtaining PID/VID exclusively for Propeller use again, and there's nothing stopping others doing the same.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-05-23 16:16
    I don't have a understanding of the low level workings of usb but adding one of the many available transcievers to the prop would not make it compliant? I have considered changing my project over to the pic18 series just for the usb thing but when I think of trying to code usb and everything else plus interupts and 8 bit processing plus trying to create a user interface using the pic compared to the prop, it seems a bit much. Combining the usb thing and dropping the ftdi driver would suit me well if I could be certain of end user reliability.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-05-23 16:21
    Do you think this is a legit place to buy a pid?

    http://www.ezprototypes.com/EZModulesMain.php
  • BradCBradC Posts: 2,601
    edited 2008-05-23 16:35
    Erik Friesen said...
    I don't have a understanding of the low level workings of usb but adding one of the many available transcievers to the prop would not make it compliant?

    Afraid not. The issue is not so much the actual physical media, more the ability to comply with the timing requirements (calculating the CRC on packets is a big one).
    As for reliability, why not do what I do and knock up a self-contained USB powered/interfaced proto-board and carry it around in your laptop bag. Every time you spot a new machine you can get access to, plug it in and try it. I used the california dreamin' keyboard code to test it out. I've not found a machine yet it'll not work with, but then it's also not usb compliant to the letter of the spec.

    If you are building stuff that's life and death then I'd look at a proper USB chip.

    As for the website for the VID/PID, 12 bucks for one is a bit spendy, but yeah I reckon that would do the job. All it requires is that they allocate it to you alone. As long as they never issue a duplicate then you have no problem.

    I'm planning on buying a block of 10 for my own use, and was going to dedicate some of them to some various bits of prop software I've been playing with.. but then there's rarely enough time in the day.
  • hippyhippy Posts: 1,981
    edited 2008-05-23 17:30
    As per BradC : $13 seems a bit pricey for one but that's the sort of licensing you're looking for - ability to do anything you want with the PID/VID when you get it.

    It's worth looking around on the Net. There are some companies who provide blocks free for configuring their OEM components but they may have restrictive licensing terms.

    Be aware though that any VID may be identified by some software as having come from a particular vendor but that shouldn't be a problem in most cases. Windows AFAICT just uses the information which comes in the accompanying .INF file. This is how a single VID/PID can be subverted for any use by any number of people. It only becomes a problem if you have two devices with the same PID/VID which have different functionality or where functionality is different to a device previously installed with that VID/PID.
  • LeonLeon Posts: 7,620
    edited 2008-05-23 18:20
    Lots of HID examples for the USB PICs are available in C and assembler. I've not tried a HID, but have experimented with the 18F2455 for a standard USB interface and didn't have any problems.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • jazzedjazzed Posts: 11,803
    edited 2008-05-24 14:53
    BradC said...

    ... The Propeller USB stack will never be USB compliant as it can't meet critical timing requirements. ...
    Would this statement also be true for a PASM variant ?
    Seems your code is spin, and spin is relatively slow because of it's interpreted nature.
    Of course using C would be·faster, but that's another effort.
    What methods in your spin violate the timing requirements ?
    It would be fairly easy to add PASM commands to handle critical code.

    Having a USB compliant propeller design opens a world of opportunity.
    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    jazzed
  • BradCBradC Posts: 2,601
    edited 2008-05-24 15:32
    jazzed said...
    BradC said...



    ... The Propeller USB stack will never be USB compliant as it can't meet critical timing requirements. ...


    Would this statement also be true for a PASM variant ?

    Seems your code is spin, and spin is relatively slow because of it's interpreted nature.

    Of course using C would be faster, but that's another effort.

    What methods in your spin violate the timing requirements ?

    It would be fairly easy to add PASM commands to handle critical code.



    Having a USB compliant propeller design opens a world of opportunity.

    Thanks.

    Have you looked at the code?
  • jazzedjazzed Posts: 11,803
    edited 2008-05-24 15:56
    Apparently not close enough. .... Apparently the RX routine is most critical ... optimizations are mostly not immediately obvious. Some of the nops are not necessary. It seems you have just run into·similar performance issues that keep popping up for me. An instruction each 50ns is just too slow for many time critical things. PropII is supposed to be twice as fast, but it ain't here yet, and I don't think that will make too much difference for the most part. Though in this case, if·I read it right, 2x performance increase would help.

    ·

    ·

    ·



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    jazzed

    Post Edited (jazzed) : 5/24/2008 4:48:50 PM GMT
Sign In or Register to comment.