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

9.2. SERIAL COMMUNICATION CONCEPTS 271
Local Interconnect Network (LIN). The LIN is a common network used in the automotive
industry. The LIN protocol provides a single master, multiple slave communication link that
employs a single wire to transmit data.The LINprotocol is based on the UART communication
system. The MSP430 provides automatic baud rate detection for LIN communications.
The Serial Peripheral Interface (SPI) provides synchronous communications between a receiver
and a transmitter. The SPI system maintains synchronization between the transmitter and
receiver pair using a common clock provided by the master designated microcontroller.
The USCI B modules also provide support for SPI communications and Inter-Integrated
Communication (I
2
C) communications. The I
2
C is one of prominent communication modes used
when multiple serial devices are interconnected using a serial bus. The I
2
C bus is a two-wire bus
with the serial data line (SDL) and the serial clock line (SCL). By configuring devices connected
to the common I
2
C line as either a master device or a slave device, multiple devices can share
information using the common bus. The I
2
C system is used to link multiple peripheral devices to a
microcontroller or several microcontrollers together in a system.
Space does not permit an in depth discussion of all communication features of the USCI
system. We concentrate on the UART, SPI and I
2
C systems. For each system, we provide a tech-
nical overview, a review of system registers and code examples. We begin with a review of serial
communication concepts.
9.2 SERIAL COMMUNICATION CONCEPTS
Before we delve into the serial communication technologies, in this section, we first review common
serial communication terminology.
Asynchronous versus synchronous serial transmission: In serial communications, the trans-
mitting and receiving devices must agree in the ‘rules of engagement by using a common data rate
and protocol. This allows both the transmitter and receiver to properly coordinate data transmis-
sion/reception. There are two basic methods of maintaining coordination or ‘sync’ between the
transmitter and receiver: asynchronous and synchronous.
In an asynchronous serial communication system, such as the UART aboard the MSP430
microcontroller, framing bits are used at the beginning and end of a data byte. These framing bits
alert the receiver that an incoming data byte has arrived and also signals the completion of the
data byte reception. The data rate for an asynchronous serial system is typically much slower than
the synchronous system, but it only requires a single wire between the transmitter and receiver for
simplex (one way) communication.
A synchronous serial communication system maintains “sync between the transmitter and
receiver by employing a common clock between the two devices. Data bits are sent and received on
the edge of the clock. This allows data transfer rates higher than with asynchronous techniques but
requires two lines, data and clock, to connect a receiver and a transmitter for simplex communications.

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