Sunteți pe pagina 1din 24

24-Oct-11

8251
USART
Hardeep Singh
Lecturer/ECE
SBBSIET, Padhiana
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

Introduction
Two types of data transfer
Parallel data transfer
Serial data transfer

Types of communication

Simplex
Duplex
Half duplex
Full duplex

Serial Transmission Formats


Asynchronous data transfer
Synchronous data transfer
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

24-Oct-11

Baud Rate
In serial communication the rate at which data
bits are transmitted generates a term baud rate.
Baud rate is defined as bits/second or the changes
in voltage levels/second

Baud

24-Oct-11

BitsTransmitted
Second

Hardeep Singh/Lecturer/SBBSIET

8085 Serial I/O


Serial communication is useful for data
transfer between two points
SID Serial input data
This is an active high, serial input port pin, used to
accept serial 1 bit data under software control
When a RIM instruction is executed the SID pin data is
loaded in D7 of accumulator

SOD- Serial output data


This is an active high, serial output port pin, used to
transfer serial 1 bit data under software control
When a SIM instruction is executed the SOD pin is set
or reset depending on D7 and D6 bits of accumulator
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

24-Oct-11

8251 USART
USART Universal Synchronous/Asynchronous
Receiver and Transmitter
It will do the job of sending data out,
accepting data bits, generation/removing
other signals check different conditions etc.
8251 will convert this parallel data into serial
stream and transmit on serial output line
And, vice versa
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

8251 Functional Block Diagram

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

24-Oct-11

The 8251 block diagram contains 5 functional


block
Data bus buffer
Read write control logic
Transmitter section
Receiver section
Modem control

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

Data Bus Buffer


It is a tri state bi directional, buffer used to
interface data bus of 8251 to the system data
bus
The directional of data transfer through data
bus buffer is decided by RD and WR
This buffer transfers control word, status
word, data from receiver, depending on signal
given by R/W logic
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

24-Oct-11

Read/Write Control Logic


This block accepts different control signals
such as RD, WR, C/D, CS, CLK and Reset from
control bus and generate control signals for
device operation
The 8251 is selected when CS=0. When CS=0 it
accepts C/D pin and decides which part to
activate

Hardeep Singh/Lecturer/SBBSIET

24-Oct-11

8251 contains
a. Two data buffer registers
I. Data buffer for transmitter
II. Data buffer for reciever

b. Two control/status registers


a. Control word register
b. Status register

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

10

24-Oct-11

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

11

Transmitter Section

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

12

24-Oct-11

Receiver Section

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

13

This section consists of receive buffer and receive control


blocks
The receiver section accepts serial data on Rxd pin.
The input register converts the serial data into parallel
form
In asynchronous mode it will check for making state first,
then it checks for start bit
If start bit is detected then the bits are converted to
parallel form and transfer to receiver buffer register
For asynchronous mode 8251 contains false start bit
detection circuit
When the data byte is transferred from input register to
receiver buffer register, the control logic generates a signal
RxRDY to signal CPU about availability of data byte to read
by CPU
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

14

24-Oct-11

Modem Control

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

15

For sending the data on long distance


telephone lines are used
The telephone lines are analog in nature so
MODEMs are used to convert digital data to
analog data
Handshake signals of MODEM
DTR Data Terminal ready
DSR Data set ready
RTS Request to send
CTS Clear to send
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

16

24-Oct-11

Pin Diagram 8251 USART

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

17

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

18

24-Oct-11

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

19

D0 D7: Data bus


These are 8 bit bidirectional data lines connected to
system data bus
The microprocessor uses these lines to send or
receive data from 8251

CS: Chip select


This is a chip select input signal used to select 8251
When CS=0, the 8251 is selected. If CS=1, 8251 is
not selected

CLK: Clock input


The clock frequency must be greater than 30 times
receiver and transmitter frequency
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

20

10

24-Oct-11

RESET: Reset input


This pin is generally connected to reset out of
8085
This pin is used to force 8251 in idle mode i.e
reset condition

WR: Write input


This pin is an input signal used to load information
in 8251

RD: Read input


24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

21

C/D: Control/Data
This is an input pin, used to differentiate two sections control and
data section.
When C/D=1, the control section is enabled
And, when C/D-0, the data section in enabled

DSR
DTR
RTS
CTS
TxD
TxC
TxRDY
TxE
RxD
RxC
RxRDY
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

22

11

24-Oct-11

SYNDET/BRKDET: Sync Detect/ Break Detect


Synchronous mode: In it the pin is used as sync detect
There are two possible conditions input and output, which
is programmed through mode word
When SYNDET is used as output it indicates that you are
using 8251 sync detect circuit

Asynchronous mode:
This pin is used to detect break
If programmed stop bits are not available for consecutive
stop bit sequences, the output of pin goes high
If RxD remains LOW for stop bits, it represents problem in
line connected between transmitter and reciever
The status of this pin is also available in status word
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

23

8251 Control Word


8251 contains 16 bit control register divided
into two sections of 8 bits each
Mode control word
Command word register

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

24

12

24-Oct-11

8251 Control Word:


Asynchronous Mode

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

25

Mode Word Format (Asynchronous Mode)

D1 D0=00 / Synchronous mode,


D1 D0 =/ 00 /Asynchronous mode
D2 and D3 defines the length of character
D5 and D4 defines parity bit
D7 and D6 defines the number of stop bits

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

26

13

24-Oct-11

Mode Word Format


The mode word format of synchronous mode
D1 D0 =00, specifies synchronous mode
The function of bits D2 to D5 are same as
synchronous mode
D7=1 it is single sync character. If D7=0 it is
double sync character
D6 defines whether SYNDET pin is used as
input or output
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

27

8251 Control Word:


Synchronous Mode

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

28

14

24-Oct-11

Command Word Format

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

29

Command Word Format


After mode word, a command word is
programmed to control actual operation
D0 and D1 are used to enable transmitter and
receiver
D1 and D5 are used to set status of MODEM
control signals, DTR and RTS.
D3 is used to send the break character
D3 is low it will force TxD line LOW

D4 is used to reset all error flags


D6 is used to perform internal reset operation
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

30

15

24-Oct-11

D7 is only used for synchronous mode


If D7=1 the receiver will enter the hunt mode
If internal SYNDET circuit is used the receiver
buffer contents are compared, after each bit
received with the programmed sync characters, till
match occurs.
When sync character match occurs, 8251 will
come out of hunt mode and starts to assemble
data bytes
24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

31

8251 Status Word

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

32

16

24-Oct-11

The status register bits DSR, SYNDET, TxE,


RxRDY gives status of respective pins on 8251
TxRDY bit in status register is set if transmit
buffer is empty
Parity error
Overrun error
Framing error

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

33

8251 Data Transfer Operations

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

34

17

24-Oct-11

Asynchronous Mode Transmission

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

35

Asynchronous Mode Reciever

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

36

18

24-Oct-11

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

37

Synchronous Mode Transmission

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

38

19

24-Oct-11

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

39

Synchronous Mode Reception

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

40

20

24-Oct-11

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

41

8251 Interfacing in I/O mapped I/O

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

42

21

24-Oct-11

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

43

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

44

22

24-Oct-11

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

45

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

46

23

24-Oct-11

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

47

24-Oct-11

Hardeep Singh/Lecturer/SBBSIET

48

24

S-ar putea să vă placă și