Setup and Test Results
4
SNOU160 – April 2018
Copyright © 2018, Texas Instruments Incorporated
TMP116METER-EVM User's Guide
2
Setup and Test Results
2.1
Hardware
CAUTION
The TMP116METER-EVM requires a Panasonic CR2032 coin cell battery
which is not included.
NOTE: The TMP116METER-EVM requires a Panasonic CR2032 coin cell battery which is not included.
The TMP116METER-EVM includes:
•
MSP430FR5969 MCU
•
Three push-button switches
•
TMP116 temperature sensor
•
LSO13B7DH03 LCD
•
32-kHz FC-135 32.7680KA-A3 crystal
•
Associated discrete components
•
For a comprehensive list of all parts, see the Bill of Materials (BOM).
2.2
Software
This TMP116METER-EVM ships pre-loaded with software for its MSP430FR5969 MCU. When the battery
is loaded, the display shows a Texas Instruments splash screen and then proceeds to display the current
temperature and humidity. The rest of this section details the operation of the software.
Included with this reference design is a software package that contains a Code Composer Studio (CCS)
project designed for the MSP430FR5969 mCU. For proper evaluation, import the CCS project into CCS
v7.3 or later with TI Compiler v16.9.4.LTS or later.
After reset or power-on, several hardware initializations take place. All GPIO pins are configured as
outputs and driven to logic low to save power. The pins that are used are then reconfigured for their
intended purpose. The MSP430 MCU’s internal oscillator, known as DCO, is configured for 8 MHz and
connected to the internal signals SMCLK and MCLK. The external 32-kHz real-time crystal (RTC) is
connected to the low-frequency clock inputs (LFXT), so the LFXT is configured as the source of the
internal signal ACLK (Aux Clock). TIMER A is configured as a counter with ACLK as source. Conveniently,
a count of 32768 (215) is equivalent to 1 second, a count of 16384 (214) is equivalent to a half second,
and so on. The eUSCI B0 peripheral is configured for I2C communication with the TMP116 device. Finally,
the eUSCI A1 peripheral is configured for SPI use with the display, and the Sharp display is initialized.
The next step in the software is to begin the loop.
On each iteration, the MSP430 MCU begins by checking the state of the button S1 and setting the Celsius
and Fahrenheit variable. An I2C Write transaction is then performed to instruct the TMP116 to begin a
temperature measurement. This measurement takes a few milliseconds (for conversion time, see
TMP116x High-Accuracy, Low-Power, Digital Temperature Sensor With SMBus- and I2C-Compatible
Interface ), so the MSP430 MCU is configured for LPM4 during the down time. After TIMER A interrupts
and resumes, the temperature data is retrieved from the TMP116. The values for temperature are
converted to characters using the tmp-decode.c library. This library is designed to provide string
conversion without loss of 16-bit precision, but it can be adjusted for less precision. Finally, the
temperature string updates the display and the MSP430 MCU returns to LPM4 for 2 seconds before
looping.