MSP430 Interface to LMP90100 Code Library Application ...

11
1 SNAA134A – February 2012 – Revised May 2013 Submit Documentation Feedback Copyright © 2012–2013, Texas Instruments Incorporated MSP430 Interface to LMP90100 Code Library Code Composer Studio is a trademark of Texas Instruments. All other trademarks are the property of their respective owners. Application Report SNAA134A – February 2012 – Revised May 2013 MSP430 Interface to LMP90100 Code Library ABSTRACT This application report describes different ways to interface and use the TI LMP90100 devices with an MSP430. The accompanying software contains a function library allowing quick prototyping of sensor AFE setup and control. The software provided in this library is a starting point for developers wanting to get the most out of the MSP430 and the LMP90100 Sensor AFE devices. It shows how to communicate with the LMP90100 using the serial peripheral interface (SPI) and how to use some of the many advanced digital features and sensor interfacing capabilities of the LMP90100 including normal streaming, controlled streaming, data only read, CRC check for error detection, and system calibration. Source code discussed in this application report can be downloaded from the LMP90100 product folder. Contents 1 Introduction ................................................................................................................... 2 2 Purpose and Scope ......................................................................................................... 2 3 File Organization ............................................................................................................. 2 4 Functions...................................................................................................................... 5 5 Using the Software .......................................................................................................... 6 5.1 Prerequisites......................................................................................................... 6 5.2 Getting Started ..................................................................................................... 6 5.3 Adapting the Demo Project to Other Hardware ............................................................... 10 5.4 Using the Library With an Application .......................................................................... 10 6 References .................................................................................................................. 10 List of Figures 1 Code Library Stack .......................................................................................................... 4 2 LMP90100 to MSP430 Connection Diagram ............................................................................ 8 3 LMP90100EB Jumper Settings ............................................................................................ 8 4 MSP-TS430RGC64USB Jumper Settings................................................................................ 9 List of Tables 1 Hardware Definition Files ................................................................................................... 2 2 Library Code.................................................................................................................. 3 3 Demo Applications Included With the Library ............................................................................ 3 4 Register Access and Control Functions Provided by the Library...................................................... 5 5 LMP90100EB Jumper Settings ............................................................................................ 8

Transcript of MSP430 Interface to LMP90100 Code Library Application ...

Page 1: MSP430 Interface to LMP90100 Code Library Application ...

1SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

Code Composer Studio is a trademark of Texas Instruments.All other trademarks are the property of their respective owners.

Application ReportSNAA134A–February 2012–Revised May 2013

MSP430 Interface to LMP90100 Code Library

ABSTRACTThis application report describes different ways to interface and use the TI LMP90100 devices with anMSP430. The accompanying software contains a function library allowing quick prototyping of sensor AFEsetup and control. The software provided in this library is a starting point for developers wanting to get themost out of the MSP430 and the LMP90100 Sensor AFE devices. It shows how to communicate with theLMP90100 using the serial peripheral interface (SPI) and how to use some of the many advanced digitalfeatures and sensor interfacing capabilities of the LMP90100 including normal streaming, controlledstreaming, data only read, CRC check for error detection, and system calibration.

Source code discussed in this application report can be downloaded from the LMP90100 product folder.

Contents1 Introduction ................................................................................................................... 22 Purpose and Scope ......................................................................................................... 23 File Organization............................................................................................................. 24 Functions...................................................................................................................... 55 Using the Software .......................................................................................................... 6

5.1 Prerequisites......................................................................................................... 65.2 Getting Started ..................................................................................................... 65.3 Adapting the Demo Project to Other Hardware ............................................................... 105.4 Using the Library With an Application .......................................................................... 10

6 References .................................................................................................................. 10

List of Figures

1 Code Library Stack .......................................................................................................... 42 LMP90100 to MSP430 Connection Diagram ............................................................................ 83 LMP90100EB Jumper Settings ............................................................................................ 84 MSP-TS430RGC64USB Jumper Settings................................................................................ 9

List of Tables

1 Hardware Definition Files ................................................................................................... 22 Library Code.................................................................................................................. 33 Demo Applications Included With the Library............................................................................ 34 Register Access and Control Functions Provided by the Library...................................................... 55 LMP90100EB Jumper Settings ............................................................................................ 8

Page 2: MSP430 Interface to LMP90100 Code Library Application ...

Introduction www.ti.com

2 SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

1 IntroductionThe MSP430 is an ideal microcontroller solution for low-cost, low-power precision sensor applicationsbecause it consumes very little power. The LMP90100 is a highly integrated, multi-channel, low-power 24-bit sensor AFE capable of true continuous background calibration. This library provides functions tofacilitate the interfacing of any MSP430 device to a LMP90100. Any device within the MSP430 family canbe used with this library, made possible by hardware abstraction. Similarly, any SPI-capable interfacemodule within the MSP430 family is supported by the library. This allows the designer maximum flexibilityin choosing the best MSP430 device for the application. This document provides descriptive informationand instructions for using the library either for demonstration purposes or implementation into a project.This is the recommended starting point for developing software for the LMP90100 and MSP430combination. The software also demonstrates how to use some of the many advanced digital features andsensor interfacing capabilities of the LMP90100. The software examples have been developed for theMSP430F5528 breakout board, but can easily be ported to another hardware platform.

The LMP90100 is a highly integrated, multi-channel, low-power 24-bit sensor AFE capable of truecontinuous background calibration and an optimal match for the MSP430 ultra low power microcontrollers.The LMP90100 is equipped with a slave SPI port, through which it can communicate with an MSP430.The LMP90100 is ideally suited for low-noise, low-power precision sensing applications such as industrialtemperature measurements. The MSP430 is a great fit for applications where power conservation is apriority. The many power-saving mechanisms designed into the MSP430 make it ideal for suchapplications.

2 Purpose and ScopeTo aid in interfacing these devices, TI has produced a code library that eliminates the need to write low-level interface functions. It provides a boost in the development of an MSP430/LMP90100-based product,saving time and allowing quick progression to the application-specific aspects of the project. This library isdesigned to be used with any MSP430 device. Since a SPI master can be implemented using one ofmany peripherals within the MSP430 family, and since the peripherals available may differ by device andapplication, library calls are provided for each of these interfaces. The chosen interface is selected byassigning a value to a system variable, which causes the compiler to conditionally include the appropriatefunction calls. As such, application code utilizing the library remains portable between various MSP430devices, with minimal modification required.

Several complete example application projects are provided with the library. The purpose of these projectsis to demonstrate use of the library. It is not intended as a comprehensive guide to using the LMP90100,and it does not make use of all the features of these devices. It does, however, use all the register accessfunctions provided by the library.

3 File OrganizationThe library has been implemented with modular hardware abstraction. There is a header file specific toeach of the hardware components (LMP90100, MSP430, and the board). The hardware definition headerfiles are shown in Table 1. Table 2 shows the library code file and its header, and Table 3 shows thedemonstration applications that accompanies the library.

Table 1. Hardware Definition Files

Filename Description

TI_LMP90100.h Definitions specific to the LMP90100 device, including register locations andcommonly-used masks for use with these registers.

TI_MSP430.h

Definitions specific to the MSP430 device; primarily, the pins used in the SPIinterface. Definitions for USART0/1, USCI_A0/1/2/3, USCI_B0/1/2/3, and USI areincluded. Also, labels are defined for use with the system variableTI_LMP90100_SER_INTF. This selects the modules to be used for accessing theLMP90100 SPI interface.

TI_MSP430_hardware_board.h

Definitions specific to the board being used; that is, the connections between theMSP430 and LMP90100, such as the DRDYB and GPIO pins. SPI connections arenot defined here because they are defined inherently within TI_MSP430.h Thesystem variable TI_LMP90100_SER_INTF is defined in this file.

Page 3: MSP430 Interface to LMP90100 Code Library Application ...

www.ti.com File Organization

3SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

Table 2. Library Code

Filename Description

TI_MSP430_spi_USCIA0_5xx.c Function for accessing LMP90100 registers via SPI_USCIA0 module from MSP4305xx family

TI_MSP430_other_spi_modules\

Functions for accessing LMP90100 registers via other MSP430 SPI modules likeSPI_USART0, SPI_USART1, SPI_USCIA1, and so forth.

TI_MSP430_spi_USCIA1_5xx.cTI_MSP430_spi_USCIA2_5xx.cTI_MSP430_spi_USCIA3_5xx.cTI_MSP430_spi_USCIB0_5xx.cTI_MSP430_spi_USCIB1_5xx.cTI_MSP430_spi_USCIB2_5xx.cTI_MSP430_spi_USCIB3_5xx.cTI_MSP430_spi_USCIA0.cTI_MSP430_spi_USCIA1.cTI_MSP430_spi_USCIB0.cTI_MSP430_spi_USCIB1.cTI_MSP430_spi_USART0.cTI_MSP430_spi_USART1.cTI_MSP430_spi_USI.cTI_MSP430_spi.h Function declarations for TI_MSP430_spi_*.c

Table 3. Demo Applications Included With the Library

Demo Application Filename Description

Application1:Read/WriteLMP90100 Registers

demo-app01\main.c Application code with functions to demonstrate read/write ofLMP90100 registers

demo-app01\TI_LMP90100_register_settings.h

Application specific initialization values for the LMP90100registers

Application2:Normal StreamRead/WriteLMP90100 Registers

demo-app02\main.c Application code with functions to demonstrate normalstream read/write of LMP90100 registers

demo-app02\TI_LMP90100_register_settings.h

Application specific initialization values for the LMP90100registers

Application3:Normal Stream ReadADC Data withinterrupt

demo-app03\main.cApplication code with functions to demonstrate normalstream mode read of a single channel ADC data withDRDYB interrupt

demo-app03\TI_LMP90100_register_settings.h

Application specific initialization values for the LMP90100registers

Application4:Normal Stream ReadADC Data withinterrupt and CRCcheck

demo-app04\main.cApplication code with functions to demonstrate CRCchecking of normal stream mode read of ADC data withDRDYB interrupt

demo-app04\TI_LMP90100_register_settings.h

Application specific initialization values for the LMP90100registers

Application5:Normal Stream ReadADC Data and status(2 channels) withinterrupt and CRCcheck

demo-app05\main.cApplication code with functions to demonstrate normalstream mode read of ADC data, status, and CRC checkingfor 2 channels with DRDYB interrupt

demo-app05\TI_LMP90100_register_settings.h

Application specific initialization values for the LMP90100registers

Application6:Controlled StreamRead ADC Data andstatus (2 channels)with interrupt andCRC check

demo-app06\main.cApplication code with functions to demonstrate controlledstream mode read of ADC data, status, and CRC checkingfor 2 channels with DRDYB interrupt

demo-app06\TI_LMP90100_register_settings.h

Application specific initialization values for the LMP90100registers

Page 4: MSP430 Interface to LMP90100 Code Library Application ...

TI_MSP430_spi_xxxxxx.c SPI Library

msp430xxxxx.h

TI_LMP90100.h

TI_MSP430.h

TI_MSP430_hardware_board.h

Hardware

Definition

BoardDefinition

ChipDefinition

Standard MSP430Device Definition File

main.c Application

TI_LMP90100_register_settings.h

File Organization www.ti.com

4 SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

Table 3. Demo Applications Included With the Library (continued)Demo Application Filename Description

Application7:Using multiplexedDRDYB and SDO

demo-app07\main.cSame as Application5 except DRDYB is assumed to bemultiplexed with SDO instead of on D6. See the connectiondiagram in file main.c

demo-app07\TI_LMP90100_register_settings.h

Application specific initialization values for the LMP90100registers

Application8:Data Only Read ADCData and status (2channels) withinterrupt and CRCcheck

demo-app08\main.cApplication code with functions to demonstrate data onlymode read of ADC data, status, and CRC checking for 2channels with DRDYB interrupt

demo-app08\TI_LMP90100_register_settings.h

Application specific initialization values for the LMP90100registers

NOTE: The register setting values for TI_LMP90100_register_settings.h can easily be obtained fromthe “Register configuration file” saved from Sensor AFE Software [2]. The demo applicationcode include an initialization function to read the values stored in register settings file andinitialize the LMP90100 device registers.

Figure 1 shows a stack diagram of the library. Note that one of the files displayed in the stack is thestandard definition file for the specific MSP430 device being used. This file is included with thedevelopment environment being used to create the MSP430 software.

Figure 1. Code Library Stack

Page 5: MSP430 Interface to LMP90100 Code Library Application ...

www.ti.com Functions

5SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

4 FunctionsTable 4 shows the SPI register-access functions provided in the library, with a brief description.

Table 4. Register Access and Control Functions Provided by the Library

Function Name Description

void TI_LMP90100_SPISetup (void)Configures the SPI port assigned by theTI_LMP90100_SER_INTF system variable. Must be calledbefore calling any of the other functions.

void TI_LMP90100_SPIWriteReg (uint8_t addr, uint8_t value, uint8_t*pURA)

Writes "value" to a single configuration register at address"addr". Skips writing upper register address if upperregister address in "addr" matches previous upper registeraddress "*pURA".

uint8_t TI_LMP90100_SPIReadReg(uint8_t addr, uint8_t *pURA)

Reads a single register at address "addr" and returns thevalue read. Skips writing upper register address if upperregister address in "addr" matches previous upper registeraddress "*pURA".

void TI_LMP90100_SPINormalStreamWriteReg (uint8_t addr, uint8_t*buffer, uint8_t count, uint8_t *pURA)

Writes values to multiple configuration registers, the firstregister being at address "addr". The first data byte is at"buffer" and both "addr" and "buffer" are incrementedsequentially (within the LMP90100 and MSP430respectively) until "count" writes have been performed.Skips writing upper register address if upper registeraddress in "addr" matches previous upper register address"*pURA".

void TI_LMP90100_SPINormalStreamReadReg (uint8_t addr, uint8_t*buffer, uint8_t count, uint8_t *pURA)

Reads multiple configuration registers, the first registerbeing at address "addr”. The values read are depositedsequentially, starting at address "buffer", until "count"registers have been read. Skips writing upper registeraddress if upper register address in "addr" matchesprevious upper register address "*pURA".

void TI_LMP90100_SPINormalStreamReadADC (uint8_t addr, uint8_t*buffer, uint8_t count, uint8_t *pURA)

Special read for obtaining the value of sensor status, ADCdata, and CRC registers. Reads sensor status, ADC dataand CRC in normal stream mode at address "addr". Thevalues are deposited sequentially, starting at address"buffer", until "count" registers have been read. Skipswriting upper register address if upper register address in"addr" matches previous upper register address "*pURA".

void TI_LMP90100_SPIControlledStreamReadADC (uint8_t addr,uint8_t *buffer, uint8_t count, uint8_t *pURA)

Special read for obtaining the value of sensor status, ADCdata and CRC registers. Reads sensor status, ADC dataand CRC in controlled stream mode at address "addr". Thevalues are deposited sequentially, starting at address"buffer", until "count" registers have been read. Startaddress "addr" for controlled streaming is set up only once.Skips writing upper register address if upper registeraddress in "addr" matches previous upper register address"*pURA"

void TI_LMP90100_SPIEnableDataFirstMode(uint8_t addr, uint8_tcount, uint8_t *pURA)

Enables the data first mode of LMP90100. DATA_ONLY_1and DATA_ONLY_2 registers are initialized to “addr” and“count-1” and the LMP90100 is placed in the data firstmode. In order to use the data only read transactioncapability of the LMP90100, the data first mode must beenabled. Skips writing upper register address if upperregister address in "addr" matches previous upper registeraddress "*pURA"

void TI_LMP90100_SPIDataOnlyReadADC (uint8_t *buffer, uint8_tcount)

Special read for obtaining the value of channel status andADC data registers. Reads channel status and ADC data indata only transactions. The values are depositedsequentially, starting at address "buffer", until "count"registers have been read. Enable data first mode of theLMP90100 device before issuing this call.

void TI_LMP90100_SPIDisableDataFirstMode(uint8_t *buffer, uint8_tcount)

Disables the data first mode of LMP90100. Reads databytes of the data only transaction and then disables thedata first mode of LMP90100. The data only transactionbytes are deposited sequentially starting at address“buffer”, until “count” registers have been read.

Page 6: MSP430 Interface to LMP90100 Code Library Application ...

Using the Software www.ti.com

6 SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

Table 4. Register Access and Control Functions Provided by the Library (continued)Function Name Description

uint8_t TI_LMP90100_SPICRCCheck (uint8_t *buffer, uint8_t count)

Checks if CRC read from the device matches computedresult. CRC is computed for "count" bytes at address"buffer" and compared against CRC stored in“buffer[count]” and returns "CRC_PASS" or "CRC_FAIL"accordingly.

A version of these functions is provided for all MSP430 peripherals that are capable of communicatingusing the SPI protocol. These peripherals are:

• USART0 for 1xx, 2xx, and 4xx families

• USART1 for 1xx, 2xx, and 4xx families

• USCI_A0 for 5xx and 6xx families

• USCI_A1 for 5xx and 6xx families

• USCI_A2 for 5xx and 6xx families

• USCI_A3 for 5xx and 6xx families

• USCI_B0 for 5xx and 6xx families

• USCI_B1 for 5xx and 6xx families

• USCI_B2 for 5xx and 6xx families

• USCI_B3 for 5xx and 6xx families

• USCI_A0 for 2xx and 4xx families

• USCI_A1 for 2xx and 4xx families

• USCI_B0 for 2xx and 4xx families

• USCI_B1 for 2xx and 4xx families

• USI for G2xx value series family

5 Using the Software

5.1 PrerequisitesTo successfully compile, download and run the software described in this document, the following materialis needed:

• MSP430 Target Board MSP-TS430RGC64USB Board

• LMP90100 Evaluation Board LMP90100EB

• MSP430 USB Debugging Interface MSP430-FET430UIF

• IAR Embedded Workbench or TI Code Composer Studio™ for MSP430

The software can be adapted to run on other MSP430 hardware boards as well. For instructions, seeSection 5.3.

A free, code size limited, but fully functional edition of IAR Embedded Workbench (IAR Kickstart) isavailable from the IAR Systems website (www.iar.com) or from the TI MSP430 software tools page.

http://www.ti.com/lsds/ti/microcontroller/16-bit_msp430/msp430_software_landing.page

As an alternative to IAR Embedded Workbench, it would be possible to use Code Composer Studio. A trialedition of the Code Composer Studio is available from the TI MSP430 software tools page.

5.2 Getting StartedFollow these simple steps to get your application up and running:

Page 7: MSP430 Interface to LMP90100 Code Library Application ...

www.ti.com Using the Software

7SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

1. Install IAR Workbench.2. Download the source code for this application report and unzip the files to your working directory.3. Open IAR Embedded Workbench and create a new project:

a. Select Project → Create new projectb. Select tool chain MSP430.c. Base the project on the empty project template.d. Save (you will also be asked to save the current workspace).

4. Add the following C files from the software that you downloaded and unzipped in step 2:a. All C files from the code\library folderb. All C files from the code\library\TI_MSP430_other_spi_modules folderc. All C files from the code\demo-application-examples\demo-app01 folder

5. Open the "options..." dialog for the new project by right clicking the project name in the workspacewindow. A window should appear.a. Under "General options", select the MSP device. For the MSP-TS430RGC64USB target board,

use MSP430F5528.b. Under "C/C++ compiler", click on the preprocessor pane.

i. The "Ignore standard include directories" tick box should not be ticked.ii. In the "Additional include directories", add include paths telling the compiler where to find the

header files included by the C files. You should add the $PROJ_DIR$\code\include folder.c. Under "Debugger", select "FET Debugger" from the "Driver" drop down list.d. Under "FET Debugger", in the "Connection" section, choose the connection type of the FET tool

(for example, Texas Instruments USB-IF). Leave the rest of the settings as is.6. Click “OK” to close the options window.7. Select “Project → Rebuild All”. There should be no errors or warnings when IAR rebuilds the

executables (if not done already, you will also be asked to save the current workspace).8. The configuration of the hardware definition files in the library as distributed by TI is for anMSP430F5528 equipped board. The system variable TI_LMP90100_SER_INTF defined withinTI_hardware_board.h identifies USCIA0 as the connected SPI port to control LMP90100. Peripheralpinouts can change slightly between individual MSP430 devices and families. For this reason,TI_MSP430.h identifies the pins that correspond to a peripheral for any given device.

Page 8: MSP430 Interface to LMP90100 Code Library Application ...

LMP90100EB

UCA0CLK (J3.33)

UCA0SIMO (J3.37)

UCA0SOMI (J3.38)

P2.5 (GPIO) (J2.31)

SDO/DRDYB (J8.1)

CSB (J8.4)

D6/DRDYB (JP8.1)P2.4 (GPIO) (J2.30)

VDD3P3 (JP12.13)

GND (JP12.4)

GND (J8.5)

VCC (J5.1)

GND (J5.2)

MSP - TS430RGC64USB

DVSS1 (J1 .16)

SDI (J8.2)

SCLK (J8.3)

Using the Software www.ti.com

8 SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

8. Connect the LMP90100 evaluation board SPI interface lines to the MSP430 target board SPI port asshown in Figure 2.

Figure 2. LMP90100 to MSP430 Connection Diagram

9. The LMP90100 evaluation board jumper connections can be seen in Figure 3 and Table 5. Jumpersnot shown can be left unpopulated.

Figure 3. LMP90100EB Jumper Settings

Table 5. LMP90100EB Jumper Settings

Jumpers Pin PurposeJP1: VA_EXT P2-P3 Source VA with the 3.3V from the SPIO connectorJP2: VIO_EXT P2-P3 Source VIO with the 3.3V from the SPIO connector

JP4 P1-P2 Get 3.3V from the SPIO connectorJP6 P1-P2 Connect VA supply to the LMP90100

Page 9: MSP430 Interface to LMP90100 Code Library Application ...

www.ti.com Using the Software

9SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

Table 5. LMP90100EB Jumper Settings (continued)Jumpers Pin Purpose

JP7 P1-P2 Connect VIO supply to the LMP90100JP10: VIN_JMP P1-P2 Connect a DC input to VIN0.JP10: VIN_JMP P3-P4 Connect a DC input to VIN1.JP10: VIN_JMP P5-P6 Connect a DC input to VIN2JP10: VIN_JMP P7-P8 Connect a DC input to VIN3

JP13: VREF_JMP1 P1-P2 VREFP1 = VAJP13: VREF_JMP1 P9-P10 VREFN1 = groundJP14: VREF_JMP2 P1-P2 Connect VREFP1 source to the LMP90100JP14: VREF_JMP2 P3-P4 Connect VREFN1 source to the LMP90100

10. Attach the MSP430 FET to your PC. If you are running Windows and using the USB FET tool for thefirst time, you will asked to install some drivers for the tool. For Windows they are located in$IAR_INSTALL_DIR$\430\drivers\TIUSBFET.

11. Attach the MSP430 FET to the MSP430 target board using the JTAG connector. The VCC powerselect jumper JP3 should be set to 1-2 (int) where the board is powered from the FET alone. TheMSP430 target board jumper connections can be seen in Figure 4.

Figure 4. MSP-TS430RGC64USB Jumper Settings

12. Select Project → Debug. IAR will now establish a connection with the target MCU, download theapplication and program the MSP430. The debugger will be started, halting the target at main ().

13. Demo_app01 is a simple example that demonstrates the SPI calls to write and successfully read backa LMP90100 register. The onboard LED on the MSP430 target board is setup to blink continuously ifthe value read back matches the value written.

14. Steps 3 to 13 can be followed to exercise other demo applications included with the library as well.

Page 10: MSP430 Interface to LMP90100 Code Library Application ...

Using the Software www.ti.com

10 SNAA134A–February 2012–Revised May 2013Submit Documentation Feedback

Copyright © 2012–2013, Texas Instruments Incorporated

MSP430 Interface to LMP90100 Code Library

5.3 Adapting the Demo Project to Other HardwareThe procedure for adapting this code to other hardware is as follows:1. Edit the pin assignments within TI_MSP430.h for the interface modules being used. It is not necessary

to modify the pins for the interfaces not selected for use with the SPI bus, as they will not bereferenced by the library. The labels being referenced in the #define assignments will be drawn fromthe standard definition file (msp430.h) listed at the top of TI_MSP430.h.

2. Edit the pin assignments in TI_MSP430_hardware_board.h, taking into account all the necessaryconnections on the board being used. The assigned labels are drawn from the standard definition file(msp430.h) listed at the top of TI_MSP430.h.

3. Assign the proper values to TI_LMP90100_SER_INTF in TI_MSP430_hardware_board.h. The labelsavailable for assignment can be found at the bottom of TI_MSP430.h.

4. Set up appropriately the function to configure the system clock source and clock rate. This will dependon your hardware and the particular MSP430 MCU in use.

5. Make sure the physical hardware connections between the MSP430 target board and LMP90100EBare modified according to the pin assignments above.

6. Rebuild the project and download the code image after making these changes. The application shouldfunction as described earlier.

5.4 Using the Library With an ApplicationThe same procedure as described in Section 5.2 should be applied in order to adapt the library to the newhardware.

The TI_LMP90100_SPISetup function should always be called after a POR event within the MSP430.After this, the access of registers is straightforward.

6 References1. LMP90100, LMP90099, LMP90098, and LMP90097 Sensor AFE System: Multi-Channel, Low-Power

24-Bit Sensor AFE With True Continuous Background Calibration, Data Sheet (SNAS510)2. LMP90100 Sensor AFE Evaluation Board User's Guide (SNAU028)3. MSP430F551x and MSP430F552x Mixed Signal Microcontroller Data Sheet (SLAS590)4. MSP430x5xx and MSP430x6xx Family User’s Guide (SLAU208)5. MSP430 Hardware Tools User's Guide User's Guide (TS430RGC64USB) (SLAU278)6. MSP430 Hardware Tools User's Guide User's Guide (MSP-FET430UIF) (SLAU278)7. CRC Implementation With MSP430 (SLAA221)8. MSP430 Interface to CC1100/2500 Code Library (SLAA325)

Page 11: MSP430 Interface to LMP90100 Code Library Application ...

IMPORTANT NOTICE FOR TI DESIGN INFORMATION AND RESOURCES

Texas Instruments Incorporated (‘TI”) technical, application or other design advice, services or information, including, but not limited to,reference designs and materials relating to evaluation modules, (collectively, “TI Resources”) are intended to assist designers who aredeveloping applications that incorporate TI products; by downloading, accessing or using any particular TI Resource in any way, you(individually or, if you are acting on behalf of a company, your company) agree to use it solely for this purpose and subject to the terms ofthis Notice.TI’s provision of TI Resources does not expand or otherwise alter TI’s applicable published warranties or warranty disclaimers for TIproducts, and no additional obligations or liabilities arise from TI providing such TI Resources. TI reserves the right to make corrections,enhancements, improvements and other changes to its TI Resources.You understand and agree that you remain responsible for using your independent analysis, evaluation and judgment in designing yourapplications and that you have full and exclusive responsibility to assure the safety of your applications and compliance of your applications(and of all TI products used in or for your applications) with all applicable regulations, laws and other applicable requirements. Yourepresent that, with respect to your applications, you have all the necessary expertise to create and implement safeguards that (1)anticipate dangerous consequences of failures, (2) monitor failures and their consequences, and (3) lessen the likelihood of failures thatmight cause harm and take appropriate actions. You agree that prior to using or distributing any applications that include TI products, youwill thoroughly test such applications and the functionality of such TI products as used in such applications. TI has not conducted anytesting other than that specifically described in the published documentation for a particular TI Resource.You are authorized to use, copy and modify any individual TI Resource only in connection with the development of applications that includethe TI product(s) identified in such TI Resource. NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE TOANY OTHER TI INTELLECTUAL PROPERTY RIGHT, AND NO LICENSE TO ANY TECHNOLOGY OR INTELLECTUAL PROPERTYRIGHT OF TI OR ANY THIRD PARTY IS GRANTED HEREIN, including but not limited to any patent right, copyright, mask work right, orother intellectual property right relating to any combination, machine, or process in which TI products or services are used. Informationregarding or referencing third-party products or services does not constitute a license to use such products or services, or a warranty orendorsement thereof. Use of TI Resources may require a license from a third party under the patents or other intellectual property of thethird party, or a license from TI under the patents or other intellectual property of TI.TI RESOURCES ARE PROVIDED “AS IS” AND WITH ALL FAULTS. TI DISCLAIMS ALL OTHER WARRANTIES ORREPRESENTATIONS, EXPRESS OR IMPLIED, REGARDING TI RESOURCES OR USE THEREOF, INCLUDING BUT NOT LIMITED TOACCURACY OR COMPLETENESS, TITLE, ANY EPIDEMIC FAILURE WARRANTY AND ANY IMPLIED WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUALPROPERTY RIGHTS.TI SHALL NOT BE LIABLE FOR AND SHALL NOT DEFEND OR INDEMNIFY YOU AGAINST ANY CLAIM, INCLUDING BUT NOTLIMITED TO ANY INFRINGEMENT CLAIM THAT RELATES TO OR IS BASED ON ANY COMBINATION OF PRODUCTS EVEN IFDESCRIBED IN TI RESOURCES OR OTHERWISE. IN NO EVENT SHALL TI BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL,COLLATERAL, INDIRECT, PUNITIVE, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES IN CONNECTION WITH ORARISING OUT OF TI RESOURCES OR USE THEREOF, AND REGARDLESS OF WHETHER TI HAS BEEN ADVISED OF THEPOSSIBILITY OF SUCH DAMAGES.You agree to fully indemnify TI and its representatives against any damages, costs, losses, and/or liabilities arising out of your non-compliance with the terms and provisions of this Notice.This Notice applies to TI Resources. Additional terms apply to the use and purchase of certain types of materials, TI products and services.These include; without limitation, TI’s standard terms for semiconductor products http://www.ti.com/sc/docs/stdterms.htm), evaluationmodules, and samples (http://www.ti.com/sc/docs/sampterms.htm).

Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265Copyright © 2017, Texas Instruments Incorporated