|
Re: Driver Station Usb
[Explanation of USB device classes]
The USB specification contains several predefined "classes" of devices, each of which has a corresponding protocol of commands that are sent between the USB host (in this case the DS) and the USB device (the joystick). HID (Human Interface Device) is one such device class, CDC (Communication Device Class, the class most commonly used for USB-serial devices like FTDI chips) is another. These classes allow USB hosts to use generic drivers for devices that are connected to them, instead of requiring a driver for each specific device. The designers of the FIRST control system like this because it means that they only need one driver to be able to interface with almost every USB joystick (there are some exceptions, such as the Xbox controllers, which have been noted previously).
Because each device class has its own unique set of commands, a device that does not implement the HID class will not be able to work as a joystick. It will not be identified to the host as a HID device, and even if the host could be tricked somehow, the device would not know how to respond to the commands being sent. As a side note, the USB commands are also at a lower level than the serial data sent through a USB-serial device, which is itself encapsulated in USB data packets, so it's not simply a matter of sending the right serial data over a USB-serial device.
[What your microcontroller needs to do]
In order to be used as a USB HID device, your microcontroller will either have to be connected 1) to another chip that formats the data into the format of HID packets, such as maybe taking apart an old joystick and wiring the various buttons and potentiometers to digital and analog outputs, respectively, on your microcontroller, or 2) directly to the USB bus, such as in the AVR USB design.
[My recommendations]
I do not have any experience with AVR USB, and if they already have code that implements the right sections of the HID class, that could be a very viable method. However, I have made attempts before to implement USB on other devices, and while it is possible, it's not fun to wade through the specification documents. If you use a microcontroller with digital and analog outputs, another option instead of wiring it to an old joystick is to simply wire it into the exposed analog and digital input headers on the side of the DS. This is what most teams use when adding their own custom controls.
Good luck,
--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Last edited by RyanCahoon : 18-07-2009 at 07:19.
|