Wednesday, September 4, 2013

Serial Interface
  • The serial port of 8051 is full duplex, i.e., it can transmit and receive simultaneously.
  • The register SBUF is used to hold the data. The special function register SBUF is physically two registers. 
  • One is, write-only and is used to hold data to be transmitted out of the 8051 via TXD. 
  • The other is, read-only and holds the received data from external sources via RXD. Both mutually exclusive registers have the same address 099H. 
Serial Port Control Register (SCON)
  • Register SCON controls serial data communication.
    Address: 098H (Bit addressable

Data Transmission
  • Transmission of serial data begins at any time when data is written to SBUF. 
  • Pin P3.1 (Alternate function bit TXD) is used to transmit data to the serial data network. 
  • TI is set to 1 when data has been transmitted. This signifies that SBUF is empty so that another byte can be sent. 
Data Reception
  • Reception of serial data begins if the receive enable bit is set to 1 for all modes. 
  • Pin P3.0 (Alternate function bit RXD) is used to receive data from the serial data network. 
  • Receive interrupt flag, RI, is set after the data has been received in all modes. The data gets stored in SBUF register from where it can be read. 
Serial Data Modes 
8051 micro controller communicate with another peripheral device through RXD and TXD pin of port3.controller have four mode of serial communication.this four mode of serial communication are below.
1. Serial data mode 0-fixed buad Rate.
2. Serial data mode 1-variable baud rate.
3. Serial data mode 2 -fixed baud Rate.
4. Serial Data mode 3 -variable baud rate.

                                          Serial Data Mode-0
                                           (Baud Rate Fixed)

  • In this mode, the serial port works like a shift register and the data transmission works synchronously with a clock frequency of fosc /12. 
  • Serial data is received and transmitted through RXD. 8 bits are transmitted/ received aty a time. 
  • Pin TXD outputs the shift clock pulses of frequency fosc /12, which is connected to the external circuitry for synchronization. 
  • The shift frequency or baud rate is always 1/12 of the oscillator frequency.   

Serial Data Mode-1 (standard UART mode)
(baud rate is variable)
  • In mode-1, the serial port functions as a standard Universal Asynchronous Receiver Transmitter (UART) mode. 10 bits are transmitted through TXD or received through RXD. 
  • The 10 bits consist of one start bit (which is usually '0'), 8 data bits (LSB is sent first/received first), and a stop bit (which is usually '1'). Once received, the stop bit goes into RB8 in the special function register SCON. The baud rate is variable.
 


Serial Data Mode-2 Multiprocessor 
(baud rate is fixed)
  • In this mode 11 bits are transmitted through TXD or received through RXD.
  • The various bits are as follows: a start bit (usually '0'), 8 data bits (LSB first), a programmable 9 th (TB8 or RB8)bit and a stop bit (usually '1').  
  • While transmitting, the 9 th data bit (TB8 in SCON) can be assigned the value '0' or '1'. For example, if the information of parity is to be transmitted, the parity bit (P) in PSW could be moved into TB8.
  • On reception of the data, the 9 th bit goes into RB8 in 'SCON', while the stop bit is ignored. 
  • The baud rate is programmable to either 1/32 or 1/64 of the oscillator frequency.

f baud = (2 SMOD /64) fosc 


Serial Data Mode-3 - Multi processor mode
(Variable baud rate)

  • In this mode 11 bits are transmitted through TXD or received through RXD.
  • The various bits are: a start bit (usually '0'), 8 data bits (LSB first), a programmable 9 th bit and a stop bit (usually '1').  
  • Mode-3 is same as mode-2, except the fact that the baud rate in mode-3 is variable (i.e., just as in mode-1). 
f baud = (2 SMOD /32) * ( fosc / 12 (256-TH1))  
-----------------------------------------------------------------------------------------------------------------------
PREVIOUS:Power Saving mode                                                 NEXT:write and read serial port
 

3 comments:

Janhavi Khurkhuriya said...

You are saying that the baud rate is fixed in mode 2 and in its explanation you are saying that baud rate can be program

sara jenifer said...

I just stumbled over this page and have to say - wow. The site is really good and kept up to date. Continue like
Rajasthan University BCOM TimeTable 2020

Railway Jobs said...

Your style is really unique compared to other people I have read stuff from. Thank you for posting when you’ve got the opportunity, Guess I’ll just book mark this site.

pdusu ba 2nd year result 2022 roll number wise

Related Posts Plugin for WordPress, Blogger...
Subscribe to RSS Feed Follow me on Twitter!