Monday, November 14, 2011

SCON (serial control) Register

Its used to program the start bit, the stop bit and the data bits of data framing among other things.
8 bit register from MSB ---- to ----- LSB
SM0
SM1
SM2
REN
TB8
RB8
T1
R1

SM0
SM1
These 2 bits determine the framing of data by specifying number of bits per character and start and stop bits. they take following combo.
SM0
SM1
MODE
0
0
Serial mode 0
0
1
Serial mode 1, 8 bit data, 1 stop bit, 1 start bit.
1
0
Serial mode 2
1
1
Serial mode 3
SM2
This enables multiprocessing capabilities of 8051. Usually set to 0
REN
Also referred to as SCON.4 as SCON is a bit addressable register. This is receive enable. When high or 1 it allows 8051 to receive data from RxD pin.  Used or access as SET SCON.4 and CLR SCON.4. very useful in blocking external serial reception.
TB8
Transfer bit 8. Used for serial mode 2 and 3 not generally used so set it always to 0
RB8
Receive bit 8. Again used for serial mode 2 and 3 not used so set it to 0
T1
Transmit interrupt. Important flag bit in SCON register. When 8051 finishes transfer of 8 bit character, it raises the T1 flag to indicate that it is ready to transfer another byte. Is used at beginning of stop bit.
R1
Receive interrupt. Another important flag bit in SCON register. When 8051 finishes receiving data i.e when data is successfully stored in SBUF it raises R1 flag to indicate byte is received and to be picked before it gets lost.

13 comments:

  1. Replies
    1. What i remember is that SM2 is used to communicate with other microcontrollers cause no other communication protocols were available at that period of time for communication among microcontrollers....

      Hope this helps....

      Delete
    2. sm2 pin in serial control used for communication in between two processors like cpu-cpu communication.

      Delete