When is using a microcontroller as HID possible?

Hello everyone,

I am thinking about building my own game controller (like for my retropie).

I did some research and it seems like there are two big ways of building a game controller:

  • Writing the actions of the elements (like when the button was pressed) to the Serial and converting this data to keystrokes etc. (Like with Java or Python)
  • Using the microcontroller as a native HID and "faking" a real Keyboard / Input-Device

I think for the retropie only the second way is suitable, since I don't want to write a bridge between the Serial and the Retropie-system.

I found out that for some microcontrollers it is easy to emulate a real keyboard (hid device) like with the Arduino Nano, Arduino Leonardo, Arduino Micro, the Adafruit Trinket or the Teensy.

However, some microcontrollers seem to be not suitable (like the Arduino UNO). There are some libraries, but they seem to be complicated, since they are flashing the whole bootloader.

Can someone explain me why some microcontroller are suitable for an HDI device and some are not? And besides: do you have a personal favourite for creating a game controller with HDI?

Greetings from Germany! MaxFrank

MaxFrank1990: Can someone explain me why some microcontroller are suitable for an HDI device and some are not?

Quite simple.

You need hardware to implement USB. It can be crudely fudged in software as is done on the USBASP, (Code called "V-USB") but is not entirely reliable/ compatible. The processors used in the Leonardo (also Pro Micro) and the (real) UNO R3 USB interface have that hardware.

So you can do it on a UNO, but you have to reprogram the 16U2 via ICSP to do so.

Great. I got this. Thank you :)

Do you know any reason why they did not program the 16U2 to be capable of this?

They pretty much dropped the ball on the whole 16u2 thing. If I was doing hid I would choose a 32u4 based board like the Leo or micro. More info on doing it available around the Internet too

Ah okay. Yeah, I found some information about it on the internet, but I was wondering why some chips are capable of doing hid and some of them aren't.

Just one last question: How do I figure out whether the hardware supports usb hid? What shall I look out for (like in the documentation/tech specs)?

If it has native USB then it can do hid. Many arduino boards include a USB serial adapter and the chip is connected to the serial side - because the chip doesn’t have USB support. USB on chip significantly increases hardware cost

I guess the Esplora has been discontinued (??), but they're still available.