Page 339 - ARM Based Microcontroller Projects Using MBED
P. 339
CHAPTER
13
UART Projects
13.1 OVERVIEW
In this chapter we shall be developing projects using the serial communication module
UART with the Nucleo-F411RE development board.
Serial communication is a simple means of sending data to long distances quickly and re-
liably. The most commonly used serial communication method is based on the RS232 stan-
dard. In this standard data is sent over a single line from a transmitting device to a receiving
device in bit serial format at a prespecified speed, also known as the Baud rate, or the number
of bits sent each second. Typical Baud rates are 4800, 9600, 19200, 38400, etc.
RS232 serial communication is a form of asynchronous data transmission where data is
sent character by character. Each character is preceded with a Start bit, seven or eight data
bits, an optional parity bit (check bit), and one or more stop bits. The most commonly used
format is eight data bits, no parity bit, and one stop bit. The least significant data bit is trans-
mitted first, followed by the other bits, and the most significant bit transmitted last.
Data in serial asynchronous communication can either be sent using the standard RS232
protocol or two devices can simply be connected together provided they satisfy the logic gate
interface rules (e.g., TTL to TTL, or TTL to CMOS, etc.). In the RS232 protocol, a logic HIGH is
defined to be at 12V, and a logic 0 is at +12V. Fig. 13.1 shows how character A (ASCII binary
pattern 0010 0001) is transmitted over a serial line via the RS232 protocol. The line is normally
idle at 12V. The start bit is first sent by the line going from HIGH to LOW. Then eight data
bits are sent starting from the least significant bit. Finally the stop bit is sent by raising the line
from LOW to HIGH.
FIG. 13.1 Sending character “A” in serial format.
325
ARM-based Microcontroller Projects Using mbed # 2019 Elsevier Ltd. All rights reserved.
https://doi.org/10.1016/B978-0-08-102969-5.00013-6