Pages: [1]   Go Down
Author Topic: arduino2560 - can I use 16u2 USB protocol stack?  (Read 607 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an Arduino Mega 2560 that uses a 16U2 to do serial/USB translation between the 2560 and the host PC. Up to now, I’ve only used it to program the 2560.

I would like to use the 2560 to implement an HID (Joystick and some switches) that talks USB to a game on the host. Is there a way to setup (provide USB Descriptors to) and access the USB stack on the 16U2 from the 2560 without changing the 16U2’s firmware?
Logged

Florida
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Engineer at Jaycon Systems LLC
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nop, you will have to use the LUFA library to reprogram the 16u2. I don't think there is a way around that.
You would be better off with an Arduino Leonardo. It was designed to do things like that.

Jay
Logged

Jaycon Systems LLC
   Automate Your Life!

www.jayconsystems.com

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the response. I was afraid that was the answer.
Concerning LUFA, the little reading I've done makes me think that it must be used with an Atmel chip that had USB hardware. Is that true, or can I write a bit-banging driver for the low-level USB functions? If so, where would that fit in the LUFA framework?
Logged

Nice, France
Offline Offline
Full Member
***
Karma: 11
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The HIDUINO library should be suitable, if you decide to reprogram the 16U2 on your Mega2560.

Alternatively, I wonder if there is an add-on board that has a second 16U2 and a second USB socket. This could be flashed, and connected to one of the other three serial ports on the Mega2560. That way the original USB port would remain available for code upload and the additional USB port would be seen as a HID.
Logged

Pages: [1]   Go Up
Jump to: