RS-232C Standard and UART Communication, Study notes of System Programming

An overview of the rs-232c standard for serial communication, focusing on connectors, signals, and flow control. It also covers the internal registers and pinouts of a universal asynchronous receiver-transmitter (uart) device, which is essential for asynchronous communication. Students can use this document as study notes, summaries, or slides to understand the basics of rs-232c and uart communication.

Typology: Study notes

2011/2012

Uploaded on 08/07/2012

anishay
anishay 🇮🇳

4.2

(25)

118 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture # 14
RS 232C Standard
Standard for physical dimensions of the
connectors.
PC
(DTE) Modem
RS 232C Cable
Connected via
serial port
(DCE)
RS 232C Connectors and Signals
DB25 (25 pin connector)
25 pin connector on PC
1
2
9
7
8
4
5
6
10
11
12
13
3
25
24
23
22
21
20
19
18
17
16
15
14
RI
DTR
CD
GND
DSR
CTS
RTS
RD
T X D
docsity.com
pf3
pf4
pf5
pf8

Partial preview of the text

Download RS-232C Standard and UART Communication and more Study notes System Programming in PDF only on Docsity!

Lecture # 14

RS – 232C Standard

  • Standard for physical dimensions of the

connectors.

PC

(DTE)

Modem

RS – 232C Cable

Connected via

serial port

(DCE)

RS – 232C Connectors and Signals

DB25 (25 pin connector)

25 pin connector on PC

RI

CD DTR

GND

DSR

CTS

RTS

RD

T X D

Flow Control using RS232C

PC MODEM

DTE DTR DCE

DSR

RTS

CTS

CD

RI

DTR (SHOULD REMAIN HIGH THROUGH OUT THE SESSION )

CTS (CAN BE USED FOR FLOW CONTROL )

RxD TxD

Data is received through the RxD line. Data is send through the TxD line. DTR (data

terminal ready) indicates that the data terminal is live and kicking. DSR(data set ready)

indicates that the data set is live. Whenever the sender can send data it sends the signal

RTS( Request to send) if as a result the receiver is free and can receive data it send the

sender an acknowledge through CTS( clear to send) indicating that its clear to send now.

DB 9 Connector for UART

Scratch Pad SP 7

Modem Status MSR 6

Line Status LSR 5

Mode Control MCR 4

Line Cont rol LCR 3

Interrupt ID IIR 2

FIFO Control Register FCR 2

Interrupt Enable IER 1

Band Rate Divisor (High Byte) DLM 1

Band Rate Divisor (Low Byte) DLL 0

Receiver Dat a RBR 0

Transmitter Holding Register THR 0

Base +

The above table lists the registers within the UART ans also shows their abbreviation.

Also it shows there offsets with respect to the base register.

Served Ports in Standard PC

BIOS supports 4 UARTS as COM Ports

COM1, COM2, COM3, COM

COM4 0040:0006 2E8H

COM3 0040:0004 3E8H

COM2 0040:0002 2F8H

COM1 0040:0000 03F8H

Memory Port Base Address

Ports

BIOS Data Area

Text Dump

  • d 40:

0040:0000 F8 03 F8 02 E8 03 E8 02-BC 03 78 03 78 02 C0 9F ..........x.x... 0040:0010 23 C8 20 80 02 85 00 20-00 00 34 00 34 00 71 10 #. .... ..4.4.q. 0040:0020 0D 1C 71 10 0D 1C 64 20-20 39 34 05 30 0B 3A 27 ..q...d 94.0.:' 0040:0030 30 0B 0D 1C 00 00 00 00-00 00 00 00 00 00 00 00 0............... 0040:0040 D8 00 C3 00 00 00 00 00-00 03 50 00 00 10 00 00 ..........P..... 0040:0050 00 0A 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 0040:0060 0F 0C 00 D4 03 29 30 00-00 00 00 00 02 C9 0B 00 .....)0......... 0040:0070 00 00 00 00 00 00 08 00-14 14 14 14 01 01 01 01 ................ -q

The above dump of the BIOS data area for a certain computer shows that the address of

COM1 is 03F8 , the address of COM2 is 02F8 and the address of COM3 is 03E8. These

addresses may not be same for all the computers and may vary computer to computer.

Setting the Baud rate

Setting the Baud Rate

1.8432 MHZ=frequency generating by UARTS

internally

Divisor value loaded in DLL ( Base +0 ) and DLM ( Base +1 )

Baud rate =1.8432 MHZ / (16Divisor)*

Divisor = 1, Baud Rate = 115200

Divisor = 0CH, Baud Rate = 9600

Divisor = 180H, Baud Rate = 300

The baud rate is set in accordance with the divisor value loaded within the UART internal

registers base +0 and base +1.

Line Control Register

Interrupt Enable Register

Interrupt Enable Register

3 2 1 0

Trigger Interrupt

On Data Ready =

Trigger Interrupt

On change in Modem Status =

Trigger Interrupt

As soon as THR is empty =

Trigger Interrupt

On line status change =

If interrupt driven output is to be performed then this register is used to enable interrupt

for the UART. It can also used to select the events for which to generate interrupt as

described in the slide.

Interrupt ID Register

Interrupt ID Register

2 1 0

Trigger Triggered

Modem/Line

00 =Change in Modem Status

01 = THR is Empty

10 = Data is Ready

11 =Error in Data

Once an interrupt occurs it may be required to identify the case of the interrupt. This

register is used to identify the cause of the interrupt.