Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=177)
-   -   Using the TI LaunchPad from your KoP (http://www.chiefdelphi.com/forums/showthread.php?t=132061)

ILAMtitan 04-01-2015 13:46

Using the TI LaunchPad from your KoP
 
As many readers here at CD may know, Texas Instruments is a diamond level supplier to FIRST, but you haven’t seen our name in your KoP before. TI works hard in the background to supply the silicon that goes into the control systems components, but we wanted to put our technology directly into your hands this year. To this end, we've included a new MSP430 LaunchPad in every single KoP.

Now, you can go ahead and use it for whatever you like (plenty of examples and information avaliable here: http://www.ti.com/ww/en/launchpad/launchpad.html), but our flagship purpose for this year is as a custom operator interface for your driver’s station. A solution was developed by software engineers at TI so that all you have to do is flash the board, and it will show up as a USB HID Gamepad, ready for input. This has been fully tested and vetted by our best guys, so you know it won’t stop working in the middle of a match.

We also worked closely with NI to make sure that it’s as easy as possible for you to get started, and get some cool new features out of it. You may have already noticed the “Game Pad Tool” in your NI update. This is a dedicated application to make programming easy; just select your pinout and hit program, no additional downloads needed.

Our engineers also worked with NI to add digital outputs to the HID specification available to you via the driver station. You can now use the LaunchPad to set digital indicators or anything else you can think of, straight from the driver’s station using new WPILib API calls.

Since there is a limit to the number of pins available, we worked out three configurations that should have you guys covered:
  1. 8x analog, 11 digital inputs, and 11 digital outputs,
  2. 8x analog, 16 digital inputs, and 6 digital outputs,
  3. 8x analog, 20 digital inputs, and 2 digital outputs
Feel free to let us know if you want something else though.

For more information on the solution, with some fun examples of what you can do with a custom operator’s interface, check out our wiki page here: http://processors.wiki.ti.com/index....cs_Competition

In addition to our activity here on CD, we’ve also set up a dedicated FRC support hotline that will let you contact TI engineers directly at FRCSupport@list.ti.com. Everyone on this list is not only a TI engineer, but also a dedicated FRC mentor, so try not to send us too many emails during week 6 :)

We have a lot of other ideas for using the LaunchPad on your robots as well (an LED controller is at the top of our list) so keep an eye out for more examples to come!

billbo911 04-01-2015 14:12

Re: Using the TI LaunchPad from your KoP
 
FIRST off, thank you!

We on 2073 love to do custom controls, this will give us a FANTASTIC option to add to our bag if tricks.

Is there a way we can get a second, or even third, board? We often build multiple identical robots, and having two, or more, identical drivers stations would be an added bonus.

taichichuan 04-01-2015 14:52

Re: Using the TI LaunchPad from your KoP
 
Here at FRC 116, we implement custom OI controls for each of our robots over the past several years. We find that it's more effective to have a dedicated switch labeled "Deploy" than it is to try to remember which button on a joystick is mapped to the same feature. So, during the beta test cycle, the ability to create outputs ala LEDs was one of the many questions that got submitted.

Thank you for working with NI to make this happen.

Mike

ILAMtitan 04-01-2015 17:48

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by billbo911 (Post 1421089)
FIRST off, thank you!

We on 2073 love to do custom controls, this will give us a FANTASTIC option to add to our bag if tricks.

Is there a way we can get a second, or even third, board? We often build multiple identical robots, and having two, or more, identical drivers stations would be an added bonus.

The easiest option would probably be to get extras from the TI e-store ( https://store.ti.com/msp-exp430f5529lp.aspx ) since we have free shipping. Since the LaunchPad isn't a dedicated FIRST part, you can rest assured that we will not run out of stock. If you do have problems purchasing extras (we know how hard purchasing can be from a school account), feel free to drop me a PM or email our support list and we'll see what we can do.

taichichuan 05-01-2015 09:02

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1421277)
The easiest option would probably be to get extras from the TI e-store ( https://store.ti.com/msp-exp430f5529lp.aspx ) since we have free shipping. Since the LaunchPad isn't a dedicated FIRST part, you can rest assured that we will not run out of stock. If you do have problems purchasing extras (we know how hard purchasing can be from a school account), feel free to drop me a PM or email our support list and we'll see what we can do.

We've already got a couple more on order from the TI store. We're looking forward to getting some cool controls whipped up as soon as the build team figures out what we're controlling.

billbo911 05-01-2015 11:13

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1421277)
The easiest option would probably be to get extras from the TI e-store ( https://store.ti.com/msp-exp430f5529lp.aspx ) since we have free shipping. Since the LaunchPad isn't a dedicated FIRST part, you can rest assured that we will not run out of stock. If you do have problems purchasing extras (we know how hard purchasing can be from a school account), feel free to drop me a PM or email our support list and we'll see what we can do.

2 more ordered last night. 1 for our second DS, and one for ...... well...... me to play with.
Uhhhh, I mean, to experiment with so that we can get even better at utilizing it's possibilities. Yeah, that's my story and I'm sticking to it.

ILAMtitan 05-01-2015 14:08

Re: Using the TI LaunchPad from your KoP
 
Awesome to hear you guys are jumping right in!

I know it's robot season, so there isn't much time left over for personal tinkering, but the community over at 43oh is a really great resource for people starting out. You might want to check out their projects forum for some ideas on what the board can do.

taichichuan 05-01-2015 14:45

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1422057)
Awesome to hear you guys are jumping right in!

I know it's robot season, so there isn't much time left over for personal tinkering, but the community over at 43oh is a really great resource for people starting out. You might want to check out their projects forum for some ideas on what the board can do.

Personal time during build season? What's that? ;-). But, I will cruise over to the link and have a look. In the mean time, I'm trying to find info on the HID output features. Not much available in the docs so far. So, it looks like it's going to be interesting to noodle it out.

How can you tell the pioneers? They're the ones with the arrows in their backs. :yikes:

ILAMtitan 05-01-2015 15:25

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by taichichuan (Post 1422098)
Personal time during build season? What's that? ;-). But, I will cruise over to the link and have a look. In the mean time, I'm trying to find info on the HID output features. Not much available in the docs so far. So, it looks like it's going to be interesting to noodle it out.

How can you tell the pioneers? They're the ones with the arrows in their backs. :yikes:

What additional information are you looking for?

Currently, the output is just driving a pin high (3.3V) or low from the MSP430. Essentially, you can set it in WPILib, and it will get transferred to the HID device on the following USB poll cycle (every 20ms). I'll get my software cohort to elaborate a bit more for you guys on this.

The max a single pin can source is 10mA, and the device total is 100mA.

When I made the example panels on the wiki, I just used the indicator pins output to directly drive the LEDs. No problems so far.

wt200999 05-01-2015 15:39

Re: Using the TI LaunchPad from your KoP
 
1 Attachment(s)
Quote:

Originally Posted by taichichuan (Post 1422098)
In the mean time, I'm trying to find info on the HID output features. Not much available in the docs so far. So, it looks like it's going to be interesting to noodle it out.

On the robot side I have only had a chance to work with the LabVIEW WPILib API, but I assume it is similar in both Java and C++. The idea is you pass a boolean array to WPI_JoystickSetOutput.vi which is sent to the LaunchPad, which then sets/clears the appropriate indicator. See attached from the LabVIEW context help (you can ignore the rumble outputs).

If you load one of the three default firmware images it becomes straight forward to set/clear the indicator outputs using the API, which you can then use to drive an LED or other indicator.

In addition, we are working on the documentation for the source code provided on our github page, beyond what is commented in the code (including setup instructions). So if you want to do something else with the output data outside of what the 3 preconfigured binaries provide, you can.

Joe Ross 05-01-2015 15:47

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by taichichuan (Post 1422098)
In the mean time, I'm trying to find info on the HID output features. Not much available in the docs so far.:

Look in the Joystick class, SetOutput and SetOutputs.

taichichuan 05-01-2015 15:56

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by Joe Ross (Post 1422137)
Look in the Joystick class, SetOutput and SetOutputs.

Thanks! I'll take a look at that.

sanddrag 05-01-2015 16:09

Re: Using the TI LaunchPad from your KoP
 
Thank you TI! As the lead mentor of a team who experienced losing a match in the elimination rounds due to a different product with a similar function flaking out on us, I am very glad to see this change. Having a well-vetted board for custom driver station inputs included in the KOP is something I mentioned for briefly to one of the FIRST personnel at the event and he put it in his notes, and it's something I mentioned for again in the end-of-season survey.

I'm not sure if others lobbied for this to happen, but I feel like my detailed suggestions to FIRST on the matter were given very serious and detailed consideration, and FIRST and TI acted on those suggestions.

It's nice to feel as if I've influenced positive changes in FIRST on a global scale.

Thank you FIRST and TI!

billbo911 08-01-2015 10:12

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1421065)
As many readers here at CD may know, Texas Instruments is a diamond level supplier to FIRST, but you haven’t seen our name in your KoP before. TI works hard in the background to supply the silicon that goes into the control systems components, but we wanted to put our technology directly into your hands this year. To this end, we've included a new MSP430 LaunchPad in every single KoP.

Now, you can go ahead and use it for whatever you like (plenty of examples and information avaliable here: http://www.ti.com/ww/en/launchpad/launchpad.html), but our flagship purpose for this year is as a custom operator interface for your driver’s station. A solution was developed by software engineers at TI so that all you have to do is flash the board, and it will show up as a USB HID Gamepad, ready for input. This has been fully tested and vetted by our best guys, so you know it won’t stop working in the middle of a match.

We also worked closely with NI to make sure that it’s as easy as possible for you to get started, and get some cool new features out of it. You may have already noticed the “Game Pad Tool” in your NI update. This is a dedicated application to make programming easy; just select your pinout and hit program, no additional downloads needed.

Our engineers also worked with NI to add digital outputs to the HID specification available to you via the driver station. You can now use the LaunchPad to set digital indicators or anything else you can think of, straight from the driver’s station using new WPILib API calls.

Since there is a limit to the number of pins available, we worked out three configurations that should have you guys covered:
  1. 8x analog, 11 digital inputs, and 11 digital outputs,
  2. 8x analog, 16 digital inputs, and 6 digital outputs,
  3. 8x analog, 20 digital inputs, and 2 digital outputs
Feel free to let us know if you want something else though.

For more information on the solution, with some fun examples of what you can do with a custom operator’s interface, check out our wiki page here: http://processors.wiki.ti.com/index....cs_Competition

In addition to our activity here on CD, we’ve also set up a dedicated FRC support hotline that will let you contact TI engineers directly at FRCSupport@list.ti.com. Everyone on this list is not only a TI engineer, but also a dedicated FRC mentor, so try not to send us too many emails during week 6 :)

We have a lot of other ideas for using the LaunchPad on your robots as well (an LED controller is at the top of our list) so keep an eye out for more examples to come!

Thanks Bart!

I received my two extra boards yesterday. It was very simple to follow the instructions at http://processors.wiki.ti.com/index....cs_Competition to get the board configured as a Gamepad.

Once I verified the DS saw it as a controller, I wanted to explore the code behind the magic, maybe even edit it.

I was able to get Energia installed, but now I see that it does not support USB HID devices.

Code Composer Studio looks to be the best alternative. What I would like to know is, it looks like the free use license for use with this model of the LaunchPad has a 16K code size limit. Is this a realistic size for the code we are currently using? Additionally, what folder(s) on the Github contain the example Gamepad projects?

wt200999 08-01-2015 12:22

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by billbo911 (Post 1424243)
I was able to get Energia installed, but now I see that it does not support USB HID devices.

Energia support for this is something we tried to push for, and would love to see in the future. It just wasn't going to happen for this release.

Quote:

Originally Posted by billbo911 (Post 1424243)
Code Composer Studio looks to be the best alternative. What I would like to know is, it looks like the free use license for use with this model of the LaunchPad has a 16K code size limit. Is this a realistic size for the code we are currently using?

The gamepad code comes out to be around 10K, so it is cutting it close, but it should not be a problem for most modifications.

Quote:

Originally Posted by billbo911 (Post 1424243)
Additionally, what folder(s) on the Github contain the example Gamepad projects?

The root folder is the whole project, the three different options are selected based on build properties in CCS. The important files are the source files in the root, and the files in the USB_config and USB_app folders.

CCS is Eclipse based and needs a workspace set up before importing projects. To set up CCS to work on the project, clone the MSP430-Gamepad repo into your workspace folder. From there you should be able to import and run the code.

I will be posting more detailed documentation soon.

billbo911 08-01-2015 13:01

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by wt200999 (Post 1424302)
Energia support for this is something we tried to push for, and would love to see in the future. It just wasn't going to happen for this release.



The gamepad code comes out to be around 10K, so it is cutting it close, but it should not be a problem for most modifications.



The root folder is the whole project, the three different options are selected based on build properties in CCS. The important files are the source files in the root, and the files in the USB_config and USB_app folders.

CCS is Eclipse based and needs a workspace set up before importing projects. To set up CCS to work on the project, clone the MSP430-Gamepad repo into your workspace folder. From there you should be able to import and run the code.

I will be posting more detailed documentation soon.

Thanks Will.

The priority to modify the three existing options is actually fairly low, at least for this season. The modifications I was considering adding can be easily achieved by simply adding a small arduino to the DS in addition to the LaunchPad.
I was hoping to add the ability to run a fairly long set of addressable LEDs in the DS. By simply jumpering a few of the Digital Indicator lines to the Arduino, we can get all kinds of really nice lighting effects.

I'll stay on the lookout for more information on how to work with the LaunchPad. Honestly, Energia is a good start, but it really needs to be able to handle working with the LaunchPad as a USB HID device, just as the Teensyduino Plugin does for Arduino and the Teensy board(s).

ILAMtitan 08-01-2015 14:16

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by billbo911 (Post 1424327)
Thanks Will.

The priority to modify the three existing options is actually fairly low, at least for this season. The modifications I was considering adding can be easily achieved by simply adding a small arduino to the DS in addition to the LaunchPad.
I was hoping to add the ability to run a fairly long set of addressable LEDs in the DS. By simply jumpering a few of the Digital Indicator lines to the Arduino, we can get all kinds of really nice lighting effects.

I'll stay on the lookout for more information on how to work with the LaunchPad. Honestly, Energia is a good start, but it really needs to be able to handle working with the LaunchPad as a USB HID device, just as the Teensyduino Plugin does for Arduino and the Teensy board(s).

I'm actually working on a way to add LEDs into OI panels elegantly. I wrote an Energia library to use the WS28xx LEDs a few months ago for another project, and it ports into CCS just fine. The technical issue is getting it to exist concurrently with the USB Library. While that's obviously the dream option at this point, the co-processor solution you brought up will work fine.

The plan now is to have a second LP, with some static animations built in. Then you can either use a back channel serial over USB link to tell it which to run, or the indicator outputs from the first LaunchPad can connect as inputs on the second LP to map as specific animations. The second option would reduce the software complexity from the drivers station, but both can exist at the same time to simplify loading firmware.

Since you're blazing the trail here, I'd love to hear any feedback you might have.

billbo911 08-01-2015 16:48

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1424373)
I'm actually working on a way to add LEDs into OI panels elegantly. I wrote an Energia library to use the WS28xx LEDs a few months ago for another project, and it ports into CCS just fine. The technical issue is getting it to exist concurrently with the USB Library. While that's obviously the dream option at this point, the co-processor solution you brought up will work fine.

The plan now is to have a second LP, with some static animations built in. Then ..... the first LaunchPad can map to specific animations. The second option would reduce the software complexity from the drivers station, but both can exist at the same time to simplify loading firmware.

Since you're blazing the trail here, I'd love to hear any feedback you might have.

It sounds like you are talking about the exact same thing I was going to try to pull off. I am NOT a coding Guru, but just a decent Hack.

The second option you mentioned above is exactly what we will be doing except the second processor will be an Arduino, cuz I have that working already and know how to make it dance!

robert1356 11-01-2015 13:15

Re: Using the TI LaunchPad from your KoP
 
I set up the LaunchPad using my Mac OS X computer running Windows 8.1 under Parallels. When it tried to update the debugger on the first program attempt, it failed and quit seeing the LaunchPad. I worked with TI to get it fixed and it turns out it's quite simple, see this post, you can fix it from the command line in your Windows guest OS: http://www.chiefdelphi.com/forums/sh...ight=launchpad

One possible way to prevent it in the first place is to hold down the ALT key when selecting that you want your guest OS to use the USB device (LaunchPad) so that Parallels will remember the choice. That may allow it to reconnect to the Windows machine quick enough to not fail in the first place.

ILAMtitan 11-01-2015 14:08

Re: Using the TI LaunchPad from your KoP
 
Robert thanks for sharing your experience!

We don't have many (if any) Macs here at TI to test on, so it's great to hear that it works, even if there are a few gotcha's.

feverittm 13-01-2015 13:12

Re: Using the TI LaunchPad from your KoP
 
I have been noting that some teams are thinking of connecting 'smart' led strings to their launchpad that is on their driver's station.

I thought that the current requirements of the WSxxxx type of addressable LED strings was much too high to connect to the regulator output from the launchpad (is the serial input on the leds 3.3V compatible?) or even USB power connections.

What are people thinking of using to provide power to these devices? Are you considering a second power plug (like a wall wart) to supply the additional current?

Thanks

Floyd Moore

billbo911 13-01-2015 14:38

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by feverittm (Post 1427390)
I have been noting that some teams are thinking of connecting 'smart' led strings to their launchpad that is on their driver's station.

I thought that the current requirements of the WSxxxx type of addressable LED strings was much too high to connect to the regulator output from the launchpad (is the serial input on the leds 3.3V compatible?) or even USB power connections.

What are people thinking of using to provide power to these devices? Are you considering a second power plug (like a wall wart) to supply the additional current?

Thanks

Floyd Moore

So, the current plan is to actually control an addressable string of LEDs with an Arduino. The Arduino will be interfaced to a couple of the Digital outputs on the LaunchPad to know what pattern to display. The Arduino and the LEDs will get their power from a LiPo battery through a UBEC. That way, if the LiPo is not there, or too low, the LEDs just won't work, but the rest of the DS will function normally.

ILAMtitan 13-01-2015 22:55

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by feverittm (Post 1427390)
I have been noting that some teams are thinking of connecting 'smart' led strings to their launchpad that is on their driver's station.

I thought that the current requirements of the WSxxxx type of addressable LED strings was much too high to connect to the regulator output from the launchpad (is the serial input on the leds 3.3V compatible?) or even USB power connections.

What are people thinking of using to provide power to these devices? Are you considering a second power plug (like a wall wart) to supply the additional current?

Thanks

Floyd Moore


Floyd, you're sort of right about the current limitation. The 3.3V rail of the LaunchPad is limited to what the DC/DC converter is capable of putting out. However, the 5V rail is directly connected to the USB output, and able to source 500mA. The SmartLEDs, like the WS2811 and WS2812, actually work better with a 5V source, and still run fine with the 3.3V digital serial output of the MSP430. The 500mA limit is problematic however, and running the LEDs off it can cause the host port to crash and resets of the MCU. It "works". Using a wall wart or other DC power supply is just fine if you connect the ground to the LaunchPad, and will enable you to source more current.

However, the LaunchPad is only capiable of running the SmartLEDs or the USB HID application, not both since they are both so timing critical dependent (I'm working on it though). If you're interested in just running LEDs, I've already made an Energia (http://energia.nu/) library for the LaunchPad to run the SmartLED strips. It emulates the AdaFruit NeoPixel library, and any Arduino code you already have for it should be 90% compatible with the LaunchPad via Energia. You can pick it up off my GITHub if you want to try it: https://github.com/ILAMtitan/WS2811Driver I'll be the first to admit it needs a readme, but it works just like the Arduino ones out there. If you need any support getting it running, just let me know.


Quote:

Originally Posted by billbo911 (Post 1427454)
So, the current plan is to actually control an addressable string of LEDs with an Arduino. The Arduino will be interfaced to a couple of the Digital outputs on the LaunchPad to know what pattern to display. The Arduino and the LEDs will get their power from a LiPo battery through a UBEC. That way, if the LiPo is not there, or too low, the LEDs just won't work, but the rest of the DS will function normally.

Since I want to do the same thing, I've kinda cobbled together a solution that I think works pretty well. I used a second LaunchPad to run the LED co-processor, which works well since they stack perfectly.



The middle board in the shot is the GamePad HID device using Option 1 from the utility. The top LaunchPad runs some code I wrote in Energia to read indicator pins 1-4 from the GamePad as a parallel input, and trigger prewritten animations based on the input code. All of the pins are set to HighZ otherwise, so they don't interfere with any of the GamePad functions. I ran some basic tests using an interface we wrote for the HID device testing, and the idea seems to work so far: https://www.youtube.com/watch?v=aLWZ5FOrozE

I also picked up the Fuel Tank Boosterpack I mentioned earlier to supply additional power, and enable the LEDs when it's unplugged: http://www.ti.com/tool/boostxl-battpack

There are a few caveats that I'm still working out (ie, it's super buggy still and very proof of concept), but I can post more info if you guys are interested.

feverittm 14-01-2015 17:26

Re: Using the TI LaunchPad from your KoP
 
This looks really good. Please keep us informed on your progress.

Floyd Moore

ayeckley 14-01-2015 20:46

Re: Using the TI LaunchPad from your KoP
 
Is there a recommended approach for using the LaunchPad to interface with a quadrature encoder? We're trying to replicate the capability that the Cypress PSoC offered in previous years via the Enhanced I/O interface on the Driver Station, but we're still pretty low on the learning curve re: how we could use the HID protocol (is that even the right terminology?) to duplicate or at least mimic it.

Ideally we'd like to pass the [signed, 16 bit] tick count from the encoder to the roboRIO and do all related processing there. We're a LabVIEW team.

Edit: OK, I've spent a few hours rolling around in the source code and I think I've found an approach that will work. It looks likes the struct for the button data could be modified so that 16 bits could still be used for button status and the remaining 16 bits can be used for the encoder data. HID appears to offer 8x16bits for "user data" as well, but its not clear if the DS forwards that to the roboRIO or not so that won't be our primary approach. If we get it working then I'll provide an update.

wt200999 15-01-2015 00:06

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ayeckley (Post 1428413)
Ideally we'd like to pass the [signed, 16 bit] tick count from the encoder to the roboRIO and do all related processing there. We're a LabVIEW team.

Edit: OK, I've spent a few hours rolling around in the source code and I think I've found an approach that will work. It looks likes the struct for the button data could be modified so that 16 bits could still be used for button status and the remaining 16 bits can be used for the encoder data. HID appears to offer 8x16bits for "user data" as well, but its not clear if the DS forwards that to the roboRIO or not so that won't be our primary approach. If we get it working then I'll provide an update.

It depends on how the HID descriptor is defined and how the software utilizes it. On the LaunchPad we are sending 8 16-bit joystick inputs coming from the ADC for the axes, and up to 32 bits for buttons (though the default options give 11 16 or 20). You could use any of these to send the data, though you have to be mindful of how Windows and the driver station use the data.

The easiest way forward would be to use half the button data as you suggested. Each button is just one bit, and fairly easy to decode on the robot.

When Windows gets the joystick data, it plays with it a little, and stores calibration data somewhere in the registry. This is why we include a section on the wiki for calibrating your inputs, and if you are using analog it is quite convenient.

The following description here is based on my experimentation with the calibration and with LabVIEW (and the driver station's) input dll.

In the Windows calibration tool you can view the exact output that you send from the LaunchPad, and during this calibration Windows asks for a minimum, center and maximum value. From here it seems to scale it for the rest of the system. So in LabVIEW if I probe the wires from the dll call, no matter what the actual data is that I send from the LaunchPad, I get a range from -32767 to +32767 based on the range I calibrated. Anything outside of the calibrated range just saturates.

Lastly, when the driver station gets this data, each axis is converted to 8-bit and sent to the robot, and is then normalized to the -1 to 1 range.

So you certainly could send data this way, you would just need 2 'axes' for the 16 bits and have the LaunchPad send it as 8 bits. Then you would need to make sure Windows recognizes the range for the 2 axis. Finally on the robot you would need to convert back to the 8-bit data and repack the 2 axes.

Quote:

Originally Posted by ayeckley (Post 1428413)
Is there a recommended approach for using the LaunchPad to interface with a quadrature encoder? We're trying to replicate the capability that the Cypress PSoC offered in previous years via the Enhanced I/O interface on the Driver Station, but we're still pretty low on the learning curve re: how we could use the HID protocol (is that even the right terminology?) to duplicate or at least mimic it.

I'm curious to learn a little more about your application from past years. I also was reading what you had posted in the Cypress thread. Do you have any pictures or examples of how you used this previously?

For your application, what encoder did you use? The LaunchPad is certainly capable of interfacing with an encoder, it just needs to be able to do that and send the USB packets out. An interrupt based solution would probably work well for you. We are happy to help support your team with this.

Also have you considered using an absolute encoder, something that maybe uses I2C or SPI?

ayeckley 15-01-2015 10:36

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by wt200999 (Post 1428539)
I'm curious to learn a little more about your application from past years. I also was reading what you had posted in the Cypress thread. Do you have any pictures or examples of how you used this previously?

I'm searching for pictures of last year's DS now. I'll update if I'm able to track them down. Last year we used it for fine-tuning of our shooter angles, as well as for gross movements of the shooter when the desired position didn't correspond to the five presets we had established. When the target angle was achieved, an LED adjacent to the corresponding preset button would illuminate in case the operator didn't have a clear view of the robot. We used almost all of the discrete inputs and outputs of the Cypress PSoC. People complained about the reliability of it, but it never gave us a lick of trouble.

On the robot side, the shooter angle control was implemented via a closed-loop system using a Bournes pot for feedback. Since we only had a ~180 degree range of motion we didn't have to deal with the rollover issue I described in the other thread.

Quote:

For your application, what encoder did you use? The LaunchPad is certainly capable of interfacing with an encoder, it just needs to be able to do that and send the USB packets out.
We use FANUC pulse generators recycled from CNC equipment which have gone to That Great Pile of Chips in the Sky. They have a knob that is very human-factor friendly -- about the size of the average palm and with micro-detents that provide an intuitive feedback to the operator -- and are very robust since they are designed for industrial use. The drawback this year (aside from what we've already discussed) is that are intended to operate at 5V; I'm going to be running a test later this morning to see if 3.3V is sufficient. If not then we'll have to build some simple level-translation circuitry since the LaunchPad is [so I'm told] not 5V tolerant on the inputs.

Quote:

An interrupt based solution would probably work well for you. We are happy to help support your team with this.
Thanks for your support. Happily, I've been using MSP430 (off and on) for about 13 years now so I'm pretty comfortable with the hardware side of things. We may get into trouble with the software side but we were able to get the default code to compile using CCS last night which is a very positive first step. I see that the polling interval is 10ms, so I think we'll approach it from that angle first and then may fall back on an interrupt approach if need be. The kids are going to get a lot more exposure to embedded microcontrollers than we were anticipating.

Quote:

Originally Posted by wt200999 (Post 1428539)
Also have you considered using an absolute encoder, something that maybe uses I2C or SPI?

I guess we've lightly considered it, but haven't encountered a situation yet where we felt we couldn't achieve what we wanted using a relative encoder. Another one of our lessons-learned over the years is that the Drive Team will sometimes forget to put the DS in its required starting configuration. For that reason, one of our standard design practices is to have the robot only have relative control response. In other words, if nobody turns the knob at the start of Teleop then the robot stays in whatever state it was in at the end of Autonomous. If we used an absolute encoder and accidentally set it to the "wrong" position going into Teleop, then it could/would do something unintended at the start of the match and we'd have to spend time and energy recovering from it. It's a minor point, obviously, but we do try to squeeze as much performance out of things as we can.

ayeckley 16-01-2015 12:16

Re: Using the TI LaunchPad from your KoP
 
Update:

We've verified that the FANUC pulse generator will work tolerably well using a 3.3VDC supply, although the output pulse train may be cutting it a bit close to the LVTTL threshold for input logic "high". More on that later.

We've succeeded in modifying the default LaunchPad-FRC software and inserting our encoder data into the HID data stream to the DS (and on to the robot). We discovered that the Read Joystick.vi automatically scales the button array size to the number of button bits received, which is a pleasant surprise since we were expecting to have to create a custom VI to do that for us. We're using the upper 16 bits of the button datatype for encoder values (allowing us to make 120+ full knob rotations in either direction before overflow occurs), and keeping the bottom 16 for actual button inputs or LED (etc.) outputs. We simply split the Button array output from the Read Joystick.vi in half and treat those upper bits as a signed 16-bit integer.

What we're currently having challenges with is "missing" ticks. The way things are implemented right now, we're not detecting about 30% of the encoder ticks that we are providing. It does seem to be rate-sensitive (proportionally more ticks are lost the faster the knob is turned). We've determined that the likely cause is due to use of a polled-input approach. The default code for the Launchpad-FRC polls at 10ms, but at a realistic knob-turning rate the rising edges of the ticks from Phase A can occur at ~5ms apart. Anyone see a problem there? By switching to an interrupt-based approach and a reasonably tightly-coded ISR we expect to resolve the issue [hopefully] without screwing up the interrupts used in the serial communications process. We considered simply increasing the speed of the polling loop, but since that would require a 4X increase in the rate we decided that the risk of unintended side-effects (such as screwing up the settling times of the ADC inputs) makes that a less-attractive option (for now). Who knows, we may just jack up the polling rate and see what happens; it's easy enough to undo.

Although the waveform is still a nicely shaped pulse train when using 3.3V to power the pulse generator, the output logic "high" from the pulse generator can be as low as 2V under some conditions, which is right on the hairy edge of the EIA-published standard for input logic high (don't have the MSP430 datasheet handy to see if it differs from the standard or not). We may need to add some circuitry to bring logic high closer to the power supply rail. Once we switch to the interrupt-based approach we should know if this will be important enough to worry about or not.

Thanks to anyone following along...

billbo911 16-01-2015 13:42

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ayeckley (Post 1429201)
Update:

We've verified that the FANUC pulse generator will work tolerably well using a 3.3VDC supply, although the output pulse train may be cutting it a bit close to the LVTTL threshold for input logic "high". More on that later.

We've succeeded in modifying the default LaunchPad-FRC software and inserting our encoder data into the HID data stream to the DS (and on to the robot). We discovered that the Read Joystick.vi automatically scales the button array size to the number of button bits received, which is a pleasant surprise since we were expecting to have to create a custom VI to do that for us. We're using the upper 16 bits of the button datatype for encoder values (allowing us to make 120+ full knob rotations in either direction before overflow occurs), and keeping the bottom 16 for actual button inputs or LED (etc.) outputs. We simply split the Button array output from the Read Joystick.vi in half and treat those upper bits as a signed 16-bit integer.

What we're currently having challenges with is "missing" ticks. The way things are implemented right now, we're not detecting about 30% of the encoder ticks that we are providing. It does seem to be rate-sensitive (proportionally more ticks are lost the faster the knob is turned). We've determined that the likely cause is due to use of a polled-input approach. The default code for the Launchpad-FRC polls at 10ms, but at a realistic knob-turning rate the rising edges of the ticks from Phase A can occur at ~5ms apart. Anyone see a problem there? By switching to an interrupt-based approach and a reasonably tightly-coded ISR we expect to resolve the issue [hopefully] without screwing up the interrupts used in the serial communications process. We considered simply increasing the speed of the polling loop, but since that would require a 4X increase in the rate we decided that the risk of unintended side-effects (such as screwing up the settling times of the ADC inputs) makes that a less-attractive option (for now). Who knows, we may just jack up the polling rate and see what happens; it's easy enough to undo.

Although the waveform is still a nicely shaped pulse train when using 3.3V to power the pulse generator, the output logic "high" from the pulse generator can be as low as 2V under some conditions, which is right on the hairy edge of the EIA-published standard for input logic high (don't have the MSP430 datasheet handy to see if it differs from the standard or not). We may need to add some circuitry to bring logic high closer to the power supply rail. Once we switch to the interrupt-based approach we should know if this will be important enough to worry about or not.

Thanks to anyone following along...

Thanks for working on this!

Honestly, I think doing this under interrupt control will work out just fine. Please let us know what you find out, both good and bad.

jhersh 16-01-2015 14:14

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ayeckley (Post 1429201)
We've determined that the likely cause is due to use of a polled-input approach. The default code for the Launchpad-FRC polls at 10ms, but at a realistic knob-turning rate the rising edges of the ticks from Phase A can occur at ~5ms apart. Anyone see a problem there? By switching to an interrupt-based approach and a reasonably tightly-coded ISR we expect to resolve the issue [hopefully] without screwing up the interrupts used in the serial communications process.

If you only decode in 1X mode (rising edge on A only) then you have 1/4 the interrupts to process. Seems pretty doable. Polled input had better have plenty of headroom to be reliable, but you've already discovered that.

ayeckley 16-01-2015 14:53

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by jhersh (Post 1429266)
If you only decode in 1X mode (rising edge on A only) then you have 1/4 the interrupts to process.

That was the plan. The detents are located at each 1/100th of rotation (same as the tick resolution), so we would never be able to capitalize on the added resolution that 2X or 4X would bring. I suppose if we cared about angular rates then 2X or 4X might be helpful, but for our current application we don't care about that.

ILAMtitan 17-01-2015 20:31

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ayeckley (Post 1429302)
That was the plan. The detents are located at each 1/100th of rotation (same as the tick resolution), so we would never be able to capitalize on the added resolution that 2X or 4X would bring. I suppose if we cared about angular rates then 2X or 4X might be helpful, but for our current application we don't care about that.

What implementation did you use to read the encoder? The ones I've seen use a very short interrupt, and should have any issues with missed ISRs.

Any chance you can share your code or modifications? I should be able to run some timing analysis to see why you're missing counts, and run it by our USB expert when I'm back in the office on Monday.

ayeckley 18-01-2015 08:31

Re: Using the TI LaunchPad from your KoP
 
To clarify, we haven't switched to the interrupt approach yet. That's just the eventual plan once we work through some higher-priority problems not related to the driver station. For now we've got our encoder working well enough to compete with if we really had to. We can share the source code but I have to travel for work so it might be a couple of days before I can post it. The students are generally reluctant to post on C-D.

Also, I see now that I was mistaken about the 10ms polling rate. The ADC conversions are done every 10ms, but there doesn't appear to be anything super-obvious that is throttling the polling loop (other than the time required to execute the ADC ISR). Shutting down that interrupt didn't improve the polled performance, which was a little counter-intuitive.

ILAMtitan 19-01-2015 21:45

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.

billbo911 27-01-2015 23:28

Re: Using the TI LaunchPad from your KoP
 
Is there a chance there is a CAD file for this board. I know it's a minor part, but having accurate measurements would be nice.
I started to create one, but found hole spacing to not be ANSI Standard, so I decided to see if I ac find an official drawing before I spend the few minutes it will take to create it myself.

ILAMtitan 28-01-2015 09:43

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by billbo911 (Post 1435044)
Is there a chance there is a CAD file for this board. I know it's a minor part, but having accurate measurements would be nice.
I started to create one, but found hole spacing to not be ANSI Standard, so I decided to see if I ac find an official drawing before I spend the few minutes it will take to create it myself.

I created a dimensioned drawing from the PCB layout for you guys to use. You can get it here for now: https://txn.box.com/s/iid65s2kh6e1qrde1hoea7o2ify1g0u1

I don't do much formal CAD work, but all the relevant information should be there. I'll run it by some of the people on our team who are better at making these kinds of drawings and get a more formal one up on the wiki later.

If you're familiar with EagleCAD, you can grab the full hardware design package from here as well: http://www.ti.com/tool/MSP-EXP430F5529LP

billbo911 28-01-2015 09:55

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1435128)
I created a dimensioned drawing from the PCB layout for you guys to use. You can get it here for now: https://txn.box.com/s/iid65s2kh6e1qrde1hoea7o2ify1g0u1

I don't do much formal CAD work, but all the relevant information should be there. I'll run it by some of the people on our team who are better at making these kinds of drawings and get a more formal one up on the wiki later.

If you're familiar with EagleCAD, you can grab the full hardware design package from here as well: http://www.ti.com/tool/MSP-EXP430F5529LP

Thanks Bart!
I can do a little math based on that PDF and get the details I need.
I'm still learning SolidWorks 2014, but I'm certain I can create what I need now. I'm looking forward to what your team creates so I can do a little self critique based on other's work.

mplanchard 30-01-2015 20:39

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1435128)
I created a dimensioned drawing from the PCB layout for you guys to use. You can get it here for now: https://txn.box.com/s/iid65s2kh6e1qrde1hoea7o2ify1g0u1

I don't do much formal CAD work, but all the relevant information should be there. I'll run it by some of the people on our team who are better at making these kinds of drawings and get a more formal one up on the wiki later.

If you're familiar with EagleCAD, you can grab the full hardware design package from here as well: http://www.ti.com/tool/MSP-EXP430F5529LP

Do you have and IDF or PADS file? I can bring it into CircuitWorks and get the 3D board. Marie

ILAMtitan 30-01-2015 21:13

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by mplanchard (Post 1436369)
Do you have and IDF or PADS file? I can bring it into CircuitWorks and get the 3D board. Marie

I had to import it into Altium, and then export the IDF file, but you can find it here: https://txn.box.com/s/syur2lhypaihegkm2rfupxi2h0f11ufr

I was also able to export the STEP file from Altium, but I know those aren't always preferred due to file size and other restrictions. I've uploaded here for any interested parties though: https://txn.box.com/s/c0b11817xbyn6nxorrejz9728f1bublo

Since both of these are both via Altium, I can't guarantee the accuracy. If anyone can validate them, please let me know.

billbo911 01-02-2015 09:58

Re: Using the TI LaunchPad from your KoP
 
Please forgive me if this has been covered, but using my phone to search CD is rather difficult and I couldn't find it.
We have a driver's station setup with the Launchpad, that uses 18 buttons. Therefore, we have the Launchpad in mode 3. The problem is, we cannot see all of the buttons indicated on the driver's station. Is there a way to extend the driver station to display all 20 buttons as they are activated?

Alan Anderson 01-02-2015 10:46

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by billbo911 (Post 1436896)
Is there a way to extend the driver station to display all 20 buttons as they are activated?

The Driver Station program can not be modified by teams. However, you can change the Dashboard in any way you like.

ayeckley 01-02-2015 10:58

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by billbo911 (Post 1436896)
Is there a way to extend the driver station to display all 20 buttons as they are activated?

I've not found a way to manually change the number of buttons displayed but I did find that the Driver Station seemed to automatically expand to the active number of inputs based on the size of the data stream received from the LaunchPad. Perhaps there is some upper limit to the number of inputs it can expand to? Perhaps its behavior is dependent upon the screen size and resolution? Alas, none of this seems to be documented anywhere.

As Alan alluded to, your team may need to create a custom Dashboard to achieve what you are looking for.

billbo911 01-02-2015 11:17

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ayeckley (Post 1436918)
I've not found a way to manually change the number of buttons displayed but I did find that the Driver Station seemed to automatically expand to the active number of inputs based on the size of the data stream received from the LaunchPad. Perhaps there is some upper limit to the number of inputs it can expand to? Perhaps its behavior is dependent upon the screen size and resolution? Alas, none of this seems to be documented anywhere.

As Alan alluded to, your team may need to create a custom Dashboard to achieve what you are looking for.

Quote:

Originally Posted by Alan Anderson (Post 1436912)
The Driver Station program can not be modified by teams. However, you can change the Dashboard in any way you like.

Thanks guys!
We have no intent on modifying the drivers station code. In fact, even seeing the buttons active on the driver station is not necessary. The biggest concern is that the RoboRio can read those inputs and respond accordingly.
We will work with our programmers to verify that their code can detect the button presses, and respond accordingly.

Joe Ross 01-02-2015 13:11

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by billbo911 (Post 1436920)
Thanks guys!
We have no intent on modifying the drivers station code. In fact, even seeing the buttons active on the driver station is not necessary. The biggest concern is that the RoboRio can read those inputs and respond accordingly.
We will work with our programmers to verify that their code can detect the button presses, and respond accordingly.

We noticed this yesterday also. Our java code responded to all 20 buttons, however. We filed a low priority bug against the driver station: https://usfirst.collab.net/sf/go/artf4002

billbo911 01-02-2015 13:20

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by Joe Ross (Post 1436965)
We noticed this yesterday also. Our java code responded to all 20 buttons, however. We filed a low priority bug against the driver station: https://usfirst.collab.net/sf/go/artf4002

This is exactly what I was hoping to find as well! Thanks Joe for confirming what I had suspected.

mplanchard 04-02-2015 10:35

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1436381)
I had to import it into Altium, and then export the IDF file, but you can find it here: https://txn.box.com/s/syur2lhypaihegkm2rfupxi2h0f11ufr

I was also able to export the STEP file from Altium, but I know those aren't always preferred due to file size and other restrictions. I've uploaded here for any interested parties though: https://txn.box.com/s/c0b11817xbyn6nxorrejz9728f1bublo

Since both of these are both via Altium, I can't guarantee the accuracy. If anyone can validate them, please let me know.

I will contact you through a private message - we are working with Altium and other formats. Have a few questions trying to get this into CircuitWorks. Marie

ayeckley 08-02-2015 18:29

Re: Using the TI LaunchPad from your KoP
 
We've been able to return to this issue now that some of our more pressing problems have been resolved. In summary, we have successfully implemented an interrupt-based quadrature encoder that restores that aspect of now-discontinued Enhanced I/O features of the Driver Station.

Whitepaper located here:

http://www.chiefdelphi.com/media/papers/3097

ILAMtitan 10-02-2015 09:30

Re: Using the TI LaunchPad from your KoP
 
This is really awesome work!
That's a really lightweight ISR for the encoder, and shouldn't cause any problems with the USB stack.

ayeckley 10-02-2015 09:56

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1441175)
shouldn't cause any problems with the USB stack.

Thanks, but now that I think of it we probably should have cleared the interrupt flag *after* incrementing/decrementing the counter instead of before. Nonetheless, it does seem to work OK as-is.

billbo911 13-03-2015 09:46

Re: Using the TI LaunchPad from your KoP
 
I know this thread is slightly stale, but it also seems to be the closest thing I can find to the official thread for the LaunchPad.

In as much as I can see that the LaunchPad successfully implements "Output" as well as Input, I have a question.

It is not so much that I am trying to create competition for the LaunchPad, but I am trying to help increase innovation. What I would like to know is, how does the LaunchPad parse the "Output Reports" sent from the DS to the "USB HID" device that the LaunchPad is acting as?

I have done a lot of searching on the Internet and have found almost nothing on the formatting of "output reports" let alone any examples of how to receive and parse these reports.

Specifically I have two devices I would like to use in the exact same manner as the LaunchPad, the Teensy 3.1 and the Leonardo. Thus far. using them as input devices is all I can achieve. It's the output, such as turning on LEDs or force feedback, that I can not seem to be able to do.

I guess there is a second question I would like answered. Is there a document that includes a description of the data formatting sent by the DS to attached USB HID devices?

jhersh 13-03-2015 10:36

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by billbo911 (Post 1457224)
I have done a lot of searching on the Internet and have found almost nothing on the formatting of "output reports" let alone any examples of how to receive and parse these reports.

I'm guessing you haven't looked at the source code for the Launchpad. That's the only example you should need to find online and it's referenced in this thread I believe. If not, it's on the wiki that is linked from this thread.

billbo911 13-03-2015 11:55

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by jhersh (Post 1457245)
I'm guessing you haven't looked at the source code for the Launchpad. That's the only example you should need to find online and it's referenced in this thread I believe. If not, it's on the wiki that is linked from this thread.

Hey Joe, good to hear from you after CVR. I sure appreciated working with you!

I'll go back and see if that code helps me. You are correct, I haven't looked at it yet. Not being a programmer by trade, more like a hack, if code isn't well commented, it really is mind-bending for me. I need things clearly spelled out before it makes sense.

billbo911 13-03-2015 12:13

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by wt200999 (Post 1424302)
The root folder is the whole project, the three different options are selected based on build properties in CCS. The important files are the source files in the root, and the files in the USB_config and USB_app folders.

CCS is Eclipse based and needs a workspace set up before importing projects. To set up CCS to work on the project, clone the MSP430-Gamepad repo into your workspace folder. From there you should be able to import and run the code.

I will be posting more detailed documentation soon.

Hi Will,
Any progress on the documentation?
Any chance I can do this in Eclipse instead of CCS? I already have Eclipse installed and need to get more familiar with it. If not, I'll just add CCS and follow your document(s) when they are available.

wt200999 13-03-2015 17:12

Re: Using the TI LaunchPad from your KoP
 
Documentation is still in the works, I'll let you know when I have something ready for that. The code itself is documented fairly well too so you can look at that in the mean time.

The biggest thing for what you are asking is the definition of the descriptor. I'll see if I can get some of the raw USB data from the sniffer used to develop the code and post that up. That should help to visualize what is going on.

I am not familiar with the back end of Arduino and how the libraries compile together with the sketches, but all the modifications needed are going to be from these libraries. I will probably take this up after the season (but with Energia) for porting the CCS library to work in Energia.

Looking at the HID.c file from the Leonardo++ library it looks like they tried something like this, or at least have a 'raw hid' option.

Edit: I am told you can add CCS to normal eclipse as an add on, though I have never tried this.

philso 04-05-2015 19:12

Re: Using the TI LaunchPad from your KoP
 
I am contemplating using the TI MSP430 Launchpad for a project I have in mind. I would like to use this as an opportunity to learn to use TI microcontrollers. Please advise if the following is workable.

I would like to build a device to control the DC current to a load using a PWM output stage and monitor the load current and voltage using two of the ADC inputs. I would want to store the time-stamped data, most likely on an SD Card. The time-stamp does not have to be the actual time. The time since the start of the sequence would be sufficient. I was considering using a touch screen LCD for the user interface. I found the following Booster Packs on the 43oh web site. I am comfortable designing the switching circuitry myself since that is what I do for my day job.

http://forum.43oh.com/topic/1700-sdcard-booster-pack/

http://forum.43oh.com/topic/6149-24-...t-touch-panel/

ILAMtitan 05-05-2015 16:37

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by philso (Post 1480002)
I am contemplating using the TI MSP430 Launchpad for a project I have in mind. I would like to use this as an opportunity to learn to use TI microcontrollers. Please advise if the following is workable.

I would like to build a device to control the DC current to a load using a PWM output stage and monitor the load current and voltage using two of the ADC inputs. I would want to store the time-stamped data, most likely on an SD Card. The time-stamp does not have to be the actual time. The time since the start of the sequence would be sufficient. I was considering using a touch screen LCD for the user interface. I found the following Booster Packs on the 43oh web site. I am comfortable designing the switching circuitry myself since that is what I do for my day job.

http://forum.43oh.com/topic/1700-sdcard-booster-pack/

http://forum.43oh.com/topic/6149-24-...t-touch-panel/

Philso,
The Launchpad would be a perfect platform for what you're trying to do. The only issue you might run into using the booster packs you've found that I see is that they will both probably use the same SPI port. You would have to double check the pin-outs to ensure that the chip select lines are on different pins so you can mux them properly. I've worked with RobG and BlueHash from 43oh before though, and they are both great resources.

It looks like RobG made a booster pack that integrates the SD and LCD into a single design: https://www.tindie.com/products/RobG...d-card-socket/
You might want to take a look at that one to see if it will meet your requirements.

Another consideration to make is how accurate you need your current measurements. The Launchpad that we put in the KoP is the MSP430F5529, which has 12 bit SAR converters. We just recently launched the MSP432P401 LP which has 14bit converters that might give you some additional dynamic range/accuracy if needed. In addition, that board has the new MSP432 processor, which is a 48MHz 32bit Cortex M4F. The additional clock speed should also give you higher resolution PWMs (but I haven't looked into this specific feature).

Both of the Launchpads listed will also include an internal RTC capable of making accurate time stamps for your data logger. You can either set it to the current data/time, or just use it in free run mode as you described. I'm not personally familiar with designing and operating a DC current source via PWM, but I can ask around the 430 team to see if anyone has information I can share if that would help.

philso 05-05-2015 18:23

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by ILAMtitan (Post 1480236)
Philso,
The Launchpad would be a perfect platform for what you're trying to do. The only issue you might run into using the booster packs you've found that I see is that they will both probably use the same SPI port. You would have to double check the pin-outs to ensure that the chip select lines are on different pins so you can mux them properly. I've worked with RobG and BlueHash from 43oh before though, and they are both great resources.

It looks like RobG made a booster pack that integrates the SD and LCD into a single design: https://www.tindie.com/products/RobG...d-card-socket/
You might want to take a look at that one to see if it will meet your requirements.

Another consideration to make is how accurate you need your current measurements. The Launchpad that we put in the KoP is the MSP430F5529, which has 12 bit SAR converters. We just recently launched the MSP432P401 LP which has 14bit converters that might give you some additional dynamic range/accuracy if needed. In addition, that board has the new MSP432 processor, which is a 48MHz 32bit Cortex M4F. The additional clock speed should also give you higher resolution PWMs (but I haven't looked into this specific feature).

Both of the Launchpads listed will also include an internal RTC capable of making accurate time stamps for your data logger. You can either set it to the current data/time, or just use it in free run mode as you described. I'm not personally familiar with designing and operating a DC current source via PWM, but I can ask around the 430 team to see if anyone has information I can share if that would help.

Thanks for your quick reply, Bart.

The MSP432P401 LP, with the 14-Bit ADC and PWM and internal RTC looks very attractive at just a few dollars more.

I had chosen the LCD with the touch screen to avoid needing to add a keyboard or keypad. I will check the chip select lines used by the two booster packs. I am guessing that if they conflict, I should be able to modify one of them to use a different GPIO pin.

I have done a bit of reading about the SD card booster pack and am a bit confused. It appears that the software currently can only read from the SC card and cannot write a file or it cannot create a file from scratch on the SD card. Is this true?

ILAMtitan 07-05-2015 11:04

Re: Using the TI LaunchPad from your KoP
 
Quote:

Originally Posted by philso (Post 1480272)
Thanks for your quick reply, Bart.

The MSP432P401 LP, with the 14-Bit ADC and PWM and internal RTC looks very attractive at just a few dollars more.

I had chosen the LCD with the touch screen to avoid needing to add a keyboard or keypad. I will check the chip select lines used by the two booster packs. I am guessing that if they conflict, I should be able to modify one of them to use a different GPIO pin.

I have done a bit of reading about the SD card booster pack and am a bit confused. It appears that the software currently can only read from the SC card and cannot write a file or it cannot create a file from scratch on the SD card. Is this true?

Good catch, I didn't even notice that the other one didn't have a touch screen.

One of our design partners also did an SD boosterpack which has a configurable CS pin location so you can avoid having to modify the hardware: http://boardzoo.com/index.php/booste...l#.VUt-PflVgZ4

Regarding the library, I know that PetitFS is a but limiting, but it was written to fit onto very small devices. The AdaFruit library should be compatible however: https://github.com/adafruit/SD
I got the examples to compile after removing the block of code where it wait's for the serial connection to enumerate on the Arduino, but I don't have the hardware on hand to test it. I'll try to snag a Boosterpack from someone around here to give it a whirl.

philso 10-05-2015 23:03

Re: Using the TI LaunchPad from your KoP
 
One of my coworkers suggested writing a Visual Basic program to run on a Windows computer to collect the data rather than saving the data onto an SD card. It would also eliminate the need to write so much low-level user interface software to run on the microprocessor. I am looking into either using a USB, WiFi or BlueTooth connection. Do you have any recommendations.

Having looked at the other LaunchPads, I am also considering using the LAUNCHXL-F28069M. It is similar to microcontrollers I have worked with on some of my boards at work (TMS28027 and TMS28335). I also like that the LAUNCHXL-F28069M can accommodate two Booster Packs and it's ability to perform math functions in one or two clock cycles.

ILAMtitan 11-05-2015 09:34

Re: Using the TI LaunchPad from your KoP
 
If you're going to have a computer next to the data logger that's not a bad idea. Every LaunchPad has back channel serial that can be used to send data back to the computer pretty easily. C# is pretty easy to cobble some kind of interface together in, but you can also just use a serial terminal and copy the data to a txt or csv for processing from there. Some of the terminal program (I use RealTerm for this) can dump everything it receives to a txt natively, which might be sufficient.

If you're already familiar with the TMS2xxx devices, I would stick with that and use the back channel. If you do want to move to WiFi, the CC3200 LP can be used to stream data back over the network pretty easily, but you would have to setup a socket server or something on the PC side.

philso 12-05-2015 09:48

Re: Using the TI LaunchPad from your KoP
 
It seems that for the USB interface, I could use the USB interface (FTDI2232H) that is already on the LP and connects to the JTAG port and an SCI port on the TMS320F28069. It also seems that if I remove/open JP1 and JP3, the USB interface would "float" and be powered from the host computer.

Thanks for the recommendation for RealTerm. It would be a great way to get started. Later, I would still want to implement some sort of Visual Basic or Visual C program running on the host to set operation modes and monitor progress in a way that is more user friendly.

Pugsly 05-03-2016 15:15

Re: Using the TI LaunchPad from your KoP
 
Regarding the "Set Output" of the joystick I am trying to light up an indicator using the Launchpad that was included in last years kit and I can't for the life of me figure out how to wire this up in Labview.

So say for instance I want to light a LED on the launchpad Red or Blue depending on what alliance we are on. Anyone have any ideas on how do do that?

wt200999 05-03-2016 19:07

Re: Using the TI LaunchPad from your KoP
 
How do you have it wired up to the LaunchPad? Do you have one red LED and one blue LED, or an RGB LED, or some kind of addressable LED strip?

I posted a few examples of how to use the WPI_JoystickSetOutputs.vi in a thread here. You can use the output from the Get Alliance.vi to select a different value for the output vi.


All times are GMT -5. The time now is 03:57.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi