The objective of this guide is to explain the high-level software flow for platform development with the TUSS4440 and TUSS4470 devices using serial peripheral interface (SPI), general-purpose input/output (GPIO), and analog-to-digital converter (ADC) commands. This document contains a software development flow-chart, main executable routines, and source code examples. The example software is written in Energia for the MSP-EXP430F5529LP, but can be adapted to any TI LaunchPad™ development kit.
LaunchPad is a registered trademark of Texas Instruments.
All other trademarks are the property of their respective owners.
The TUSS44x0 device can only be operated as a slave device and must be paired with an external microcontroller unit (MCU), which acts as the master device. The master device is responsible for the initialization, configuration, and regular polling operation of the TUSS44x0 device. Figure 1 shows the high-level overview of the software flow for standard TUSS44x0 operation. There are three main components of the software flow:
After master controller initialization, the program of the main file loops the routine shown in Figure 1 to report the ultrasonic time-of-flight result based on the response from the TUSS44x0 device. For the purpose of this guide, the TUSS44x0-specific code is referenced from the TUSS44x0 Energia IDE library package containing the GetDistance.ino, TUSS44x0_Ultrasonic.cpp and TUSS44x0_Ultrasonic.h files. The master controller used in this example is the MSP430F5529 MCU on the MSP-EXP430F5529LP platform. The TUSS44x0 EVM hardware (BOOSTXL-TUSS44x0) is used to demonstrate the operation of the software.