Project

General

Profile

Universal Serial Communication Interface (USCI)

Description of USCI

The USCI is a hardware peripheral found in many MSP430 devices that can support UART, I2C, SPI, and other serial communication protocols. It is more powerful than the USI found in MSP430 devices that do not have a USCI.

The USCI has two parts, USCI_A and USCI_B:
USCI_A
  • UART
  • SPI
  • Automatic baud rate detection
USCI_B

Both USCI_A and USCI_B operate simultaneously, and multiple USCI modules may be found on a device. The A and B parts of the USCI may be driven off different clock lines (ACLK, SMCLK, UC0CLK), and have individual prescalers to independently set communication rate.

Pin functions

All applications of the USCI require that the USCI use pins on the device to receive or transmit data. By default, pins are configured to be GPIO input, and must be assigned to the USCI using the Pin select register. In the device-specific datashet, there is a table of Pin Functions for every port. This table lists the various functions each pin of the port can perform, and how to set the select registers to enable each function. For example, on the MSP430g2553, P1.1 is by default an I/O input, but also can be the RX of the UART. To select P1.1 for RX of the UART, set the P1SEL.1 and P1SEL2.1 control bits:
#define RXD BIT1 //P1.1 used for RXD of UART
//Put following in main() or setup functions
P1SEL |= RXD;
P1SEL2 |= RXD;

To change the pin function back to I/O:
P1SEL &= ~RXD;
P1SEL2 &= ~RXD;