Creating an Arduino Multi-touch HID

1,278 views
Skip to first unread message

CMLinux

unread,
Aug 20, 2013, 3:54:45 AM8/20/13
to lufa-s...@googlegroups.com
Hi Dean and other list members,

I'm currently working on a project which uses serveral multi-touch screens. Each multi-touch screen has a USB digitizer output which is a USB HID. My problem is that when using several of these multi-touch screens, the OS doesn't deal with them correctly (or at least in Windows the OS doesn't). I want to make 4 or mor digitizers appear as one big digitizer to the host machine. Rather than trying to re-write the driver i'm doing this:

-Connect the USB output of each digitizer to a raspberry pi
-read the USB data on the rPi using libusb
-send the data using UDP to an arduino with an ethernet shield
-modifiy the data (if necessary) and send it to the host device

The first steps are quite easy, and working. The USB data stage is getting to the Arduino UNO correctly. Now, I just need to use LUFA to make the Arduino UNO identify itself as a USB HID and send the data through to the host. 

I know that Darran Hunt was doing something similar for a HID Keyboard, so I'm roughly following what he has been doing. Unfortunately, mine is still not working. I don't seem to be generating HID reports. Given the whole thing is in the bootloader, i'm not great at debugging this sort of thing. I was hoping for a bit of help on this. Also, unlike keyboard reports which are 8 bytes, the HID reports from the digitiser are 64 bytes. 

If I connect the digitizer to a linux device, the lsusb -v info is this:

Bus 001 Device 082: ID 0596:0506 MicroTouch Systems, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0596 MicroTouch Systems, Inc.
  idProduct          0x0506 
  bcdDevice            1.08
  iManufacturer           1 3M
  iProduct                2 3M MicroTouch USB controller
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     728
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Status:     0x0003
  Self Powered
  Remote Wakeup Enabled

If I change the descriptor.c file, I can get the Arduino to basically produce the same content. I just seem to have a problem getting the data into the HID report.


Any help would be great!

Thanks,
Corey

CMLinux

unread,
Aug 21, 2013, 1:10:48 AM8/21/13
to lufa-s...@googlegroups.com
Further to my issues,

The endpoint size of the HID should be 64, I believe.

If I change the LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 to 64
and change the GENERIC_EPSIZE to 64 in the Descriptors.h file, it seems my pipe stalls.

If there something else that needs to change to increase the endpoint size from 8 to 64?

Dean Camera

unread,
Aug 21, 2013, 2:00:07 PM8/21/13
to lufa-s...@googlegroups.com
For the benefit of others, since this was discussed on the Freenode #avr IRC channel this afternoon:

The control endpoint size doesn't impact the device operation other than decreasing throughput, so that's not the culprit. The most likely cause is the HID descriptor not matching the data that is being sent through the HID interface.

- Dean

Corey Manders

unread,
Aug 21, 2013, 8:48:00 PM8/21/13
to lufa-s...@googlegroups.com, lufa-s...@googlegroups.com
Thanks again Dean!

Just woke up, so I will be working on the issue now. Will let you know how it goes. 

--Corey
--
You received this message because you are subscribed to the Google Groups "LUFA Library Support List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lufa-support...@googlegroups.com.
To post to this group, send email to lufa-s...@googlegroups.com.
Visit this group at http://groups.google.com/group/lufa-support.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages