Arduino Uno! Now with a *real* USB interface

552 views
Skip to first unread message

Kussic

unread,
Sep 26, 2010, 6:09:12 PM9/26/10
to london-h...@googlegroups.com
Hey All,

I'm so exited! Finally the Arduino Uno is here! Long gone is the FTDI chip and in it's place we got a new sweet Atmega8U2 programmed as a USB-to-serial. You can read the specs here: http://arduino.cc/en/Main/ArduinoBoardUno

For me that means that the Arduino can be used as a USB HID device (keyboard, mouse, etc) without the need for any external shields. - *HOW* exactly I'm still not sure, but I hope someone more clued can help me figure it out! :)



-Kussic

Chris

unread,
Sep 27, 2010, 4:01:48 AM9/27/10
to London Hackspace
You should look at LUFA (http://www.fourwalledcubicle.com/LUFA.php),
which is a great framework library for writing USB device and host
firmware for the USB-enabled AVR micros (including the ATMEGA8U2). It
comes bundled with examples of many of the standard USB device types
(serial, keyboard, joystick, mouse, mass-storage etc). I've been using
it in various projects for several years. To load the code into your
chip you'll need the Atmel FLIP tool (http://www.atmel.com/dyn/
products/tools_card.asp?tool_id=3886) or similar.

I see two problems:

1) The 8U2 is pretty minimal; it has 8kbytes of flash, 4kbytes of
which will be used by the USB bootloader, which does not leave much
space for your stuff.
2) The 8U2 appears to replace the FTDI chip altogether, so your
firmware will need to perform that function in addition to whatever
USB stuff you have in mind, otherwise the link to the Arduino's main
ATMEGA328 will be broken.

If you're interested in USB development you may want to get a beefier
dedicated board like a Teensy (http://www.pjrc.com/teensy/), or I can
make you a Nanduino (http://www.makestuff.eu/wordpress/?page_id=569)
for £5 - £10.

Chris

Mike Harrison

unread,
Sep 27, 2010, 4:52:17 AM9/27/10
to london-h...@googlegroups.com
On Mon, 27 Sep 2010 01:01:48 -0700 (PDT), you wrote:

>You should look at LUFA (http://www.fourwalledcubicle.com/LUFA.php),
>which is a great framework library for writing USB device and host
>firmware for the USB-enabled AVR micros (including the ATMEGA8U2). It
>comes bundled with examples of many of the standard USB device types
>(serial, keyboard, joystick, mouse, mass-storage etc). I've been using
>it in various projects for several years. To load the code into your
>chip you'll need the Atmel FLIP tool (http://www.atmel.com/dyn/
>products/tools_card.asp?tool_id=3886) or similar.
>
>I see two problems:
>
>1) The 8U2 is pretty minimal; it has 8kbytes of flash, 4kbytes of
>which will be used by the USB bootloader, which does not leave much
>space for your stuff.
>2) The 8U2 appears to replace the FTDI chip altogether, so your
>firmware will need to perform that function in addition to whatever
>USB stuff you have in mind, otherwise the link to the Arduino's main
>ATMEGA328 will be broken.

"Your stuff" goes in the ATMega, not the 8U2.

Peter Knight

unread,
Sep 27, 2010, 5:01:23 AM9/27/10
to london-h...@googlegroups.com
For normal Arduino use, the 8U2 just acts as a USB serial interface, and the 328 holds the main code.

However, the 8U2 also has a DFU bootloader, so it can be reflashed easily over USB - or ISP cable. I'd expect libraries to appear that work with a reflashed 8U2 for supporting keyboard, mouse and midi. The tricky part is getting those libraries to be beginner friendly.

I wrote the bootloader on the Arduino Uno 328 chip (they now use Optiboot), and I assure you there will be much work on this.

Watch this space!

Chris

unread,
Sep 27, 2010, 5:11:23 AM9/27/10
to London Hackspace
> "Your stuff" goes in the ATMega, not the 8U2.

Not exactly. The 8U2 needs to be reprogrammed to enumerate as
something other than the default serial device (e.g a serial/keyboard
composite device). That cannot be achieved by just programming the 328.

Mike Harrison

unread,
Sep 27, 2010, 5:26:03 AM9/27/10
to london-h...@googlegroups.com

Yes, but that's all it needs to do, and there should be plenty of room for that, and the
communication with the mega328 for the actual functionality required

Kussic

unread,
Sep 27, 2010, 8:39:06 AM9/27/10
to london-h...@googlegroups.com
The teensy has a very friendly way of supporting keyboard, etc via teensduino. Have a look here: http://www.pjrc.com/teensy/td_keyboard.html

I wonder how difficult would it be to modify these libraries to work with the Uno or even say the Nanduino that was mentioned before.


-Kussic

Chris

unread,
Sep 27, 2010, 1:53:03 PM9/27/10
to London Hackspace
Teensyduino uses a closed-source bootloader called HalfKay[1]. Dean
reverse-engineered it and bundled it with LUFA as TeensyHID[2]. I have
no desire to use the ArduinoIDE so I have not tried it, but with this
TeensyHID bootloader firmware loaded, any AT90USB162 board (including
the Nanduino) should work with the Teensy loader and the Arduino IDE.
At the space we have the necessary equipment (PCB-making stuff and a
USBtinyISP[3]) to make your own Nanduino and load the TeensyHID
bootloader firmware into it.

Chris

[1] http://www.pjrc.com/teensy/halfkay_protocol.html
[2] http://elasticsheep.com/2010/01/installing-the-lufa-teensyhid-bootloader/
[3] http://www.ladyada.net/make/usbtinyisp/
Reply all
Reply to author
Forward
0 new messages