Table of Contents

Introduction

The temperature sensor broadcast code example is a simple code example that leverages the integrated temperature sensor on the MSP432 to broadcast the temperature over BLE. This code example has the advantage over the Sensors BoosterPack code example in the sense that it does not require any additional sensor booster pack. This project leverages the MSP432’s floating point unit to provide both Celsius and Fahrenheit temperature data.

Hardware Prerequisites

Temperature Sensor Broadcast requires the standard configuration of an MSP-EXP432P401R LaunchPad with an attached BOOSTXL-CC2650 BoosterPack or LAUNCHXL-CC2640R2 Launchpad. This hardware configuration is shown in the below image:

MSP432 LaunchPad with CC2650 BoosterPack

Alternatively, the CC2640R2 LaunchPad can be used in lieu of the CC2650 BoosterPack. In this case the CC2640R2 LaunchPad should be stacked on the MSP432 LaunchPad as seen below:

CC2640R2 on the MSP432

Software Prerequisites

This code example has been tested with IAR Embeded Workbench 8.20, Code Composer Studio v8.0, and gcc-arm-none-eabi-6-2017-q1-update. For more information on how to import this project into your IDE workspace and build/run, please refer to the main user’s guide.

Service/Profile Table

Purpose UUID Format Unit Properties Profile Source
Temperature Broadcast (C) 0xFFE1 IEEE-754 32-bit floating point °C Notification temperature_profile.c
Temperature Broadcast (F) 0xFFE2 IEEE-754 32-bit floating point °F Notification temperature_profile.c

Usage

Once the Temperature Sensor Broadcast code example starts the output to the terminal will notify the user of initialization and then set the state of the application to idle.

Temperature Sensor Initialization

In idle mode, the application is in a low power mode and not actively advertising. In order to start advertising, the S1 switch on the LaunchPad needs to be pressed. The S1 switch can be found on the left side of the LaunchPad as pictured below:

Button Positions

Once the S1 button is pressed, the device will start advertising itself with a device name of “MSP432 Thermometer”. Also note that once advertising (and while connected) the LED on the MSP432 LaunchPad’s LED1 pin is turned red to signify activity.

LED indicating activity

After connecting to the MSP432 Thermometer device, the terminal screen should print that the peer was connected and also print the ID of the peer:

Connection Log

At this point the device as connected and successfully negotiated the connection details. Scrolling down past the product information (this might be different depending on your client) there should be a list of two different characteristics and their corresponding properties/values (these are described in detail in the following sections):

List of characteristics

Temperature (C) (UUID: 0xFFF1)

The first characteristic is a notification characteristic that broadcasts temperature readings approximately at a period of five seconds. Note that the temperature readings are reported in floating point value and the mobile client may need to be updated to display floating point legibly.

Temperature broadcast in C

Temperature (F) (UUID: 0xFFF2)

The second characteristic is the same characteristic as the first one, however broadcasting in Fahrenheit:

Temperature broadcast in F

SimpleLink SDK Explorer

SimpleLink SDK Explorer is a customized mobile application from Texas Instruments that is designed to compliment various aspects of the SimpleLink SDK mobile ecosystem. Currently this application is available for Android and iOS devices. The code examples included in the SimpleLink SDK BLE Plugin are fully modeled and showcased as a part of SimpleLink SDK Explorer. From the Apple AppStore or Google Play Store search for SimpleLink SDK and download the SimpleLink SDK Explorer.

The app can also be found at the links below:

Apple AppStore: https://itunes.apple.com/us/app/simplelink-sdk-explorer/id1237329921?ls=1&mt=8

Google Play: https://play.google.com/store/apps/details?id=com.ti.simplelinksdkexplorer&hl=en

Additionally, the full BSD licensed source code for both applications can be found at the link below: https://www.ti.com/tool/download/SIMPLELINK-SDK-BLUETOOTH-PLUGIN

Open the mobile application once it has been downloaded:

SimpleLink SDK Explorer Main Menu

From the main screen select the Profile Examples menu item. This will take you to a list of profile examples that correspond to each code example in the SimpleLink MSP432 SDK Bluetooth Plugin:

SimpleLink SDK Explorer Profiles

Select the Temperature Sensor Broadcast menu item. On the next screen SimpleLink SDK Explorer will automatically scan for BLE devices in your vicinity. Make sure Bluetooth is enabled on your iOS device or else no devices will show up in this view. After pressing S1 on your MSP432 LaunchPad the Temperature Sensor Broadcast code example will start to advertise and show up as “MSP432 Thermometer”:

MSP432 Thermometer

Select MSP432 Thermometer. The next screen will show the control view for all different characteristics of the Temperature Sensor Broadcast code example:

Temperature view

Temperature notifications will automatically be enabled and readings will start to be populated on the graph. Note that you can switch between units with the C/F switcher and enable/disable notifications with the switcher control.

SBL Update

Updating the firmware on the CC26xx BoosterPack uses the SBL libraries to invoke the CC2650’s bootloader and transfer the new firmware over serial. For Temperature Sensor Broadcast, the method to trigger this invocation is to press and release the S2 button on the LaunchPad. Note that in order to trigger the firmware update, no active BLE device can be connected. Once S2 has been pressed, LED2 on the LaunchPad will toggle red to signal the BSL start:

SBL LED

*** Note that the default SNP image for all code examples is that of the CC2640R2 LaunchPad SNP. Any hardware configurations using the CC2650 BoosterPack must be explicitly updated to contain the CC2650 BoosterPack SNP image. ***

The console screen will print the status of the firmware update as well as signal when the update has finished. At the end of the update the status of the update will be printed over the serial port and the MSP432 will reboot itself:

SBL log