Using The Second Microcontroller On An Arduino

While newer Arduinos and Arduino compatibles (including the Hackaday.io Trinket Pro. Superliminal Advertising!) either have a chip capable of USB or rely on a V-USB implementation, the old fogies of the Arduino world, the Uno and Mega, actually have two chips. An ATMega16u2 takes care of the USB connection, while the standard ‘328 or ‘2560 takes care of all ~duino tasks. Wouldn’t it be great is you could also use the ’16u2 on the Uno or Mega for some additional functionality to your Arduino sketch? That’s now a reality. [Nico] has been working on the HoodLoader2 for a while now, and the current version give you the option of reprogramming the ’16u2 with custom sketches, and use seven I/O pins on this previously overlooked chip.

Unlike the previous HoodLoader, this version is a real bootloader for the ’16u2 that replaces the DFU bootloader with a CDC bootloader and USB serial function. This allows for new USB functions like HID keyboard, mouse, media keys, and a gamepad, the addition of extra sensors or LEDs, and anything else you can do with a normal ‘duino.

Setup is simple enough, only requiring a connection between the ‘328 ISP header and the pins on the ’16u2 header. There are already a few samples of what this new firmware for the ’16u2 can do over on [Nico]’s blog, but we’ll expect the number of example projects using this new bootloader to explode over the coming months. If you’re ever in an Arduino Demoscene contest with an Arduino and you’re looking for more pins and code space, now you know where to look.

Drop-in pcb makes Nintendo Four Score a USB joystick

nintendo-four-score-usb-replacement

The Nintendo Four Score was a controller attachment for the original Nintendo Entertainment System which allowed you to use four controllers at one time. [Simon Inns] wanted to use some original NES controllers on his computer so he developed a drop-in replacement board that converts the device to USB.

As we’ve seen with other NES controller hacks, the hardware uses a simple parallel to serial shift register to deliver key-presses to the console. This means that reading four controllers at a time is no different than shifting in data to a microcontroller from the four different sources. The remaining portion of the problem is providing a USB connection that enumerates the device as a joystick. We’ve seen a bunch of USB projects from [Simon] so it’s no surprise that he was able to pull it off.

He went with the ATmega16U2 which has built-in support for USB. [Simon] wrote the code so that although there is only one USB cable, each of the four controller ports will appear as a separate USB joystick on the computer. To button up the project he carefully measured the original board and laid out his own version so that it fits the footprint of all the original components as well as the mounting brackets on the case. Top notch [Simon]!

Playing footsie with your video games

[Jon] will be tapping away with his toes during gaming session thanks to this foot controller which is packed with buttons and sensors. It’s the second iteration of the build. The original had some solder joints break and the USB stopped working. He had also been experiencing some erratic behavior and so he decided to upgrade the control hardware and add a few more things in the process.

This version uses an Arduino Uno as the interface board. He did a bunch of prototyping to find the best way to hook up all the analog sensors, and how to properly debounce the buttons. Once he was happy with the inputs he set about finding a better way to use the USB HID standard with the device. We were surprised to hear that the ATmega16u2 (one of the new AVR chips which includes USB hardware) doesn’t play nicely with Linux. But [Jon] managed to hack his way around that issue and now he’s gaming with an even better foot controller than before.