Getting USB HID to work

A project log for USB Caliper HID

Uses a Trinket Pro to provide an USB HID keyboard interface to a commonly available digital caliper

Lou CabralLou Cabral 01/03/2015 at 01:072 Comments

I've had a really unsuccessful time in trying to get the USB HID to work on the Trinket Pro. From what I had seen, and read on the web, it should not have an easy task.

The problem that I encountered was that the Trinket bootloader(USBTiny) would start up, and it would be enumerated by the host system correctly. But, when the bootloader passed control to my sketch, the host would always failed to enumerate the Trinket as a Keyboard HID -- it would remain a USBTiny.

I spent several frustrating days trying to get it going. Out of frustration, I ended up modifying the Trinket.

It's a simple change. I added GPIO control of the USB pull-up resistor. I now works consistently.

The change which I made is to allow the sketch to pull the USB data low/high which causes the USB host to re-enumerate.

There might be a non-hardware solution, but for now, I am going to leave it alone. The current mod uses a diode, but just a wire may be sufficient.


Lou Cabral wrote 01/03/2015 at 02:15 point

Thanks, I've just started reading your log.

  Are you sure? yes | no

Stefan Lochbrunner wrote 01/03/2015 at 01:58 point

Yeah, I had the same issue. The key is to comment out "Optional Hardware Config" in the usbconfig.h. For more details please refer to the first paragraph in this project log of my project.

It's a very easy fix, definitely doable before the deadline ;)

  Are you sure? yes | no