Arduino Uno R3 as HID

From SGMK-SSAM-WIKI
Revision as of 10:07, 26 August 2014 by Gaess (talk | contribs) (Created page with "= Overview = To change your arduino into a usb HID device - for example a USB-keyboard - you will have to load a new firmware on the ATMEGA 16U2 chip on your Arduino board. Th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

To change your arduino into a usb HID device - for example a USB-keyboard - you will have to load a new firmware on the ATMEGA 16U2 chip on your Arduino board. That is the small square chip just behind the USB port on the board. This procedure is called DFU-programming or updating the firmware.

Updating the ATMEGA 16U2

First step is to reflash the ATMEGA 16U2 so we know that our setting is actually working. This instructions are based on some useful sites and forum hints on the web: - Updating the Atmega8U2 and 16U2 on an Uno or Mega2560 using DFU - Arduino-forum: Using Uno R3 on Linux? And some more hints in different forums I cannot recall already.

Install dfu-programmer

Download dfu-programmer from your distribution repos. For Ubuntu and Debian: sudo apt-get install dfu-programmer

Once installed, check the version with dfu-programmer --version

It has to be at least 0.6.1 for the following steps to work. If it's not, download the programmer directly from the authors: DFU-Programmer at GitHub


Reset 16U2

The Arduino Uno R3 (I'll call it just R3 from now on) comes with pin headers for the 16U2. To reset the chip, connect the two pins closest to the usb-port.

Flash ATMEGA 16U2

The following instructions are for linux OS's. Download the latest firmware from GitHub. The file is called Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex at the time of writing.