Custom firmware for LaunchPad for 32 outputs?

Hello,

During the off season, we are working on our drive station, and part of that is improving our operator interface. We’re moving from an eStop CCI joystick interface to the LaunchPad so we can get some indicators to echo control state back to the operator. (we do this with the dashboard too, but we’d like indicators close to the physical controls).

Given the number of GPIOs on the LaunchPad, there aren’t enough for all the controls+indicators we’d like, so we’ve been playing around with the LaunchPad firmware. The plan is to use 3 pins to shift out all the indicator bits via something like a MAX6969 and use the rest of the pins as button inputs.

The default firmware on the LaunchPad only supports 16b for indicators, so we’ve expanded that to 32b to match what the control system seems to be passing. However we can’t get the control software to pass more that 24b. When we set the output descriptor to 8b, 16b, or 24b it works and we get clean data all the way through. But when we expand it to 32b, the control system seems to pass no data.

We can live with 24b worth of indicators, but we’d like to understand where the limitation is, if for no other reason than to make sure we aren’t doing something that will bite us in the future (reliability issues, fragile to control system updates, etc).

Anybody else developed custom LaunchPad firmware?

I looked into doing custom firmware for this thing a while back, but was quickly discouraged by my lack of knowledge of USB protocol - the library documentation I found very much seemed to presume knowledge of how the USB stack worked, and I was in over my head and gave up.

What I do recall though is that when a HID device registers with the host machine, any application using it would have to know how to interact with it. There’s a component here that even if the USB stack allows for 32 bits, if the driver station doesn’t know how to populate a 32-bit field, behavior like you describe might happen?

I wish I had more concrete data to give you, but I feel like part of the solution may involve contacting NI to see what sorts of HID things are supported.

From previous time spent with the Arduino USB libraries, we have enough knowledge to be dangerous. But I agree that the LaunchPad firmware isn’t the best on-ramp to becoming a USB expert…

That matches our understanding as well. We’ve followed the call path through wpilib and it appears to be 32b clean down to FRC_NetworkCommunication_setJoystickOutputs() in the FRCComm layer.

I don’t believe source code has been published for the FRC layers or for the driver station, so we’re having to probe the behavior of those layers through experimentation. I was hoping somebody with more direct knowledge of this code might chime in and provide some guidance.

Thanks,
— Dean