We’ll be at IoT World!

We’ll be at IoT World! Helping developers rapidly prototype their cloud-connected application!

logo-300[1]The Launchpad team will be at IoT World May 11th-12th to support developers and makers in a 30 hour Internet of Things hackathon.  TI will provide  MSP430F5529 LaunchPad development kits, SimpleLink CC3100 WiFi Boosterpacks, and SEEED Studio’s Grove Starter Kit for Launchpad to participants.  These kits combine to create an ideal solution for rapid prototyping internet connected projects.

To further enable rapid prototyping, the Launchpad family is supported by Energia – an open source port of the Wiring/Arduino framework to TI’s launchpads. The CC3100 BoosterPack paired with Energia WiFi examples lets you quickly and easily incorporate WiFi into any LaunchPad project. The SEEED Studio Grove Starter Kit provides a simple interface to connect various sensors and inputs to LaunchPad boards and are fully supported by Energia.

On the cloud side, Launchpads are supported by Temboo – a cloud-based code generation platform that allows you to connect to 100s of web-based resources and services. Temboo provides an easy way to use various web services(everything from Twitter to SMS to FedEx to Yahoo! Weather) to connect to and control your launchpad by unifying how you interact with their APIs.  A great example shows how to get started by using your launchpad to retrieve weather information from Yahoo! Weather.

Additionally, Energia has support for MQTT to allow the LaunchPad to act as both an MQTT Publisher and Subscriber. This, combined with a free broker (like such as m2m.eclipse.org or another public broker), makes it easy to get a simple IoT application communicating with the cloud.  Once your LaunchPad is publishing to the cloud, IBM’s BlueMix combined with node.js frontend NodeRed lets you view data and control your launchpad from anywhere. A full start to finish Energia based MQTT tutorial can be found here: http://energia.nu/guide/tutorial_mqtt/.

A list of LaunchPad IoT resources is listed below:

 

Introducing Energia MT for MSP432

What is Energia MT?

Aside from bug fixes, the release of Energia 15 with Multitasking (MT) adds support for the new ARM Cortex M4F-based MSP432 LaunchPad. This time it’s a bit different though. The framework is powered by TI-RTOS, letting you run your Sketches in parallel. Yes, in parallel! How awesome is that?! This release supports MT for the MSP432 LaunchPad with support for other boards coming in future releases.  Download Energia 15 with MT now!

 

How it Works

Each tab in Energia MT is its own task, which will have a setup() and a loop() component.  The setup() and loop() pair need to have matching names, but the specific names don’t matter.  For example, to blink 3 LEDs at different rates, we would set up the Energia project like this: setupBlink1()/loopBlink1(), setupBlink2()/loopBlink2() and setupBlink3()/loopBlink3().

EnergiaLoop2

EnergiaLoop3

EnergiaLoop1

As long as the setup/loop pairs match, the naming in the tabs doesn’t matter.  Energia MT will automatically find the setup/loop pairs and turn them into individual tasks.  Setting up a multitask application is as simple as that!

Energia MT also allows for global variable for inter-task communication.  All global variables are truly global and must be declared in the first tab. Once they are declared in the first tab, they can be called from any other tab/task, but you cannot reuse the variable name in another task.

 

Examples in Energia MT

MultiBlink: Multiple Sketches each blinking one of the RGB LEDs at a different rate.
ButtonEvent: An example for the Button event library. One Sketch is reading the button and another sketch waiting for the button to be pressed. This library uses the TI-RTOS events module.
EventLibrary: An example for using the Event library. This library enables you to send an event from one task to the other. One Sketch sends events while the other Sketch waits for an event to happen and sleeps otherwise.
Monitor: This is an awesome utility Sketch that displays CPU utilization, task memory usage, etc. There are a couple of VT100 features in this sketch so best would be to use a VT100 terminal rather than the build in Serial monitor. For example, to continuously display the CPU load, type stats <space> <enter> and the CPU load will be updated in the terminal continuously.
MultiTaskSerial: Shows 2 threads sending a string to the Serial monitor at different rates.

You can find these examples in Energia MT under File->Examples->MultiTasking

Additional Benefits

Even when you are writing a single-threaded sketch for the MSP432, Energia will still compile it into the TI-RTOS.  While this will result in a larger code-size, it also brings the power and computational benefits of an RTOS.  For example, if you use a delay(500) at the end of your loop instead of ticking for 500 milliseconds, TI-RTOS will set an interrupt and go into deep sleep until the 500 milliseconds is up.

 

See Also

Examples and tutorials

Multitasking Tutorial