View Single Post
  #34   Spotlight this post!  
Unread 19-01-2015, 21:45
ILAMtitan ILAMtitan is offline
Texas Instruments
AKA: Bart Basile
FRC #3005 (RoboChargers)
Team Role: Mentor
 
Join Date: Nov 2013
Rookie Year: 2013
Location: Dallas
Posts: 70
ILAMtitan will become famous soon enoughILAMtitan will become famous soon enough
Re: Using the TI LaunchPad from your KoP

I was able to finally spend some time tinkering with the LaunchPad co-processor for the GamePad (had business travel late last week), and I have it to a point where it's ready to go for those interested.

The first thing you need to do if you want to stack the LaunchPads like I did (and only if you stack them), is to update the hex files for the GamePad tool. The co-processor uses only pins 2 and 3 on J1 (full pinout available here: http://energia.nu/img/LaunchPadMSP430F5529.jpg), and these needed to be changed to high impedance in the GamePad so they don't interfere with the co-processor. I've uploaded new hex files to my personal git hub account to replace the existing ones: https://github.com/ILAMtitan/FRCGamePad_CoProcHex

Just replace these in the FRC GamePad Tool firmware folder as denoted in the readme, and then reflash your GamePad LaunchPad.

To program the second LaunchPad as the LED animation generator, you'll need to pick up Energia: http://energia.nu/

Run it once to generate the library folder in your Documents directory, akin to how the Arduino IDE works. Once the library folder is there, you can install the WS2811 Driver I wrote for Energia: https://github.com/ILAMtitan/WS2811Driver
The included readme should get you running correctly. I've made a handful of updates recently that will make it much more robust and easy to use, so feel free to use it for other LED projects as well if you feel so inclined.

The last bit of code is the actual co-processor code: https://github.com/ILAMtitan/GamePadCoProcessor
It's a simple sketch for Energia that will generate frames based on the input from the Option1 GamePad indicators. If you use a different option, you'll just have to change the relevant IO settings in the application.

The Energia sketch will generate frames one at a time, and only display them when a timer tells it to. This is a little bit different from many of the Arduino usages I've seen, but it doesn't use a wait statement which essentially holds the processor hostage. The code is reasonably well documented, so it shouldn't be too hard to figure out, just tricky. This method does let you cancel and change an animation between frames though.

Once both boards are programed, just plug em together, attach the LEDs (5V, GND, and Pin3 for the data), and then attach the USB cable to the LaunchPad that is the GamePad. Go ahead and attach any other buttons of indicators that you want to use in your OI as well. I've tested with with 60 LEDs on the USB port without extra power, but if you run into issues with power, you can use one of these: http://www.ti.com/tool/boostxl-battpack

The fuel tank will also let you run the LED strip without the DS being on, which is a nice bonus.

Let me know if you guys manage to try it out and how it works for you, and if you find any bugs.
Reply With Quote