O'Reilly logo

Microcontroller Programming and Interfacing Texas Instruments MSP430 by Daniel J. Pack, Steven F. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

269
CHAPTER 9
Communic ation Systems
Objectives: After reading this chapter, the reader should be able to
Describe the differences between serial and parallel communication methods
Present the features of the MSP430 microcontroller’s Universal Serial Communication Inter-
face (USCI)
Illustrate the operation of the Universal Asynchronous Serial Receiver and Transmitter
(UART) mode of the USCI
Program the UART for basic transmission and reception
Describe the operation of the Serial Peripheral Interface (SPI)
Configure a SPI-based system to extend the features of the MSP430 microcontroller
Describe the purpose and function of the Inter-Integrated Communication (I
2
C) mode
Program the I
2
C communication system for a specific application
9.1 MOTIVAT ION
Microcontrollers must often exchange data with other microcontrollers or peripheral devices. For
such applications, data may be exchanged by using parallel or serial techniques. With parallel tech-
niques an entire byte (or a set of bits) of data is typically sent simultaneously from a transmitting
device to a receiver device. While this is efficient from a time point of view it requires eight separate
lines for the data transfer.
In serial transmission, data is sent a single bit at a time. For a byte size data transmission, once
eight bits have been received at a receiver, the data byte is reconstructed. While this is inefficient
from a time point of view, it only requires a line (or two) to transmit the data. Serial transmission
helps minimize the use of precious microcontroller input/output pins.
The MSP430 microcontroller is equipped with the Universal Serial Communication Interface
(USCI). The system is equipped with a host of different serial communication subsystems as shown
in Figure 9.1.The USCI consists of two different communication subsystems: USCI A type modules
and USCI B modules. Each microcontroller in the MSP430 line has a complement of A and B type
USCI modules. Should a specific MSP430 microcontroller type have more than one of the A and/or
B type modules, they are numbered sequentially.
270 9. COMMUNICATION SYSTEMS
Universal Serial
Communication Interface (USCI)
USCI_A0
- UART mode
- IrDA pulse shaping mode
- LIN communication automatic
baud rate detection
- SPI mode
USCI_B0
- I
2
C mode
- SPI mode
USCI_A1
- UART mode
- IrDA pulse shaping mode
- LIN communication automatic
baud rate detection
- SPI mode
USCI_B0
- I
2
C mode
- SPI mode
Figure 9.1: MSP430 Universal Serial Communication Interface (USCI).
Example: Describe the USCI features of the MSP430F5438.
Answer: The MSP430F5438 is equipped with four USCI type A modules designated USCI_A0,
USCI_A1, USCI_A2, and USCI_A3 and four type B modules designated USCI_B0, USCI_B1,
USCI_B2, and USCI_B3
As can be seen in the figure USCI A modules provide support for:
Universal Asynchronous Serial Receiver and Transmitter (UART). The UART provides a
serial data link between a transmitter and a receiver.The transmitter and receiver pair maintains
synchronization using start and stop bits that are embedded in the data stream.
Infrared Data Association (IrDA). The IrDA protocol provides for a short-range data link
using an infrared link. It is used in various communication devices, personal area networks and
instrumentation.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required