226
USCI SPI – Interfacing MPL115A1 Atmospheric Pressure Sensor
We have already seen that MSP430’s USI module can be used to implement both I2C and SPI
communication platforms. However, there will be times we will have to use USCI modules. USCI is a
bit complicated and is a bit difficult to use in simple terms. Here in this article, however, I kept things
simple and projected ways to use this module simply. Four examples of USCI module in I2C nd SPI
modes will be presented in this article. The first one will demo how to interface a MSP430 device with
a MPL115A1 atmospheric pressure sensor in a full-duplex SPI bus. Full-duplex SPI bus is needed the
most when interfacing sensors, RTCs, SPI-based memory chips, SD cards, etc.
Code Example
HW_SPI.h
#include <msp430.h>
void HW_SPI_init(void);
void SPI_write(unsigned char tx_data);
unsigned char SPI_read(void);
unsigned char SPI_transfer(unsigned char tx_data);