Take the 2-minute tour ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

Following on from What's the 2nd ICSP header for in Arduino Uno R3? I was wondering how this could be hacked to our advantage.

For example, could that firmware be rewritten to have the UNO recognised as a mouse/keyboard input? Could this be done after the boot loader process and leave the uploading process in tact?

Given the limited IO, it seems it's functions might be limited. Plus I have no idea how much code is space is available.

share|improve this question
    
As an extra to this question, feel free to add other ideas this could be used for whilst (in as far as possible), leaving the arduino environment in tact. That is, what else could be hacked into it to increase it's functionality? –  Madivad Mar 29 at 21:55
    
It's flash is too small to hold multiple hacks, but the LUFA website (linked in my question) has a lot of different hacks that are compatible with the 16u2 –  TheDoctor Mar 29 at 22:17
    
Too small? 16kB is a lot of flash. I'm surprised they didn't stick with the 8U2 as in the original (although there may be availability issues involved). –  Ignacio Vazquez-Abrams Mar 29 at 22:20
    
I just checked Digi-Key and the price difference between the 8U2 and 16U2 is about $0.01. At that price it's a no-brainer, even if you don't need the extra flash. –  Ignacio Vazquez-Abrams Mar 29 at 22:44
    
This question is spawned from a project I saw on hackaday last year, and a friend and I have been discussing it on and off ever since. I just found this (only two weeks old): hackaday.com/2014/03/16/… –  Madivad Mar 29 at 23:03

2 Answers 2

up vote 4 down vote accepted

Yes, it is possible. using LUFA, you can burn new firmware to the Serial converter. The only problem is that you need to re-burn the USB-Serial converter to upload another program.

Info: http://www.fourwalledcubicle.com/LUFA.php

Specific page: http://mitchtech.net/arduino-usb-hid-keyboard/

share|improve this answer
    
Is there more information on the firmware that exists in the 2nd mcu? I haven't been able to find anything on it. I'm sure that someone somewhere has hacked it specifically. Personally, I'd love to see the code. Emphasis (for me) would to largely leave the environment in tact to allow for future reflashing. Which I don't think would be too hard to incorporate after there is nothing from the IDE after reset. –  Madivad Mar 29 at 22:04
    
@Madivad it is a simple assembly file that converts USB signals to serial. You need to use bare AvrDude to flash it. –  TheDoctor Mar 29 at 22:14
    
from one of those links I found: arduino.cc/en/Hacking/DFUProgramming8U2 I searched for this kind of info, obviously wrong search terms :) Thanks for your links Doc. –  Madivad Mar 29 at 22:56

The second MCU is similar to that used in the Leonardo, but is smaller and less capable (ATmega16U2 vs. ATmega32U4). It is certainly possible to reprogram it to do what you like, but its limits means that you can have fewer USB "devices" at the same time.

I have not looked at the existing firmware, but it should certainly be possible to add your own custom code into it such that both the normal serial connection to the main MCU as well as your additional code can coexist.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.