Experiment Number: 02. Title: PC-to-PC communication through RS-232 port

Similar documents
Sender Receiver Sender

Communication. Serial port programming

Chapter 11: Input/Output Organisation. Lesson 05: Asynchronous RS232C Serial Port data transfer

Appendix A Cable Pinouts

Cable Pinouts. SRP I/O Module

IML 560 USER GUIDE. Low Power 56Kbps Industrial modem. Version 1.2. December 6, AYANTRA Inc.

Serial Interfaces Part 1. ECE 153B Sensor & Peripheral Interface Design Winter 2016

Select a Data Communication Interface

USER S MANUAL. PH232Ex1. #1 RS-232 Serial Port to Ethernet, Terminal Server/Client. Doc No: PH232Ex1-UM-001 IPEX. (IP Electronix)

E1 and T1 RJ-48 Cable Pinouts on page 208. Fast Ethernet 12-port Cable Pinouts on page 211

RS-232 Connector Pin Assignments

8051SERIAL PORT PROGRAMMING

Cable Specifications. Interface Specifications. Fiber-Optic Specifications APPENDIXB

STEP X - Name of Step QUICK START GUIDE SP385A-R3, SP390A-R3 USB TO RS CONVERTER 24/7 TECHNICAL SUPPORT AT OR VISIT BLACKBOX.

Miniature Asynchronous 4-Wire High Speed Modems

USART. USART stands for Universal Synchronous Asynchronous Receiver Transmitter. Full-duplex NRZ asynchronous serial data transmission

Hardware Manual. PCMCIA 1 Port RS EDITION APRIL 1999

Serial Interfacing. Asynchronous Frame

Note: For BANDIT II, BANDIT III, or VSR-1200 specifications, see the BANDIT II, BANDIT III, and VSR-1200 Document Set. Function

Product Manual. USB to Optical Adapter Industrial Isolated RS- 232/422/485. Coolgear, Inc. Version 2.1 December 2018 Model Number: USB-COMi-Si-M

RS-232 SERIAL INTERFACE PHOTOELECTRIC ISOLATOR

Cabling Guide for Console and AUX

4.3 Digital Communication

NetCom Mini. SCADA system Building automation system Self-service banking system Other remote and distributed serial devices control

User Guide. Date Apr BlueEva+C11/G2. Stollmann. E + V GmbH. User Guide

Hardware Manual PCMCIA DUAL RS EDITION MAY 1999

HE-GE Linux USB Driver - User Guide. 1vv r2 03/25/2013

ZM56 High-Speed Industrial Modem. Command Summary. 1 ZM56 High-Speed Industrial Modem

Connector and Cable Specifications

Learn how to communicate

Starter Guide Version Sphinx Access Control System

USER MANUAL. G.shdsl+ modem with G.703 interface TAHOE 671 FREEDOM OF COMMUNICATION

WiFi to RS-232 adapter user manual

Serial Communication Converters & Adapters Instruction Manual

Serial Interfacing. Pulse width of 1 bit

The modems are made in industrial 108mm wide aluminium housing for DIN rail mounting. UCM RS232 interface

PCL Port RS-232 Interface Card

Universal Asynchronous Receiver Transmitter Communication

PCIe Card Selection Guide. PCIe-CAN Card. PCIe-COM Card. Taiwan Pulse Motion Co.,Ltd. Bus Interface PCI Express x 1 LPE-C122 PCE-C122D PCE-C122T

Serial Communication Prof. James L. Frankel Harvard University. Version of 2:30 PM 6-Oct-2015 Copyright 2015 James L. Frankel. All rights reserved.

EZL-200F Application Notes (003) Serial Interface (RS232/RS422/RS485)

NetBiter Serial Server User Manual

ISOLATED RS-232 TO RS-422/485 CONVERTER

Data Sheet SRM-3A. Ultra-Miniature Isolated Short-Range Async Modem. The Access Company

Serial Programming Guide for POSIX Operating Systems 5th Edition. Michael R. Sweet Copyright , All Rights Reserved.

LC1003A IP Security CCTV Connector Installation Guide

Galep-Adapter DIL-40 => ISP-ASYNC/SYNC Article-No.:

Programming and Using the Motorola V.3400 Modem for Remote Operation of the DDF6000

Wrenchman, Inc Old Hwy. # 8 Suite # 122 New Brighton, Minnesota (651)

PCI Express 16-Port Serial I/O Cards

5. Event analysis Event analysis The tool ukoslog. v 2.13

ICD105A 1008 page 1/ r001 ICD105A. Industrial RS-232 to RS-422/485 Converter

Real-Time Embedded Systems. CpE-450 Spring 06

INTRODUCTION 2 FEATURES. 2 SPECIFICATIONS. 2 PIN ASSIGNMENT 2 DB-9 DB-25 CONVERSION TABLE. 2 DRIVER INSTALLATION QUICK GUIDE.. 2

+ (5~27 VDC) GND. Bluetooth V4.2 BLE RS-232 Serial Adapter. Model: BLE-232D-E. 1. Package content: BLE RS-232 adapter

ExpressCard Serial Adapters User s Manual SSPXP-100 DSPXP-100 QSPXP-100 SSPXP-200/300 DSPXP-200/300 QSPXP-200/300

3.1 I-7560 Pin Assignment and Specifications: Introduction

Cable and Port Specifications

Auxiliary Port, Console Port, and Adapter Pinouts for Cisco 1000, 1600, 2500, 2600, and 3600 Series Routers

The Analyst. RS422/RS232 Tester. (Standard Model) User Manual

Mini Driver V (Mini Driver MP with 5-Screw Terminal Block) MINI DRIVER MP

Manual Industry Interfaces

NOTE: The numbers in the wiring diagrams do not show the order of connection. Follow the written instructions to make the connections.

QuVIS CONNECTOR PINOUT GUIDE

User Manual Anybus Serial Server

ISDN OEM1. DesignGuide V1.2

Bluetooth TO Serial CONVERTER E-P132-B

The Wireless Connectivity Expert

Bluetooth to RS-232&RS422/485. EX-9132B/BI Bluetooth Adapter Operation Manual

Serial Programming Guide for POSIX Operating Systems

+ (5~27 VDC) GND. Bluetooth V4.1 BLE RS-232 Serial Adapter. Model: BLE-232B. 1. Package content: BLE RS-232 adapter

RS-232 DATA COMMUNICATIONS WITH THE TANDY COLOR COMPUTER

Preliminary. PACKAGE - 28-pin MLP (5mm X 5mm) Example Circuit Diagram CP V. 48MHz Oscillator. USB Function Controller 512B EEPROM

Bluetooth to RS-232 Converter. RT-132B Bluetooth Adaptor Operation Manual

BLE232: Manual Copyright 2014 taskit GmbH

Document Name : User Manual for SC10B : RS232 to Bluetooth Converter.

A03 TD/RCL Adapter Board Instruction Sheet Tom Mayo 6/13/2012 COM3 COM1 DB-25 I/O COM2 ETH. Figure 1. The A01 TD220/RCL220 Adapter Board

LM058 Bluetooth Serial Adapter SMA Antenna 100m m Range SPP GAP + Wireless DTR DSR RTS CTS

GT- IRDM-9603 Product description Rev. 2 17/06/2014

ME778C-RJ45 MAIN MODULE (FRONT CARD) MAIN MODULE. Line: RJ-45. Line: RJ-45 INTERFACE MODULE (REAR CARD) Serial: 10-Pin RJ.

USB Serial Converter Rev. 1.0

I/O Interface DNA300

LM058 Bluetooth Serial Adapter

COMM+422.PCI USER MANUAL

Cable and Port Specifications

LM048 Bluetooth v2.0, v2.1 RS232 Serial Adapter Standalone (With Embedded Bluetooth v2.0 / v2.1 Stack)

CONNECT WITH RELIABILITY. USB-to-Serial Adapter User s Manual

Serial I/O. 4: Serial I/O. CET360 Microprocessor Engineering. J. Sumey

EX & EX-45362IS 2S RS232/422/485 3-in-1 Serial PCIe Card

SitePORTAL Lite TA-SPL32-R48

PCIe-400 USER S MANUAL

(renamed the "EIA232 Standard" in the early 1990 s)

LM058 Bluetooth v2.0, v2.1 RS232 Serial Adapter - SMA Connector Standalone (With Embedded Bluetooth v2.0 / v2.1 Stack)

ZM24x Quick-Connect Industrial Modem. User s Manual

Table 8 shows the pin configuration and function of a standard computer-to-printer parallel cable. Table 8 Parallel Cable Pin Configuration

edbox-100 SmartStack Box for PSTN

SyncLink USB Serial Adapter

QC Linux USB Driver - User Guide 1vv r7 04/11/2014

Model:UT-8814 USB/RS-232 Commercial interface converter. Instruction Manual

ICP PANEL-TEC PEX3000 II

Transcription:

R (2) N (5) Oral (3) Total (10) Dated Sign Experiment Number: 02 Title: PC-to-PC communication through RS-232 port OBJECTIVES: 1. To learn to perform PC-to-PC communication using the RS-232 port 2. To understand the concept of a null modem PROBLEM STATEMENT Write a program to perform PC to PC Communication through RS-232 port (COM) using the null modem configuration. Introduction to RS(Recommended Standard)-232: RS-232 standards(eia-232) are defined by EIA/TIA (Electronic Industries Alliance /Telecommunications Industry Association). RS-232 defines both the physical and electrical characteristics of the interface. RS-232 is practically identical to ITU V.24 (signal description and names) and V.28 (electrical). RS232 is an Active LOW voltage driven interface and operates at +12V to -12V where: Signal = 0 (LOW) > +3.0V (SPACE) Signal = 1 (HIGH) < -3.0V (MARK) 1. Signal voltages in the range >-3.0V to +3.0V are regarded as being in the 'dead area' (indeterminate value) and allow for absorption of noise. For more on the use of signals and other heavy stuff. 2. The power level on RS232 pins is defined by TIA for short circuit protection to be 100mA. Most RS232 drivers will provide lower short circuit protection (especially for laptops). A max of 50mA PER PIN may be available but the data sheet for the specific interface/chip should be consulted before commiting to externally powered designs. RS-232 standards(eia-232) are defined by EIA/TIA. They have defined following standards 1. RS232 on DB9 and DB25 known as RS-232C 2. RS232 on DB9 and DB25 known as EIA/TIA - 5

3. RS232 on DB9 and DB25 known as RS-232D 4. RS232 on RJ45 known as RS-232D EIA/TIA-561 5. RS422,423 and 435 on DB25 Known as EIA/TIA RS-530-A RS232 is the most known serial port used in transmitting the data in communication and interface. Even though serial port is harder to program than the parallel port, this is the most effective method in which the data transmission requires less wires that yields to the less cost. The RS232 is the communication line which enables the data transmission by only using three wire links. The three links provides transmit, receive and common ground. The transmit and receive line on this connecter send and receive data between the computers. As the name indicates, the data is transmitted serially. The two pins are TXD & RXD. There are other lines on this port as RTS, CTS, DSR, DTR, and RTS, RI. The 1 and 0 are the data which defines a voltage level of 3V to 25V and -3V to -25V respectively. The electrical characteristics of the serial port as per the EIA (Electronics Industry Association) RS232C Standard specifies a maximum baud rate of 20,000bps, which is slow compared to today s standard speed. For this reason, we have chosen the new RS- 232D Standard, which was recently released. The RS-232D has existed in two types. i.e., D-TYPE 25 pin connector and D-TYPE 9 pin connector, which are male connectors on the back of the PC. You need a female connector on your communication from Host to Guest computer. The pin outs of both D- 9 & D-25 are show below. DTE (PC) and DCE (Modem) Devices, which use serial cables for their communication, are split into two categories. These are DCE (Data Communications Equipment) and DTE (Data Terminal Equipment.) Data Communications Equipments are devices such as your modem, TA adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal. A typical Data Terminal Device is a computer and a typical Data Communications Device is a Modem. Often people will talk about DTE to DCE or DCE to DCE speeds. DTE to DCE is the speed between your modem and computer, sometimes referred to as your terminal speed. This should run at faster speeds than the DCE to DCE speed. DCE to DCE is the link between modems, sometimes called the line speed. Most people today will have 28.8K or 33.6K modems. Therefore, we should expect the DCE to DCE speed to be either 28.8K or 33.6K. Considering the high speed of the modem we should expect the DTE to DCE speed to be about 115,200 BPS. (Maximum Speed of the 16550a UART). The communications program, which we use, has settings for DCE to DTE speeds. However, the speed is 9.6 KBPS, 144 KBPS etc and the modem speed.

If we were transferring that text file at 28.8K (DCE- DCE), then when the modem compresses it you are actually transferring 115.2 KBPS between computers and thus have a DCE- DTE speed of 115.2 KBPS. Thus, this is why the DCE- DTE should be much higher than the modem's connection speed. Therefore, if our DTE to DCE speed is several times faster than our DCE to DCE speed the PC can send data to your modem at 115,200 BPS. In serial communications the terminal end (PC) is called the Data Terminal Equipment (DTE) and the modem end is called the Data Communications Equipment (DCE) as shown in the diagram below. Serial Communications with a modem RS-232 signals have a direction (in or out) depending on whether they are with respect to a DTE or a DCE. In all the pinout diagrams below the signal direction is with respect to the DTE (PC) end. What is NULL MODEM? Null modem is used to connect two DTE's together. This is used to transfer files between the computers using protocols like Zmodem protocol, xmodem protocol, etc When PCs are connected back-to-back each end is acting as a DTE (there is no DCE in this case) and consequently certain signals may have to be looped in the connection to satisfy any input signal requirement. This is called a NULL (no) modem configuration. For example, when the DTE raises Request to Send (RTS) it typically expects Clear to Send (CTS) from the DCE. Since there is no DCE to raise CTS, the outgoing RTS signal is looped in the NULL modem cable to the incoming CTS to satisfy the DTE's need for this signal. DB9 Male and Female Views

DB9: View looking into male connector DB9: View looking into female connector RS232D on DB9 (EIA/TIA 574) Signal functions are described in detail in our Signal/pin primer. The column marked Dir shows the signal direction with respect to the DTE. 1 DCD IN Data Carrier Detect. Raised by DCE when modem synchronized. 2 RD IN Receive Data (a.k.a RxD, Rx). Arriving data from DCE. 3 TD OUT Transmit Data (a.k.a TxD, Tx). Sending data from DTE. 4 DTR OUT Data Terminal Ready. Raised by DTE when powered on. In auto- answer mode raised only when RI arrives from DCE. 5 SGND - Ground 6 DSR IN Data Set Ready. Raised by DCE to indicate ready. 7 RTS OUT Request To Send. Raised by DTE when it wishes to send. Expects 8 CTS IN CTS from DCE. Clear To Send. Raised by DCE in response to RTS from DTE. 9 RI IN Ring Indicator. Set when incoming ring detected - used for auto- answer application. DTE raised DTR to answer. NULL MODEM Connections(RS232C) When PCs are connected back-to-back each end is acting as a DTE (there is no DCE in this case) and consequently certain signals may have to be looped in the connection to satisfy any input signal requirement. This is called a NULL (no) modem configuration. For example, when the DTE raises Request to Send (RTS) it typically expects Clear to Send (CTS) from the DCE. Since there is no DCE to raise CTS, the outgoing RTS signal is looped in the NULL modem cable to the incoming CTS to satisfy the DTE's need for this signal. This is shown in the diagram below.

Serial Communications with a NULL modem configuration Sample Program for Linux Program: Sender: /* Sender*/ #include <stdio.h> /* Standard input/output definitions */ #include <string.h> /* String function definitions */ #include <unistd.h> /* UNIX standard function definitions */ #include <fcntl.h> /* File control definitions */ #include <errno.h> /* Error number definitions */ #include <termios.h> /* POSIX terminal control definitions */ // sudo chmod a+rw /dev/ttys0 /* 'open_port()' - Open serial port 1.*/ /* Returns the file descriptor on success or -1 on error.*/ int open_port(void) int fd; /* File descriptor for the port */ fd = open("/dev/ttys0", O_RDWR O_NOCTTY O_NDELAY); if (fd == -1) /* Could not open the port */ fprintf(stderr, "open_port: Unable to open /dev/ttys0 - %s\n", strerror(errno)); else printf(" Port Opened Successfully\n"); return (fd); void main()

int mainfd=0,n=0; /* File descriptor */ char chout; struct termios options; mainfd = open_port(); fcntl(mainfd, F_SETFL, FNDELAY); /* Configure port reading */ /* Get the current options for the port */ tcgetattr(mainfd, &options); cfsetispeed(&options, B9600); /* Set the baud rates to 9600 */ cfsetospeed(&options, B9600); /* Enable the receiver and set local mode */ options.c_cflag = (CLOCAL CREAD); options.c_cflag &= ~PARENB; /* Mask the character size to 8 bits, no parity */ options.c_cflag &= ~CSTOPB; options.c_cflag &= ~CSIZE; options.c_cflag = CS8; /* Select 8 data bits */ options.c_cflag &= ~CRTSCTS; /* Disable hardware flow control */ /* Enable data to be processed as raw input */ options.c_lflag &= ~(ICANON ECHO ISIG); /* Set the new options for the port */ tcsetattr(mainfd, TCSANOW, &options); while (1) n=read(mainfd, &chout, sizeof(chout)); /* Read character from ABU */ /* if(n==0) printf("\n No User Input"); else printf("user input =%d",n);*/ if (chout!= 0) printf("%c\n", chout); chout=0; //usleep(2000);

/* Close the serial port */ close(mainfd); Reciever: #include<stdio.h> #include<termios.h> #include<unistd.h> #include<fcntl.h> #include<string.h> #include<errno.h> int open_port() int fd = 0; fd = open("/dev/ttys0",o_rdwr O_NOCTTY O_NDELAY); if(fd == -1) printf("failed to connect!"); else return(fd); int main() int mfd = 0, n = 0; char chout[20]; int i=0; struct termios options; mfd = open_port(); tcgetattr(mfd,&options); cfsetispeed(&options,b9600); cfsetospeed(&options,b9600); options.c_cflag = (CLOCAL CREAD); options.c_cflag &= ~PARENB; options.c_cflag &= ~CSTOPB; options.c_cflag &= ~CSIZE; options.c_cflag = CS8; options.c_cflag &= ~CRTSCTS; options.c_lflag &= ~(ICANON ECHO ISIG); tcsetattr(mfd,tcsanow,&options); /*while(1) n = read(mfd,&chout,sizeof(chout)); if(chout!= 0) printf("received %c \n",chout[i]); i++; printf("received failed"); break;

Computer Network laboratory (2015) Pattern TE Computer while(1) n = write(mfd, "ATZ Manik\r",10); if(n<0) printf("failed to send or transmit"); break; close(mfd); return 0; APPLICATION 1. Serial port communication is used in many applications ASSIGNMENT QUESTIONS: 1. Explain the concept of a null modem? 2. What are the means of accessing the serial port using code? 3. How do you set the various parameters associated with the communication channel? 4. Explain termios Structure in Details? 5. What is Baud Rate? 6. Difference between Synchronous & Asynchronous Mode? 7. Whare are Serial Ports are Located in Linux Platform? 8. Why it is Called Null Modem? 9. Explain Pins of RS232 Cable? 8 SNJB s Late Sau. K. B. Jain College of Engineering, Chandwad