Getting Started with the Stellaris Launchpad

We’ve already given an overview of the Stellaris Launchpad, but lets look at the first steps to running code on the device. First we’ll get the development software working, then we’ll build and run a very simple example.

TI allows use of the full version of their IDE, Code Composer Studio, with the Launchpad’s on-board debugger. To work with Stellaris microcontrollers, you’ll also need to grab StellarisWare. This free software package contains support for the Stellaris devices including peripheral drivers, a USB library, and code examples. Finally, you’ll need the ICDI drivers to communicate with the debugger. TI has all the required software for this board available here. See the TI getting started directions for a walk-through of how to install the required software.

Windows 8

If you’re using Windows 8, the drivers won’t install because they aren’t signed. The workaround is to reboot and interrupt the Windows 8 boot by holding Shift and mashing F8. Select the “Disable Driver Signature Enforcement” option and let Windows boot up. You can now install the drivers by following TI’s instructions.

Creating a Project

With these packages installed, we can start writing code for the device. Create a new CCS project (File -> New -> CCS Project) and give it a name. Choose “ARM” as the family, “Stellaris LM4F120H5QR” as the variant, and select “Stellaris In-Circuit Debug Interface” as the connection. Select “Empty Project (with main.c)” under “Empty Projects” and click finish.

Now we need to include a header file that gives names to the microcontroller’s ports. To do this, click Project -> Properties and go to Build -> Arm Compiler – >Include Options. Click the plus beside “Add dir to #include search path,” click “File System,” and find the “inc” subdirectory under where you installed StellarisWare. Click OK to add the folder.

Making Light

Lets test that everything is working. In this simple example, we’ll just turn on all three colors of the RGB LED. To do this, we turn on the pins that the LED are connected to, which happen to be:

PORTF 1 = RGB LED red
PORTF 2 = RGB LED blue
PORTF 3 = RGB LED green

See the user manual for full schematics.  Here’s the code:

// processor definitions
#include "lm4f120h5qr.h"
#define LED_RED 0x2
#define LED_BLUE 0x4
#define LED_GREEN 0x8

void main(void) {
  // enable PORT F GPIO peripheral
  SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF;
  // set LED PORT F pins as outputs
  GPIO_PORTF_DIR_R = LED_RED|LED_BLUE|LED_GREEN;
  // enable digital for LED PORT F pins
  GPIO_PORTF_DEN_R = LED_RED|LED_BLUE|LED_GREEN;
  // clear all PORT F pins
  GPIO_PORTF_DATA_R = 0;
  // set LED PORT F pins high
  GPIO_PORTF_DATA_R |= LED_RED|LED_BLUE|LED_GREEN;
  // loop forever
  for(;;);
}

Replace the code in main.c with this snippet. Debug the project by clicking Run -> Debug. This will build your code, and load it onto the device. To start execution, click Run -> Resume. The LED should light up white. Changing which pins are set high will change the color of the LED.

Any issues getting your Stellaris Launchpad up and running? Let us know in the comments.

68 thoughts on “Getting Started with the Stellaris Launchpad

    1. My board arrived yesterday, but has anybody else had trouble downloading the software? The ICDI drivers downloaded and installed just fine (on Win7), but I’ve made several attempts to download the Code Composer Studio + StellarisWare package, and it’s failed every time (on both IE8 and Mozilla, directly from the Internet or through my work firewall.) It’s about a gigabyte, but after going through the Export Control nonsense, it still doesn’t get past 0% downloaded, so it’s not just a size problem. Should I give up on CCS and just download the StellarisWare part for now?

      1. I had a less than pleasant experience getting the drivers to load on XP as well. Hours of errors. Even after following the “Getting Started” to the letter. I finally found some help with it HERE
        Maybe just me but, it was a big turn off out of the gate. I’ll dare to call CCS less than intuitive as well. It seems sad when getting the LED to blink feels like an accomplishment.

    2. Ha, I’m early November too. This resulted in some crushing disappointment for me, I read the estimated shipping date as 11/9/2012 and thought great mid September. I forgot that while I’m not American TI are amd only realised earlier this week when I was getting a bit anxious about where the hell the thing was.

  1. Hi guys,

    In case anybody’s interested, here’s one of my posts regarding a library I wrote for controlling a TM1638 (nice and cheap little board featuring 8 7segment digits !):

    http://trandi.wordpress.com/2012/10/11/tm1638-display-driver-for-stellaris-launchpad/

    There was already one for Arduino and the MSP430, and now you can easily use the Stellaris Launchpad too.

    You can download the library and use it as you wish, I can’t wait to see what people will be doing with it..:)

    Dan

  2. I could hate you for waving that stellaris in our faces before we’ve even got ours, but I’m going to act all grown up instead. Here’s a tongue :P

  3. I just got my 2 in the mail last week. It’s confusing as all hell when the only thing you’ve worked with previously is an arduino…

    things like a real debug interface…etc. I figured out how to get code running in debug mode, but I have no idea how to build/upload code in final build mode. Time to do some learning. The variable/port/everything names are incredibly complex…again compared to my arduino experience.

    1. Same here, I have even gone as far as doing a few c++ tutorials! I am determined ti do something interesting with it though.

  4. **oh, and when setting the address/serial number words, remember it’s a permanent commit! The interface gives no warning that you can only save the values once.

  5. Got mine in Brazil last week, in the next weeks i’ll do some nice stuffs, still learning the new enviroment, i’m used to work with PIC and arduinos, so won’t be much before doing something awesome.

  6. for installing drivers on Win8 with signature verification turned off, people should add that special test certificate to the system and have that trusted. I don’t think disabling signature check for the entire system is a good thing.

  7. Great! I received my boards last week and only had the chance to test the demo program. I’ve just finished downloading the tools and I’m ready to go (as soon as I find some time :P).

  8. So, PIC32 or Stellaris?

    I mean they’re basically the same thing: 32 bit, 80MHz max clock, and a ton of peripherals. Does it just come down to MIPS vs ARM (and customer support, libraries, IDE, etc)?

    I’ve been doing a lot of PIC32 recently, but I’ve also been interested in venturing into the world of ARM.

    1. Good question. I’ve worked with PIC32 quite a bit, and not as much with ARM. One advantage is the large number of ARM variants out there. It’s also used much more in industry. Hopefully I’ll have a better opinion after working with the Stellaris for a little while.

    2. I’ve used Cortex-M3s in a few projects and I am currently working on a project using a PIC32 and given the choice I’d go with ARM every time. The PIC32′s MIPS core is just so old and clumsy compared to the Cortex-M. Microchip’s libraries do an admirable job of hiding most of the crap where they can, but it’s still obvious you’re not dealing with a modern, purpose-designed architecture.

      1. Not to mention that the StellarisWare peripheral drivers are also included in on-chip ROM. That I like alot, as it may actually enable significant savings on program flash.

  9. talking about perfect timing!! :-D
    i got mine two board just this morning!! :-)))
    this will be interesting! i started with mcu’s with paralax propeller, and will see how this one will go!
    (but this will not replace propeller, at least not for me!)

    ….. just to figure out what to do with these boards… :-D

  10. Got my two a couple days ago, been too busy to do more than check out the preloaded demo. Goddamn LED damn-near burned a hole in my retina, lol. That sucker is BRIGHT.

    btw, can anyone source ridiculously-bright tiny formfactor surface mount RGB LEDs like that? I hardly ever see anything but 5050/PLCC-6 ones.

    1. did some digging, the PDF has it listed as RGB_LED_0404_COMA and googling ( with out the underscore ) i find this little guy that looks like the zoom in of the board.

      http://www.lumex.com/en/products/detail/0404_package

      Looking for SML-LX0404SIUPGUSB they vary between .78 and 2.50 ( then add shipping, tax and if they give that low as EACH, etc )

      They have to be common/cheap in the manufacturing industry as I popped open my YP-S2 player and pulled out the little glob at the bottom and it looks like the same one ( and blinding when you plug it in to the USB with out the white stuff over it )

      1. just checked ” est ship date ” and it looks like they moved it back…. 11/29/2012 :/

        Order Date: 9/13/2012 1:59 PM

        I can’t complain too much as a Canadian, I should just be amazed at the 2 day FedEx for the sample parts I ordered ( then and last weekend )
        Now if someone has a Pad2Pad compatible ” Start Board ” for the Stelaris board dual headers so some of us can start working on the interface aspect, that would really be appreciated!

      2. Oh wow, good catch, thanks. :D

        I would’ve settled for even knowing what the formfactor is, heh.

        What PDF are you referring to? I looked to see if they had design files for the board like the previous launchpads, but if they’re there, I must’ve missed them.

  11. So I’m going to have to fork over $445 for the Code Composer Studio if I want my code to run on a board not connected to a PC. That takes a lot of the shine off the $5 per board price.

    1. I got mine in about a week ago. Still playing around with it. I didn’t need to play for CCS. I just had it “lock” to my board. I can run code without having my LaunchPad connected to my PC.

    2. Use the free LM Flash programmer to download your file to your custom board that you proofed out on the Launch Pad. If you find a bug, work it out on the Launch Pad and, again, download the debugged file to you custom board.

      For more complicated projects you may have to create a plug-in board that will sit on top of the Launch Pad. Full specs are on the TI site.

  12. ARGH… They still suck at software.
    I had a Chronos Watch and it was hell to do something on it… Stellaris is even worse.
    I’ve came from the Arduino world too and there’s no way they can compete with it.

    1. ARGH… They still suck at cars.
      I went to the DMV and they expected me to keep accelerator and brake apart and I even had to learn about road signs.
      I’ve came from riding the bus and there’s no way they can compete with that.

      Horses for courses.

  13. TI has no luv for linux. They release the launchpad but, like the msp430, their flagship software CCS doesn’t work with the launchpad and linux. If it follows the msp430 route, they’ll get it running sometime in 2014 or 2015.

    Why can’t TI make great chips AND software that works with linux?

  14. Nice platform but horribly setup to work with open toolchains.

    If anyone wants to join efforts on making this run on standard ARM EABI toolchains on multiple platforms (Linux/Mac), please get in touch with me.

  15. I had good experience with CCSV5.2 and Stellaris Launchpad with Windows Vista Home Basic but after I replaced it with CCSV6 I cannot download my compiled software into the board. It asks me to update to new Target Configuration file *xxml. I wonder if it not compatible with Window Vista Home Basic.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s