Skip to content

Getting started with the Sprite Development Kit

Zac Manchester edited this page Apr 9, 2018 · 38 revisions

Caution: Please don't plug the Sprite in before reading the hardware section below - you could damage the solar cells.

To program the Sprite we'll be using a piece of software called Energia. Energia is a port of the Arduino environment and libraries to the Texas Instruments MSP430 microcontroller which is used on the Sprite. If you've ever programmed an Arduino, it should be very familiar. If you've never programmed a microcontroller before, I'd recommend having a look through the documentation and examples provided by both the Energia and Arduino projects (note that not all of the examples will run on the Sprite).

Installing Software

We'll be using a version of Energia specially modified for the Sprite. There are binaries and installation instructions below for Windows and Mac. Installing on Linux is also possible, but you'll have to compile it from the source code yourself.

Windows

  1. Download the LaunchPad (programmer) drivers for Windows: LaunchPad CDC drivers zip file for Windows 32 and 64 bit
  2. Unzip and double click DPinst.exe for Windows 32bit or DPinst64.exe for Windows 64 bit.
  3. Follow the installer instructions.
  4. Download the KickSat build of Energia for Windows
  5. Unzip the folder somewhere convenient
  6. Run Energia by double-clicking the "Energia" icon inside the folder.

Mac

  1. Download the LaunchPad (programmer) drivers for Mac OS X: LaunchPad CDC drivers zip file for Mac OS X
  2. Unzip and double click MSP430LPCDC 1.0.3b.pkg
  3. Follow the installer instructions.
  4. Download the KickSat build of Energia for Mac
  5. Unzip the Energia app and place it in your Applications folder. Note: If you're running Mountain Lion, you may have to change your security settings to allow unsigned apps.
  6. Run Energia by double-clicking the Energia application

Linux

I won't give step by step instructions here since they will vary depending on your distribution. Most recent linux distributions ship with the LaunchPad drivers already installed. To get Energia running you'll need a JDK installed as well as Ant, mspgcc, and mspdebug. These are likely available through your distribution's package manager. Once you have the prerequisites installed, download or git clone the source code, open a terminal, cd into the build directory, and type "ant run".

There are several tutorials available online for getting Energia running on linux.

Connecting the Hardware

  1. Unbox the development kit

    UnBox

  2. Because the solar cells run at a different voltage than the programmer, they must be disconnected before plugging the Sprite into the programmer to avoid damage. To do this, remove the small jumper on the left edge of the Sprite. After the Sprite has been disconnected from the programmer, you can replace the jumper.

    Jumper

  3. Plug the Sprite into the programmer.

    PluggedIn

  4. Connect the programmer to your computer's USB port. You should see a green LED illuminate on the programmer.

  5. Run Energia (see above).

Your First Sprite Program

Once everything is connected and Energia is running it's time to write some code. We'll go through a basic example that will blink the LED on the Sprite.

  1. Make sure the correct microcontroller is selected. Click Tools->Board and make sure "Launchpad w/ cc430f5137" is selected.

    MCU_Select

  2. Click the "Open" button at the top of the Energia window, then under the "Basics" menu, select "Blink". Note that if you use the File->Open dialog box instead of the Open button, it will be located under examples->Basics->Blink->Blink.ino inside your Energia folder. We'll need to modify this code slightly to work on the Sprite.

    Open

  3. Looking at the source code, you'll notice two functions - "setup" and "loop". This is how all Arduino/Energia programs are structured. The setup code will run one time when the microcontroller first starts up. The loop code will then run repeatedly until the microcontroller is powered off. The code we've just opened is configured to blink an LED attached to pin 14, but on the Sprite the LED is attached to pin 5. Let's replace the three instances of "14" with "5".

    Blink

  4. To make sure our code compiles without any errors, click the "Verify" button (the round check mark button at the upper left of the Energia window).

    Verify

  5. Now we're ready to load our code onto the Sprite. Click the "Upload" button (located to the right of the "Verify" button).

    Upload

  6. After a few seconds, you should see the green LED on the Sprite illuminate, then turn on and off once per second.

    Blink