Vous êtes sur la page 1sur 11

Serial Data Communication

Serial Port Modes


Serial Port Mode 0: 8-Bit Shift Register

 This mode is enabled by setting SM0 and SM1 in SCON SFR to 00b

 Receive or Transmit 8 data bits using pin RXD

 Pin TXD is connected to- Internal shift frequency pulse source to supply
shift pulses to external circuits

 Shift frequency=1/12 of fOSC

 TXD Shift clock: Low for m/c cycle states- S3-S4-S5

High for m/c cycles states- S6-S1-S2


Serial Port Mode 0: Transmission of Data

 Data is shifted put of RXD


 Data changes on the falling
edge of S6-P2
 External circuit design
should be in synchronization
with shift clock produced at
pin TXD
Serial Port Mode 0: Transmission of Data

 Data is received on the RXD pin


 Received data should be synchronized with shift clock produced at TXD pin
 Data is sampled on the falling edge of S5-P2
 External circuit design should be in synchronization with this timing
Serial Port Mode 0: Baud Rate

 Fixed, Baud rate = fOSC / 2


For fOSC =12 MHz, Baud Rate =12MHz/12
= 1MHz = 1Mbps = 1000000 bps
Serial Port Mode 1: 8 Bit UART with Variable Baud rate

 This mode is enabled by setting SM0 and SM1 in SCON SFR to 01b
 Configures in 10 bit Full-Duplex Receiver/Transmitter
 Pin RXD receives all data and Pin TXD transmits all data
Serial Port Mode 1: Transmission

 TI flag set once all ten bits have been sent


 Each bit interval = 1/Baud rate
 Transmitted data is sent in the format above Start Bit - 8 bits (LSB first) - Stop Bit
Serial Port Mode 1: Reception

 Received data is obtained in same order Start Bit - 8 bits (LSB first) - Stop Bit
 RI flag set once all ten bits have been sent
 Reception triggered by Falling edge of the start bit and Continues – if
the Stop bit is at ‘0’ halfway through the Start bit interval
(Anti noise measure)

Serial Port Mode 1: Baud rate

 Timer 1 is used to generate Baud rate by using Overflow flag


 Typically Timer 1 is used in Timer Mode 2 (Auto Reload 8 Bit Timer)
 Fbaud= 2SMOD/32d X fOSC/(12d X [256d] – (TH1))
 If Timer 1 is not run in Timer Mode 2 , then the Baud rate is-
 Fbaud= 2SMOD/32d X (Timer 1 Overflow frequency)
Serial Port Mode 2: 9 Bit UART Multiprocessor Mode, Fixed Baud rate

Serial Port Mode 2: 9 Bit UART Multiprocessor Mode, Variable Baud rate
Serial Port Clocking Sources

Vous aimerez peut-être aussi