WizIQ helps you learn and teach online - any subject you can think of!
Join for FREE

Comunicaciones Seriales

Add to Favourites
Post to:

Description
RS-232 Comunicacion Serial

Comments
Presentation Transcript Presentation Transcript

Transmisión Serie : Transmisión Serie Sistemas de Transmisión de Datos

INDICE : INDICE Introducción Conceptos de transmisión Serie. Estándares de nivel físico. Norma RS-232 Norma RS-422. Norma RS-485. Entornos Industriales. UART 8250

1. Introducción : 1. Introducción 1.1 Objetivos. Aprender los fundamentos de la transmisión serie como sistema de interconexión de elementos. Conocer las normas de transmisión serie más empleadas.

1. Introducción : 1. Introducción 1.2 Justificación. Todos los ordenadores trabajan con un número fijo de dígitos binarios para representar un dato (word, bytes, etc.) Dependiendo de la arquitectura del sistema, el tamaño de esta unidad de datos es variable. En la comunicación de datos pueden realizarse transmisiones entre diferentes arquitecturas, por lo que es necesario fijar criterios a la hora de realizar dicha transmisión.

INDICE : INDICE Introducción Conceptos de transmisión Serie. Estándares de nivel físico. Norma RS-232 Normas RS-422 y RS-423 Norma RS-485. Entornos Industriales. UART 8250

Example device and controller:serial port and UART : Example device and controller:serial port and UART modem RS232C cable Telephone line computer A communication device RS232C cable computer computer Serial ports on computers enables a computer to communicate with Other computers and device using serial cables. - a computer can be connected to an other computer using serial cable (also called RS-232 cable) - a computer can be connected to an external modem a computer can be connected to a digital camera that also has serial port…. The standard that is used for serial communication is called RS-232 standard

Slide 7 : 1 TxD RxD DTR SG 3 4 5 2 6 8 9 7 5 3 2 1 4 9 7 6 8 RxD TxD DTR SG DSR RTS CTS CTS RTS DSR DB9 Male Connector DB9 Female Connector TxD: Transmite Data (from DTE to DCE) RxD: Receive Data (from DCE to DTE) RTS: Request to Send (from DTE to DCE) CTS: Clear to Send (from DCE to DTE) DSR: Data Set Ready (from DCE to DTE) DTR: Data Terminal Ready (from DTE to DCE) SD: Signal Ground CD: Carriier Detect (from DCE to DTE) RS232 Connectors – 9 Pin

Slide 8 : TxD RxD RTS CTS 2 3 4 5 Female connector TxD RxD RTS CTS 2 3 4 5 DTE Device Computer RxD TxD CTS RTX 2 3 4 5 Null-Modem Cable Female connector Female connector DTE Device Computer RxD TxD CTS RTX 2 3 4 5 Male connector DCE Device MODEM DTE Device Computer Connnecting computer and devices using RS-232

Slide 9 : 0 1 0 0 0 0 0 1 0 1 1 Start bit 7 data bits Parity bit Two stop bits -15V +15V -3V +3V Mark (=1) Space (=0) Intermediate Region Data byte transmission corresponding to ascii character A (65) RS232C Data Transmission LSB MSB 0V

Slide 10 : Each PC has two serial ports that are usually called COM1 and COM2 (or Serial A or Serial B) A serial port of a computer has a 9-pin male connector com1 com2 Serial Cable (or RS-232 cable)

UART : UART The chip (or controller) that controls a serial port in a computer is Called UART: Universal Asynchronous Receiver Transmitter UART interfaces with CPU using 8-bit parallel line UART interface with serial port using 1 bit receive and transmit lines Hence UART does the conversion between parallel and serial data. UART CPU 8 computer Tx Rx

2. Conceptos de Transmisión Serie : 2. Conceptos de Transmisión Serie 2.2 Transmisión Serie. Para solucionar los inconvenientes de la transmisión en paralelo, aparece la transmisión serie.

2. Conceptos de Transmisión Serie : 2. Conceptos de Transmisión Serie 2.3 Transmisión asíncrona. El emisor y el receptor poseen relojes distintos: Secuencias cortas de bits = carácter. Los relojes se resincronizan con cada carácter. En ocasiones se trabaja con bit de start y stop. También se pueden incluir un bit de paridad.

3. Estándares de nivel físico : 3. Estándares de nivel físico 3.1 Norma RS-232. Características. Interconexión DTE-DCE. (punto a punto). Velocidades de hasta 20Kbit. Transmisión síncrona o asíncrona. Modos Half duplex y full duplex Tres especificaciones Eléctrica (V.28) Mecánica (ISO 2110) Funcional (V.24)

3. Estándares de nivel físico : 3. Estándares de nivel físico 3.1 Norma RS-232. Especificación eléctrica. Transmisión no balanceada Referencias a 0V. Limitación de corriente a 0.5 A Capacidad máxima 2500 pF Niveles

Asynchronous Character Stream : Asynchronous Character Stream Next Idle State Start Bit P Bit 0 1 Idle State 5 to 8 data bits Odd Even None Stop Bits 1 to 2 Stop Bits Parity bit is set so that the total number of 1’s will be even or odd, depending on which parity is set The stop can be 1, 1.5 or 2 2 bits. It is a binary 1 and is the same as the idle state level. This data stream is called a frame and if the receive and transmit clocks are off by toomuch a framing error may occur.

3. Estándares de nivel físico : 3. Estándares de nivel físico 3.1 Norma RS-232. Especificación mecánica. Conector ISO 2110 (DB25) 25 pines, se usan 21. Numeración ISO (AA, BB, etc..) o CCITT (101, 102, etc.) Conector DB9 Versión IBM (asíncrona) Longitud del cable: 15 metros.

DTE / DCE : DTE / DCE If the full EIA232 standard is implemented as defined, the equipment at the far end of the connection is named the DTE device (Data Terminal Equipment, usually a computer or terminal), has a male DB25 connector, and utilizes 22 of the 25 available pins for signals or ground. Equipment at the near end of the connection (the telephone line interface) is named the DCE device (Data Circuit-terminating Equipment, usually a modem), has a female DB25 connector, and utilizes the same 22 available pins for signals and ground.

3. Estándares de nivel físico : 3. Estándares de nivel físico 3.1 Norma RS-232. Especificación funcional. Líneas de datos. TxD y RxD Líneas de control de flujo Request to send (RTS) Clear to send (CTS) Data Carrier Detected (CD ó DCD) Líneas de establecimiento de conexión Data Terminal Ready (DTR) Data Set Ready (DSR) Ring Indicator (RI) Líneas de referencia Masa (GND) Masa de protección (SGH)

3. Estándares de nivel físico : 3. Estándares de nivel físico 3.1 Norma RS-232. Control de flujo Protocolos software XON – OFF: Caracteres especiales XON y XOFF. XOFF detiene el envio de datos desde el modem al PC, XON solicita más datos. ENQ – ACK (ASCII-BSC) : Enquiry: solicitud de información. Acknowledge: confirmación (ASCII) . Protocolos hardware RTS – CTS: líneas de control: Request To Send – Clear To Send. DTR – DSR: líneas de control: Data Terminal Ready – Data Set Ready.

3. Estándares de nivel físico : 3. Estándares de nivel físico 3.1 Norma RS-232. Control de flujo. Ejemplos Terminal (DTE)/Modem (DCE) 1. Indicación de llamada(RI). 2. DTE preparado (DTR). 3. Se conecta a línea. Activa DCE preparado DSR. 4. Petición de Envío (RTS). 5. El modem está preparado para tx y activa la señal CTS. 6. Activación DC. 4. Tx de datos.

The DTE Connector : The DTE Connector

The DCE Connector : The DCE Connector

Slide 24 : RS-232 Serial PC Port Connector DB-25 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 GND 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 Overview : RS 232 Overview RS 232 is an established standard to transmit data over a serial line Defines a serial line connection between a DCE and a DTE DCE (Data Communications Equipment), e.g. modem, printer DTE (Data Terminal Equipment), e.g. computer RS 232 does not specify how data is transmitted between two DCEs TRUE: -3V to -25V; FALSE: 3V to 25V Maximum transfer rate between DCE and DTE is 115,200 BPS Flow control: Software: sending special flow control characters Xon and Xoff Hardware: flow control via extra cables (RTS/CTS; see next slides) The RS 232 protocol is implemented by a chip called UART (Universal Asynchronous Receiver/Transmitter) DTE DCE DCE DTE RS 232 RS 232

Serial Pinouts for D9 and D25 Connectors : Serial Pinouts for D9 and D25 Connectors

Pin Functions : Pin Functions

Slide 28 : Especificaciones mecánicas (ISO 2110) y funcionales. Conector DB-25 II.2 INTERFAZ SERIE RS-232. Solamente 4 hilos de los 25 disponibles en la interfaz EIA-232 se usan para las funciones de datos. Los 21 hilos restantes están reservados para funciones como control, temporización, tierra y pruebas. No todas las patillas son funcionales. Las patillas 9 y 10 se reservan para uso futuro. La patilla 11 está todavía sin asignar. Cada función de comunicación tiene una función espejo, o respuesta, para el tráfico en la dirección opuesta, para permitir la operación full-dúplex. Por ejemplo, la patilla 2 es para transmitir datos, mientras que la patilla 3 es para recibir datos. De esta forma, ambos equipos pueden transmitir datos al mismo tiempo.

Slide 29 : Especificaciones mecánicas y funcionales. Conector DB-9 II.2 INTERFAZ SERIE RS-232. Implementación DB-9. Muchas de las patillas de la implementación del DB-25 no son necesarias en una conexión asíncrona sencilla. Por ello, se ha desarrollado una versión más sencilla del EIA-232 que solo usa 9 patillas, conocida como DB-9. No hay una relación patilla a patilla entre ambas implementaciones.

Loop Back Plug : Loop Back Plug D9 D25 3 2 TD 2 3 RD 5 7 SG 4 20 DTR 6 6 DSR 1 8 CD 7 4 RTS 8 5 CTS The loop back plug has the receive and transmit lines connected together, so that anything transmitted out of the serial port is immediately received by the same port. Useful for debugging purposes. TOS contains a simulation of a loop back plug in ~/tos/tools/serial/loopback.pyw DTE

Null Modem Wiring : Null Modem Wiring Null modem wiring connects two DTEs. No flow control necessary since both DTEs send at the same speed.

RS-232 DB-25 Connectors : RS-232 DB-25 Connectors DB Connector-Data Bus Connector

RS-232 DB-25 Pinouts : RS-232 DB-25 Pinouts

Important Pins : Important Pins

Limited Distance Modem Example (Point-to-Point) : Limited Distance Modem Example (Point-to-Point) Only a few circuits are necessary: Signal Ground (7) Transmitted Data (2) Received Data (3) Request to Send (4) Clear to Send (5) DCE Ready (6) Received Line Signal Detector [Carrier Detect] (8) Additional circuits necessary sometimes: DTE Ready(20) Ring Indicator (22)

RS-232 DB-9 Connectors : RS-232 DB-9 Connectors Limited RS-232

RS-232 Signals (Asynch) : RS-232 Signals (Asynch) Even Parity Odd Parity No Parity See ASCII Table

Asynchronous Operation : Asynchronous Operation

Slide 39 : See Table 6.1, Page 184 For the older RS-232-C standard, some of the pin definitions are: Pin Number Name (function) 2 TD (Transmitted Data) 3 RD (Received Data) 4 RS (Request to Send) 5 CS (Clear to Send) 6 DSR (Data Set Ready) 20 DTR (Data Terminal Ready) 8 CD (Carrier Detect) 21 SQ (Signal Quality detector)

Connection Establishment : Connection Establishment

3. Estándares de nivel físico : 3. Estándares de nivel físico 3.1 Norma RS-232. Uso del control de flujo: Impresora Null Modem Tres hilos

Null Modem Cable : Null Modem Cable Allows DTE to DTE direct communication

Dial Up Operation (1) : Dial Up Operation (1)

Dial Up Operation (2) : Dial Up Operation (2)

Dial Up Operation (3) : Dial Up Operation (3)

Voltage Levels : Voltage Levels Signal State Voltage Assignments - Voltages of -3v to -25v with respect to signal ground (pin 7) are considered logic '1' (the marking condition), whereas voltages of +3v to +25v are considered logic '0' (the spacing condition). The range of voltages between -3v and +3v is considered a transition region for which a signal state is not assigned.

RS-232 and RS-449 : RS-232 and RS-449 It is a physical protocol to interface computers with modems specify mechanical, electrical, functional, and procedural interface Computer or Terminal Modem Protective Ground (1) Transmit (2) Receive (3) Request to Send (4) Clear to Send (5) Data Set Ready (6) Common Return (7) Carrier Detect (8) Date Terminal Ready (20)

RS-232C Standard : RS-232C Standard The RS-232C standard is an asynchronous serial communication method. Serial means that the information is sent 1-bit at a time. Asynchronous means that the information isn't sent at predefined time slots (like with a fixed clock, for instance). The RS-232C standard works at the physical layer of the communication standard. This is the lowest level and the one that physically connects the devices. The communication is done through the serial port of the PC. This is a male connector with 25 (old) or 9 (new) pins, in both cases only 9 pins, at the most, are used.

Why Use a Serial Interface? : Why Use a Serial Interface? Good question? We program in parallel (writing a value to a char, int, float), why communicate serially? Less data is transferred per send. There are several reasons: Serial cables can be longer than parallel cables. Serial cables are cheaper than parallel cables, although there is a cost of converting parallel data to the serial connection. Infra Red devices are becoming popular. Detecting 1 point of light isn't easy, try detecting 8 or more points of light. Many microcontrollers (?????-??????) use SCI (Serial Communication Interface) to communicate with the outer world.

The Connector : The Connector The pins abbreviations are (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) (7) 6. DSR (6) 7. RTS (4) 8. CTS (5) 9. RI (22)

9D to 25D Conversion : 9D to 25D Conversion

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subject you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy

Your Facebook Friends on WizIQ