User manual

LPCXpresso Experiment Kit - User’s Guide
Page 100
Copyright 2013 © Embedded Artists AB
7.15 Work with a Serial Bus UART
In this experiment you will learn how to work with the Universal Asynchronous Receiver/Transmitter, or
UART for short. The term asynchronous refers to the fact that no explicit clock signal is transmitted.
The transmitter and receiver must agree beforehand on the bit rate, i.e., how long time a transmitted bit
shall take. The idle state (no transmission) is a high signal. Transmission begins with a start bit, which
is low. The negative edge is detected by the receiver and 1.5 bit periods after this, bit sampling begins.
Eight data bits are sampled. The least significant bit (LSB) is typically transmitted first. An optional
parity bit is then transmitted (for error checking of the data bits). Often this bit is omitted if the
transmission channel is assumed to be noise free or if there are error checking higher up in the
protocol layers. The transmission is ended by a stop bit. Typically one bit, but 1.5 and 2 bits are
sometimes also used. Most common for inter-board communication is 8N1, meaning 8 data bits, no
parity and one stop bit.
Figure 57 UART Communication
On a side note, there are methods to determine the bit rate of a received signal but that is out of scope
for this experiment.
An UART channel consists of two signals (besides ground):
TXD: transmit data, direction from transmitter to receiver. This is an output.
RXD: receive data, direction from transmitter to receiver. This is an input.
TXD and RXD are crossed between transmitter and receiver, i.e., TXD is connected to RXD and vice
versa. For more information about asynchronous serial communication, see
http://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter and
http://en.wikipedia.org/wiki/Asynchronous_serial_communication.
Note and understand the difference between the signaling method (asynchronous serial
communication) and standards of voltage signaling. The signal drawn in Figure 57illustrates the signal
to/from the UART peripheral inside the LPC111x. It is a 3.3V logic signal. This is common for
communication between units on the same board, or closely mounted boards. RS232 is a common
signaling standard with large voltage swings (+- 3-15V) that is used between units that are physically
apart. RS422 and RS485 are other commonly used signaling standards.
Communication is normally point-to-point, meaning that a transmitter sends data to one receiver. There
are signaling standards that also supports network topologies (for example RS422 and RS485). Higher
protocol layers must then be involved in implementing addressing schemes between the nodes.
Note that this experiment requires a UART-to-USB cable from FTDI (TTL-232R-3V3, Digikey: 768-
1015-ND or Mouser: 895-TTL-232R-3V3). This cable is a bridge between a UART channel and USB
communication. Via USB it creates a virtual COM port on a PC. The UART communication is tunneled
over USB to the PC. When plugging in the USB connector on a PC a driver will be installed. See
FTDI’s installation guides for details how to install the driver for different operating systems:
http://www.ftdichip.com/Support/Documents/InstallGuides.htm
Start D0 D1 D2 D3 D4 D5 D6 D7 Parity Stop
bit (lsb) (msb) bit bit
TXD
Bits
Sampling
1.5 bit 1.0 bit etc.
Duration of one byte (10-12 bit periods)