RS-232 Communications.

Slides:



Advertisements
Similar presentations
Serial Interface Dr. Esam Al_Qaralleh CE Department
Advertisements

DATA COMMUNICATIONS Some organisations concerned with standards: EIA - Electroonic Industries Association (RS standards including RS-232) IEEE - Institute.
1 Fall 2005 Local Serial Asynchronous Communication Qutaibah Malluhi Computer Science and Engineering Qatar University.
Local Asynchronous Communication and RS-232. Goals Explain how electric current can be used to transmit bits over short distances Present a popular mechanism.
RS-232 Communications. Why Serial Communications? Serial communication is the most simplistic form of communication between two devices. It’s pretty intuitive.
Chapter 2 Data Communication Concepts Code Transmission Signal Modulation Service.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Eng. Husam Alzaq The Islamic Uni. Of Gaza
CSCI 4550/8556 Computer Networks Comer, Chapter 5: Local Asynchronous Communication (RS-232)
COMP3221: Microprocessors and Embedded Systems
1 The 9-Pin Connector Pin abbreviations (numbers in parentheses are the 25D pin numbers): 1. CD (8) 2. RD (Rx) (3) 3. TD (Tx) (2) 4. DTR (20) 5. SG (Ground)
Serial Communications Standards (Partly Excerpted from Simpl Primer) Cabling Configuration Protocol.
ECE 371- Unit 11 Introduction to Serial I/O. TWO MAJOR CLASSES OF SERIAL DATA INTERFACES ASYNCHRONOUS SERIAL I/O - USES “FRAMING BITS” (START BIT AND.
Local Asynchronous Communication
12 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 1 Interfaces Transmission of data from the source to a device or from a device to the destination.
Local Asynchronous Communications. Bit-wise data transmission Data transmission requires: Encoding bits as energy Transmitting energy through medium Decoding.
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
Technology Training that Works Hands of Data Communications, Networking & TCP/IP Troubleshooting.
Transmission Modes Serial Transmission  One bit is transmitted on a circuit at a time  Usually there is one transmit circuit and one receive circuit.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
Serial Port I/O Serial port sends and receives data one bit at a time. Serial communication devices are divided into: Data Communications Equipment (DCE),
1 Ch 5 Local Asynchronous Communication (RS-232).
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Line Coding, Modem, RS232 interfacing sequences.
“Describe the overview of hardware interfacing and the serial communication interface. Describe the PIC18 connections to RS232. Explain the serial port.
Universal Asynchronous Receiver/Transmitter (UART)
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire conductors)
Serial Communications
Chapter 5: Local Asynchronous Communication 1. Bit-wise data transmission 2. Asynchronous communication 3. Sending bits with electric current 4. Standard.
Interfaces and Synchronization Martin Weiss. EIA 232D Interface Standard u Synonymous with ITU V.24 u Asynchronous interface u Up to 19.2kbps u 50 foot.
1 Transmission of Digital Data : Interface and Modems.
1 Asynchronous voice band modem for IP data protocols overview features.
Digital Interfaces An interface links two devices Interface Standards define: – mechanical specifications - how many wires & connector type –electrical.
CSC 335 Data Communications and Networking Lecture 4b: Communication and Multiplexing Dr. Cheer-Sun Yang.
©F.M. Rietti Communication Lines Fundamentals. ©F.M. Rietti LM-18 Computer Science SSI Embedded Systems I 2 Communication Lines Generally used to connect.
BASICS OF SERIAL COMMUNICATIONS BIRLA VISHWKARMA MAHAVIDYALAYA ELECTRONICS & TELECOMMUNICATION DEPARTMENT PRESENTING BY: ABHISHEK SINGH AMANDEEP.
Layer Physical – WAN Pertemuan 03 Matakuliah: H0524/Jaringan Komputer Tahun: 2009.
NARNARAYAN SHASTRI INSTITUTE OF TECHNOLOGY Prepared by: Wasu Ichcha kaur H Bhalani Nidhi M Dhakate Megha D MICROCONTROLLER.
EET 2259 Unit 14 Instrument Control
Network Hardware for Expanding Network
Chapter 6 Serial Communications
William Stallings Data and Computer Communications
Serial mode of data transfer
UART Serial Port Programming
Homework Reading Continue mp1 Labs Tokheim, Section 13-6 Questions?
CS-401 Computer Architecture & Assembly Language Programming
MODEMS (Converts analog signals to digital and vice-versa)
Lecture # 13.
SERIAL PORT PROGRAMMING
Serial Communications
RS-232 Communications.
DATA COMMUNICATION Lecture-21.
Pemrosesan Data Tersebar
Serial Communication: RS-232 (IEEE Standard)
Local Asynchronous Communication (RS-232)
UART Serial Port Programming
EET 2259 Unit 14 Instrument Control
UART Serial Port Programming
Serial Communication Interface: Using 8251
Serial Communication Interface
Преглед Начин функционисања Имплементације
Lecture 8: Modems (Converts analog signals to digital and vice-versa) 1nd semester By: Adal ALashban.
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Chapter 6 Transmission of Digital Data Interfaces and Modems
ANALOG AND DIGITAL PHYSICAL INTERFACES
PIC Serial Port Interfacing
8051SERIAL PORT PROGRAMMING
PIC Serial Port Interfacing
William Stallings Data and Computer Communications
Chapter 6: INTERFACES Visit for more Learning Resources.
Presentation transcript:

RS-232 Communications

Why Serial Communications? Serial communication is the most simplistic form of communication between two devices. It’s pretty intuitive once you see the pattern. It’s what started networking!

So What is RS-232? RS-232 is a standard by which two serial devices communicate: The connection must be no longer than 50 feet. Transmission voltages are –15V and +15V. It is designed around transmission of characters (of 7 bits of length).

RS-232 (cont.) One important aspect of RS-232 is that it is an asynchronous form of communication. Asynchronous communication is important because it is efficient; if no data needs to be sent, the connection is “idle.” No additional CPU overhead is required for an idle serial line.

Logical Voltages RS-232 is a little non-intunitave at first. Logical 1 is –15VDC. Logical 0 is +15VDC. When the connection is idle, the hardware ties the connection to logical 1.

How Can You Transmit Data? RS-232 communication is dependent on a set timing speed at which both pieces of hardware communicate. In other words, the hardware knows how long a bit should be high or low. RS-232 also specifies the use of “start” and “stop” bits.

Sending One Character Every time a character is sent, the same communication occurs: Start bit sent. Seven data bits sent. Stop bit sent. This communication is dependent on the fact that both devices are sampling the bits at the same rate!

Ok, So What’s the Start Bit? The start bit is a logical 0 sent on the line to tell the other device to start sampling. Remember, the logical 0 is +15VDC.

And the Stop Bit? The stop bit is a logical 1. –15VDC. A stop bit is always sent (per RS-232 standards).

A Sample Transmission

Common Serial Settings Most settings are read in the following form: Bits per second Number of data bits Parity Number of Stop bits

Common Serial Settings cont. Most everything comes out of the box with 9600,8,none,1. Including most Internet related devices like routers. Another common (old-school) setting is 9600,7,even,2.

Line Sampling & Framing RS-232 hardware samples the line multiple times during a single bit transmission. If the samples do not all have the same voltage, a framing error occurs. A framing error should only occur if one device is sending faster than the other device is set to receive. An intentional frame error can be caused by sending a BREAK.

EIA RS-232 Serial Interface Standard EIA – Electronic Industry Associates First RS-232 Standard in 1969 for: DTE to DCE Initially Assumed Phone Lines used with Modems at Each End Latest is EIA232E in 1991 (no longer RS, but everyone still calls it that) Data Terminal Equipment DTE Data Terminal Equipment DTE Data Terminal Equipment DTE Data Terminal Equipment DTE 232 Phone Line 232

Basic 232 Specifications Maximum Data Rate = 19,200 bps Maximum Cable Length = 50 feet Maximum Capacitance/foot = 50 pF |Vmax| = ±25V Negative Logic: logic 1 = -12V, logic-0 = +12V (typical) 2 Standard Connectors and Pinouts DB9 is the 9-pin connector (DB stands for Data Bus) DB25 is the 25-pin connector *NOTE: DB25 is a general connector, NOT an RS-232 Only; PC parallel ports commonly use the DB25 Also!

RS-232 DB25 Pin Out DB-25M Function Abbreviation Pin #1 Chassis/Frame Ground GND Pin #2 Transmitted Data TD Pin #3 Receive Data RD Pin #4 Request To Send RTS Pin #5 Clear To Send CTS Pin #6 Data Set Ready DSR Pin #7 Signal Ground Pin #8 Data Carrier Detect DCD or CD Pin #9 Transmit + (Current Loop) TD+ Pin #11 Transmit - (Current Loop) TD- Pin #18 Receive + (Current Loop) RD+ Pin #20 Data Terminal Ready DTR Pin #22 Ring Indicator RI Pin #25 Receive - (Current Loop) RD-

RS-232 DB9 Pin Out DB-9M Function Abbreviation Pin #1 Data Carrier Detect CD Pin #2 Receive Data RD or RX or RXD Pin #3 Transmitted Data TD or TX or TXD Pin #4 Data Terminal Ready DTR Pin #5 Signal Ground GND Pin #6 Data Set Ready DSR Pin #7 Request To Send RTS Pin #8 Clear To Send CTS Pin #9 Ring Indicator RI

RS232 Pins Connectors: Minimally, 3 wires: RxD, TxD, GND Could have 9-pin or 25-pin DB-9 9-Pin Connector DB-25 25-Pin Connector

RS232 Pins (cont’d) DB-9 9-Pin Connector Data in Data out IBM PC DB-9 Signals Pin 1 – Data Carrier Detect (DCD) Pin 2 – Received Data (RxD) Pin 3 – Transmitted Data (TxD) Pin 4 – Data Terminal Ready (DTR) Pin 5 – Signal Ground (GND) Pin 6 – Data Set Ready (/DSR) Pin 7 – Request to Send (/RTS) Pin 8 – Clear to Send (/CTS) Pin 9 – Ring Indicator (RI) DB-9 9-Pin Connector Data in Data out

Full Duplex Transmission Full duplex transmission (FDX) occurs when data is transmitted (or can be transmitted) simultaneously by both devices. Special wiring is needed for FDX.

Wiring RS-232 The RS-232 specification denotes usage of a 25 pin cable, where each pin has a specific usage. However, most devices never need to use all of the pins, so the cabling requirements for specific devices may vary. Many common serial devices (modems for example), use a 9 pin serial connection.

Connector Types The two different connectors are associated with two major types of hardware The Computer Terminal Equipment (DTE) and the Data Terminal Equipment (DCE).

Connector Types (cont.) For ease-of-use, a computer will transmit on pin 2 and receive on pin 3 (the DTE, remember). Vice versa: a modem will transmit on pin 3, and receive on pin 2 (for the DCE).

Speed Limitations For people familiar with modem communications, there is a speed limitation associated with the transmission. 56k (56 kilobit) analog modems are pretty much the fastest analog modems that consumers are going to see. This limitation is due to telephone systems, not the computer systems.

Speed Limitations (cont.) However, serial communications between devices also has its own speed barrier. RS-232 was designed with the understanding that the analog world is far from perfect. Digital is fast, analog is slow. RS-232 is analog, therefore is it slow (in computing terms).

Why Is It Slow? t exists. The change is not instantaneous. Sampling does not occur immediately, so it must wait t+t0 Cable length increases delay. Etc.

Noise Signal noise is bad. It is caused by a variety of sources, all of which lead to lower speeds and less reliable transmission. Shannon’s Theorem shows that the maximum transmission rate of a voice call (analog) is ~30,000 bps (30kbps).

DB25 and DB9 Connectors

PIC18 Connection to RS232 Line driver (a) Inside MAX232 (b) its Connection to the PIC18