Monday, March 4, 2019

FMA_Unit_4.4 8051 Serial Communications registers


BAUD RATE: The transmitter and receiver are configured to communicate at some data transfer rate before communication starts. This data transfer rate or number of bits transmitted per second is called baud rate for handling serial communication.

UART: It stands for Universal Asynchronous Receiver-Transmitter. A UART generates its internal data clock to the microcontroller. It synchronizes that clock with the data stream by using the start bit transition. The receiver needs the baud rate to know ahead of time to properly receive the data stream.

C. 8051 Serial Communications registers
1. SBUF Register (Serial Buffer register)
  •  Buffer which is used for holding the data before sending / after receiving is called Serial Buffer.
  •  In 8051 Micro-controller there are two 8 bits serial buffer register.
  • One is write only and is used to hold data is to be transmitted from micro-controller via the TxD pin P3.1.
  • While other is read only and used to hold data that is received from the external source via the RxD pin P3.0.






2. SCON Register (Serial Control register)
D7
D6
D5
D4
D3
D2
D1
D0
SM0
SM1
SM2
REN
TB8
RB8
TI
RI

Bit 7 & 6: SM0 & SM1 (Serial Mode control Bits)
These bits are serial mode bits and are used for selecting the operating modes of serial port.
SM0
SM1
Mode
Description
Baud Rate
0
0
0
8 bit Shift Register
Fixed Baud Rate (fosc / 12)
0
1
1
8 bit UART
Variable Baud Rate
1
0
2
9 bit UART
Fixed Baud Rate (fosc / 12 or focs/32)
1
1
3
9 bit UART
Variable Baud Rate
Mode 0 and Mode 1 used for one serial port
Mode 2 and Mode 3 used for one serial port

Bit 5: SM2 (Multiprocessor control bit)
In 8051, there is only one serial port. So this is don’t care condition.
SM2 = 1, Multiprocessor serial port (Two serial Port used)
SM2 = 0, Uniprocessor serial port (One serial Port used)

Bit 4: REN (Receiver enable bit)
This bit allows the data from external peripheral device to micro-controller.
                    REN = 1, receiver is enable
                    REN = 0, receiver is disable

Bit 3: TB8 (Consider when serial Mode 2 and serial Mode 3 is used)
In 8051, there is only one serial port. So this is don’t care condition.
It is the 9th programmable transmitted bit along with data byte in multiprocessor mode.
                    TB8 = 1, the byte transmitted is data bit
                    TB8 = 0, the byte transmitted is address bit

Bit 2: RB8 (Consider when serial Mode 2 and serial Mode 3 is used)
In 8051, there is only one serial port. So this is don’t care condition.
It is the 9th received programmable bit along with data byte in multiprocessor mode.
                    RB8 = 1, the byte received is data bit
                    RB8 = 0, the byte received is address bit

Bit 1: TI (Transmit Interrupt flag)
TI = 1, When one byte of data transmission is completed
TI = 0, When one byte of data transmission is not completed

Bit 0: RI (Receive Interrupt flag)
RI = 1, When one byte of data reception is completed
RI = 0, When one byte of data reception is not completed


3. PCON Register (Power Control register)
D7
D6
D5
D4
D3
D2
D1
D0
SMOD
--
--
--
GF1
GF0
PD
IDL

Bit 7: SMOD (Serial Mode selection bit)
Speed of serial communication is decided by this SMOD bit.
When SMOD is reset then it is indicated that data is transmitted or received by microcontroller at defined baud rate.  (Baud Rate = fosc/64)
When SMOD is set then it is indicated that data is transmitted or received by microcontroller at double the defined baud rate. (Baud Rate = fosc/32)

Bit 6, 5 & 4: Reserve bit

Bit 3 & 2: GF1 and GF0 (General purpose flags)
          These flags are used by the programmer to indicate the status of the various conditions

Bit 1: PD (Power Down)
          When PD is set, internal oscillator stops and power is reduced to 2V from 5V for power saving purpose.

Bit 0: IDL (Power saving mode)
When IDL is set, the clock signal is stopped to CPU, but is supplied to interrupt, timer and serial port blocks. It can be reset by hardware interrupt.


No comments:

Post a Comment