Table of Contents

Introduction

The LCD BoosterPack Text example is an application that demonstrates the use of the Kentec QVGA BoosterPack to display text on an LCD screen with a variety of different styling configurations. The user has the ability to display a variable text message of their choice and change the font size, font color, text position, and background color. This code example leverages the MSP432 Graphics Library that is shipped with the SimpleLink MSP432 SDK.

Hardware Prerequisites

The LCD BoosterPack Text ccode example requires the standard configuration of an MSP-EXP432P401R LaunchPad with an attached BOOSTXL-CC2650 BoosterPack or LAUNCHXL-CC2640R2 Launchpad. Additionally, a Kentec QVGA BoosterPack must be stacked on top of the CC2650 BoosterPack. This hardware configuration is shown in the below image:

MSP432 LaunchPad with CC2650 BoosterPack and LCD 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-7-2017-q4-major. 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 Properties Profile Source
Text String F0001131-0451-4000-B000-000000000000 Integer Read/Write lcd_service.c
Text Color F0001132-0451-4000-B000-000000000000 Integer Read/Write lcd_service.c
X Position F0001133-0451-4000-B000-000000000000 Integer Read/Write lcd_service.c
Y Position F0001134-0451-4000-B000-000000000000 Integer Read/Write lcd_service.c
Text Size F0001135-0451-4000-B000-000000000000 Integer Read/Write lcd_service.c
Background Color F0001136-0451-4000-B000-000000000000 Integer Read/Write lcd_service.c

Usage

Once the LCD BoosterPack Text code example starts, the LCD will turn to a black background with the text “Simplelink MSP432 SDK Bluetooth Plugin” displayed on the screen.

LCD BoosterPack Text

By default, this code example starts with BLE advertisement enabled indefinitely. Using your BLE client of choice, search for the “MSP432 LCD” device and connect:

Device being advertised

Once connected, scroll down past the product information (this might be different depending on your client) and there should be a list of six different characteristics and their corresponding properties/values (these are described in detail in the following sections):

List of characteristics

Text String Characteristic (UUID: F0001131-0451-4000-B000-000000000000)

The text string characteristic will change the value of the text that is displayed on the screen. From your client application, write any desired string value to this characteristic and the displayed text on the LCD will change:

Changing the text value

Text Color Characteristic (UUID: F0001132-0451-4000-B000-000000000000)

The text color characteristic is a three byte value that controls the RGB value of the font display. The byte order is in the format of BB GG RR. For example, writing a value of 0000FF to the characteristic would change the text color to full red.

Changing the text color

Note that any combination of RGB values can be used.

X Position Characteristic (UUID: F0001133-0451-4000-B000-000000000000)

The X Position characteristic is the position of the beginning of the text string starting from the left side of the screen. The position is limited by the X resolution of the LCD screen (320) and a value from 0 to 320 can be used. A value of 160 will roughly put the text in the horizontal center of the screen.

Changing the x position

Y Position Characteristic (UUID: F0001134-0451-4000-B000-000000000000)

The Y Position characteristic is the position of the top of the text starting from the top side of the screen. This value is limited by the Y resolution of the LCD screen (240) and a value from 0 to 240 can be used. A value of 120 will roughly put the text in the vertical center of the screen.

Changing the y position

Text Size Characteristic (UUID: F0001135-0451-4000-B000-000000000000)

The text size characteristic changes the font size of the text on the screen. This code example has a total of eighteen different fonts (0 being the smallest, 17 being the largest). Changing the value of this characteristic will change the font size of the displayed string:

Changing the text size

The last characteristic controls the background color of the LCD. The format of this characteristic is identical to the format of the text color characteristic (six byte BB GG RR value). Write to this value to change the background color:

Background Color Characteristic (UUID: F0001136-0451-4000-B000-000000000000)

Changing the background color

SBL Update

Updating the firmware on the CC26xx device uses the SBL libraries to invoke the CC2650’s bootloader and transfer the new firmware over serial. For LCD BoosterPack Text, the method to trigger this invocation is to hold down both S1 and S2 buttons on the LaunchPad for a duration of at least three seconds. Note that in order to trigger the firmware update, no active BLE device can be connected. Once S1 and S2 are held down for two seconds, LED2 on the LaunchPad will toggle bright blue to signal the BSL start:

Update invoked

*** 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:

Update log