Shop OBEX P1 Docs P2 Docs Learn Events
SX built USB device with an HID driver — Parallax Forums

SX built USB device with an HID driver

angrycamelangrycamel Posts: 4
edited 2006-09-25 03:51 in General Discussion
Has anyone ever built a USB device to be used with an HID driver? Like a touchpad, mouse or keyboard? I am working on a touchscreen system in which I will be getting the coordinates of touch event and would like to send that over to the PC to be interpretted by an HID driver and translated into mouse clicks.

From what I have seen about the HID classes and the FTDI chips, I am not sure that a virtual com port will be compatible with the HID standard. Before I spend a whole lot of time reading up on this, has anyone had any experience with this sort of seup in the past?

Thanks in advance for any assistance.

-AC

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-09-19 01:47
    There was an article in the August 2006 issue of Circuit Cellar on building an HID volume control. It used an Atmel ATtiny13 microcontroller and a MAX3420E USB controller.

    From the article, it looks like it would be fairly straight-forward to build the device around an SX chip. Here is a link to the USB chip: www.maxim-ic.com/quick_view2.cfm/qv_pk/4751

    I'm not certain if the FTDI chip is HID compatible. I think there was a recent post where one of the Parallax guys said it wasn't, but I can't find the post...

    Post Edited (Kevin Wood) : 9/19/2006 7:20:00 AM GMT
  • angrycamelangrycamel Posts: 4
    edited 2006-09-19 04:08
    Thanks for the link to the maxim part. idea.gif

    After reading up a bit I found a few things were most helpful so I figured I should share the direct links in case anyone else references this thread. The first two I found listed on the maxim part details page that Kevin linked above. The last link in the list below is a url to the circuitcellar.com article Kevin mentioned.

    (Maxim-ic.com) APPLICATION NOTE 3637 - Add USB to Anything: www.maxim-ic.com/appnotes.cfm/appnote_number/3637
    (Maxim-ic.com) APPLICATION NOTE 3690 - USB Enumeration Code (and More) for the MAX3420E: www.maxim-ic.com/appnotes.cfm/appnote_number/3690
    (CircuitCellar.com) PDF Version of the article Kevin mentioned ($1.50 paypal) - Add USB to Anything: www.circuitcellar.com/magazine/180toc.htm
  • TransistorToasterTransistorToaster Posts: 149
    edited 2006-09-20 00:37
    I actually have one of the FTDI chips sold by Parallax. All it did was to create an extra serial port on the PC. On the MCU side, it looks essentially like a MAX232.

    Frank
  • TransistorToasterTransistorToaster Posts: 149
    edited 2006-09-20 00:45
    I saw from the sxlist.com a circuit that connects the SX directly to the USB port via a level shifting chip. It types the lyrics of the song "California Dreamer", by The Mommas and Poppas. The source is included but there is no forum discussion about it anywhere, besides those who mentioned its existence.
    Frank
  • angrycamelangrycamel Posts: 4
    edited 2006-09-20 02:30
    I found what you were refering to. Here is the link. I will have to really study that code to know what in the world is going on but thanks for the reference. sxlist.com/techref/ubicom/lib/io/dev/keys/usbdemo-mh.htm
  • Oliver H. BaileyOliver H. Bailey Posts: 107
    edited 2006-09-20 02:58
    Hi Everyone,
    The FTDI chips operate in only two modes. The first is as a serial port, in which the chip is seen as a standard serial port or virtual comm port. The second method of accessing the FTDI chips are through a DLL mode. DLL mode is not an HID device, it's a hybrid specific only to FTDI and it has it's own set of problems.
    If you want to use a simple HID device, yo may want to look at the Cypress EnCore II and PSoC Designer. PSoC Designer is a free tool which includes support for HID type devices. The first time you use PSoC Designer there is a learning curve. You could also use PSoC Express which will have USB serial support by the end of this month. That would allow you to implement a native USB inerface an then study PSoC Designer and implement a native USB device later.

    Regards,
    Oliver
  • angrycamelangrycamel Posts: 4
    edited 2006-09-20 13:45
    Thanks for the information, Oliver. I am at the office right now, but I will do some research on the things you mentioned this evening.
  • TransistorToasterTransistorToaster Posts: 149
    edited 2006-09-23 04:37
    I didn't look at all the devices in the HID family. If I just want to send packets of data, do I need to look outside HID?
    Frank
  • Oliver H. BaileyOliver H. Bailey Posts: 107
    edited 2006-09-24 01:10
    Hi Guys,
    If you want to make your device a real HID product, then you have several options. The first is the Silicon Labs C8051F340 which is an 8051 part that can be configured as a virtual com port or HID type device with 3 Endpoints. This is a very tiny chip and the support tools are excellent. It's supported by the GNU SDCC compiler and the Silicon Labs IDE integrates the SDCC compiler seamlessly. There are also several parts from Cypress that will do the job in the same fashion. The Cypress parts are more flexible and use the M8 core which is a supserset of the 8-51 that has some very nice features. I'm doing a book on the Cypress development platform (PSoC Express) which makes building a USB interface completely visual. That will be out in November. Either of these solutions will give you path to building a true HID device while starting out with a virtual com port device for prototyping. Both companies are excellent to work with and support their products to the highest level. I find the FTDI chips to be excellent for virtual com port emulation but fall short when using their DLL drivers. FTDI is a marketing company and does not offer a level of support that Cypress or Silicon Labs does. his is due in part of the fact that FTDI is a fabless operation whereas both Silicon Labs and Cypress design, control, and manufacture their cores. I hope this helps.

    Regards,
    Oliver
  • Oliver H. BaileyOliver H. Bailey Posts: 107
    edited 2006-09-24 01:16
    And I almost forgot. If you choose with of these parts for USB, don't replace the SX with them. These little devices make great little peripheral controllers for any functions you want to hand off of the SX. You'll also find that the less peripeheral functions you use on these parts when using them as USB interface devices, the faster your USB throughput will be. I realize that's not important in HID mode but I like using these parts to complement the main controller as opposed to replacing the main controller.

    Oliver
  • Randy GlennRandy Glenn Posts: 25
    edited 2006-09-25 03:51
    Where does the "FTDI is a marketing company" bit come from? And what does being fabless have to do with drivers?
Sign In or Register to comment.