Lecture Topic 1.3.1
Lecture Topic 1.3.1
Data Communication
The 8051 microcontroller is parallel device that transfers eight bits of data simultaneously over eight
data lines to parallel I/O devices. Parallel data transfer over a long is very expensive. Hence, a serial
communication is widely used in long distance communication. In serial data communication, 8-bit
data is converted to serial bits using a parallel in serial out shift register and then it is transmitted over
a single data line. The data byte is always transmitted with least significant bit first.
Basics of Serial Data Communication
There are different types of Communication Links explained below.
1. Simplex communication link: In simplex transmission, the line is dedicated for transmission.
2. Half duplex communication link: In half duplex, the communication link can be used for either
transmission or reception. Data is transmitted in only one direction at a time.
3. Full duplex communication link: If the data is transmitted in both ways at the same time, it is a full
duplex i.e. transmission and reception can proceed simultaneously. This communication link requires two
wires for data, one for transmission and one for reception.
Types of Serial communication:
uses a common clock to synchronize the receiver and the transmitter. First the synch character is sent and
then the data is transmitted. This format is generally used for high speed transmission. In
Synchronous serial data communication, a block of data is transmitted at a time.
2. Asynchronous Serial data transmission: In this, different clock sources are used for transmitter
and receiver. In this mode, data is transmitted with start and stop bits. A transmission begins with
start bit, followed by data and then stop bit. For error checking purpose parity bit is included just prior to
stop bit. In Asynchronous serial data communication, a single byte is transmitted at a time.
Baud rate:
The rate at which the data is transmitted is called baud or transfer rate. The baud rate is the
reciprocal of the time to send one bit. In asynchronous transmission, baud rate is not equal to number of
bits per second. This is because; each byte is preceded by a start bit and followed by parity and stop bit.
For example, in synchronous transmission, if data is transmitted with 9600 baud, it means that 9600 bits
are transmitted in one second. For bit transmission time = 1 second/ 9600 = 0.104 ms.
8051 Serial Communication
The 8051 supports a full duplex serial port. Three special function registers support serial
communication.
1. SBUF Register: Serial Buffer (SBUF) register is an 8-bit register. It has separate SBUF
registers for data transmission and for data reception. For a byte of data to be transferred via the TXD line,
it must be placed in SBUF register. Similarly, SBUF holds the 8-bit data received by the RXD pin and
read to accept the received data.
2. SCON register: The contents of the Serial Control (SCON) register are shown below.
This register contains mode selection bits, serial port interrupt bit (TI and RI) and also the ninth data bit
for transmission and reception (TB8 and RB8).
3. PCON register: The SMOD bit (bit 7) of PCON register controls the baud rate in asynchronous
mode transmission.
SERIAL COMMUNICATION MODES
1.Mode 0. In this mode serial port runs in synchronous mode. The data is transmitted and received
through RXD pin and TXD is used for clock output. In this mode the baud rate is 1/12 of clock
frequency.
2.Mode 1. In this mode SBUF becomes a 10 bit full duplex transceiver. The ten bits are 1 start bit,
8 data bit and 1 stop bit. The interrupt flag TI/RI will be set once transmission or reception is over.
In this mode the baud rate is variable and is determined by the timer 1 overflow rate.
3.Mode 2. This is similar to mode 1 except 11 bits are transmitted or received. The 11 bits are, 1
start bit, 8 data bits, a programmable 9th data bit, 1 stop bit.
Baud rate = [2smod/64] x Oscillator Clock Frequency
RS-232 standards. To allow compatibility among data communication equipment made by various
manufactures, interfacing standard called RS232 was set by the Electronics Industries Association
(EIA) in 1960. Since the standard was set long before the advent of logic family, its input and output
voltage levels are not TTL compatible.
In RS232, a logic one (1) is represented by -3 to -25V and referred as MARK while logic zero
(0) is represented by +3 to +25V and referred as SPACE. For this reason, to connect any RS232 to a
microcontroller system we must use voltage converters such as MAX232 to convert the TTL logic level to
RS232 voltage levels and vice-versa. MAX232 IC chips are commonly referred as line drivers.
In RS232 standard we use two types of connectors. DB9 connector and DB25 connector.
DB9 Male Connector DB25 Male Connector
i. TEXTBOOKS
T1 Kenneth Ayala, The 8051 Microcontroller, Cengage Learning India, 3rd Edition, Nov 2007
T2 B. Kanta Rao, Embedded Systems, PHI, 1st Edition, January 2011
T3 John Boxall, Arduino Workshop: A Hands-On Introduction with 65 Projects, No Starch Press, 1st Edition,
May 2013
ii.REFERENCE BOOKS
R1 B. Ram, Fundamentals of Microprocessors and Microcontrollers, DRP, 8th Edition, Nov 2021
R2 Massimo Banzi, Getting Started with Arduino, Make Community LLC, 3rd Edition, Jan 2015
R3 Jeremy Blum, Exploring Arduino: Tools and Techniques for Engineering Wizardry, Wiley, 1st Edition,
Aug 2013
B. Video Links:
1. https://www.youtube.com/watch?v=bX0-9vBbPMs
2. https://www.youtube.com/watch?v=yFIiJ6bJUNE
3. https://www.youtube.com/watch?v=-UXpfAggE5Q
4. https://www.youtube.com/watch?v=RRMWNTZ59ZA