TCSS 372 Laboratory Project 2 RS 232 Serial I/O Interface

Similar documents
EECE494: Computer Bus and SoC Interfacing. Serial Communication: RS-232. Dr. Charles Kim Electrical and Computer Engineering Howard University

APPLICATION BULLETIN. SERIAL BACKGROUNDER (Serial 101) AB23-1. ICS ICS ELECTRONICS division of Systems West Inc. INTRODUCTION CHAPTER 2 - DATA FORMAT

ROM/UDF CPU I/O I/O I/O RAM

Electronics / Water analogy. Resistor. Inductance. Capacitor. Water Electronics Energy - Energy Pressure - Voltage Flow - Current Volume - Charge

EE 314 Spring 2003 Microprocessor Systems

Lab 5. Binary Counter

Lab 6. Binary Counter

Serial Input/Output. Lecturer: Sri Parameswaran Notes by: Annie Guo

Unit D. Serial Interfaces. Serial vs. Parallel. Serial Interfaces. Serial Communications

Chapter 15: Serial Controlled (HF) Radio Support

EIG DNP V3.0 Protocol Assignments

COMP467. Local Asynchronous Communication. Goals. Data is usually sent over a single channel one bit at a time.

EXPERIMENT NO:-1. OBJECTIVE: To study Basics of serial communication ports and protocols.

WTPCT-M. eeder. Pulse Counter/Timer Module. Technologies FEATURES SPECIFICATIONS DESCRIPTION. Weeder Technologies

King Fahd University of Petroleum & Minerals Computer Engineering Dept

WTDIN-M. eeder. Digital Input Module. Technologies FEATURES SPECIFICATIONS DESCRIPTION. Weeder Technologies

WTDOT-M. eeder. Digital Output Module. Technologies FEATURES SPECIFICATIONS DESCRIPTION. Weeder Technologies

Number system: the system used to count discrete units is called number. Decimal system: the number system that contains 10 distinguished

CHAPTER 10: DIGITAL INSTRUMENTATION PRINCIPLES

USING RS-232 to RS-485 CONVERTERS (With RS-232, RS-422 and RS-485 devices)

1. The decimal number 62 is represented in hexadecimal (base 16) and binary (base 2) respectively as

Concept of Serial Communication

EVDP610 IXDP610 Digital PWM Controller IC Evaluation Board

NETWORK. TE = Terminal Equipment (DTE - Data Terminal Equipment) NT = Network - Terminating Equipment (DCE - Data Circuit - Terminating Equipment)

PART 4 DIGITAL METHODS. Chapter 13 Digital Fundamentals. Parallel Data Transfer. Fig Parallel data handshaking

LCM100 USER GUIDE. Line Carrier Modem INDUSTRIAL DATA COMMUNICATIONS

Chapter 12: Digital Modulation and Modems

Chapter 9: Serial Communication Interface SCI. The HCS12 Microcontroller. Han-Way Huang. September 2009

Fanuc Serial (RS232) Communications Information

GP4 PC Servo Control Kit 2003 by AWC

ECE 4510/5530 Microcontroller Applications Week 6 Lab 5

ANALOG AND DIGITAL PHYSICAL INTERFACES

Debugging a Boundary-Scan I 2 C Script Test with the BusPro - I and I2C Exerciser Software: A Case Study

WIEG4PRT-A Four port Wiegand to RS232 Converter.

WIE232-A Dual Wiegand to RS232 Converter.

Interface: Serial EIA RS-232D/CCITT V.24, DCE; RTS/CTS delay 0,8 or 64 ms (user-selectable).

Sequential Logic Circuits

Microcontrollers. Serial Communication Interface. EECE 218 Microcontrollers 1

Stensat Transmitter Module

DigiPoints Volume 1. Student Workbook. Module 2 Modem Overview

This section of the manual will document the Ad-Maestro s control ports, COMM Ports and their settings respectively.

Lecture #3 RS232 & 485 protocols

CALIFORNIA SOFTWARE LABS

This FAQ covers Single Direction use of current loop with transmitting devices.

PRODUCT INFORMATION B&B ELECTRONICS. Port-Powered RS-232 Fiber Optic Modem with Handshake Support. Model 9PFLST. Description. RS-232 Connections

CHAPTER 5 TRANSMISSION OF DIGITAL DATA INTERFACES & MODEMS

Sequential Logic Circuits

GPUX Four Channel PWM Driver

Technical Note #15. Radio Frequency Modems. GE ED&C Home Search ED&C GE ED&C Power Management Home GE ED&C PMCS Home

DELD MODEL ANSWER DEC 2018

WWVB Receiver/Decoder With Serial BCD or ASCII Interface DESCRIPTION FEATURES APPLICATIONS

The "FISH" Quad Hand Sensor

This FAQ covers the common questions from technicians installing these converters.

Harris IRT Enterprises Multi-Channel Digital Resistance Tester Model XR

SMARTALPHA RF TRANSCEIVER

Voltage regulator TAPCON 240

Local Asynchronous Communication. By S.Senthilmurugan Asst.Professor/ICE SRM University. Chennai.

Stat-4 Stat-8 Stat-24

300 BAUD MODEM DESIGN. by Brian Terwilliger 5th Year Microelectronics Student Rochester Institute of Technology

CS601 Data Communication Solved Objective For Midterm Exam Preparation

Voltage regulator TAPCON 260

a6850 Features General Description Asynchronous Communications Interface Adapter

DI-1100 USB Data Acquisition (DAQ) System Communication Protocol

BASIC PARAMETERS FOR THE MEASUREMENT OF ERROR PERFORMANCE AT BIT RATES BELOW THE PRIMARY RATE

13. OP-03 RS-232C SERIAL INTERFACE

USER'S MANUAL. Model : K

Interface converter G kbit/sec

MODEL PAXCDC -SERIAL COMMUNICATIONS PLUG-IN OPTION CARDS

Digital Logic Circuits

Serial Communication AS5132 Rotary Magnetic Position Sensor

MEASAR RS232 Interface Protocol Rev. E

CS302 - Digital Logic Design Glossary By

MAINTENANCE MANUAL DIGITAL SELECTOR MODULE 19D902519G1 TABLE OF CONTENTS

Transmission Principles

Representation of Information. Transmission Principles. Agenda. Transmission of Information

Intermittent Vibration 0.075

Module 3: Physical Layer

DASL 120 Introduction to Microcontrollers

CHAPTER 6 DIGITAL INSTRUMENTS

Asynchronous Serial Communications The MC9S12 Serial Communications Interface (SCI) Asynchronous Data Transfer

CMU232 User Manual Last Revised October 21, 2002

CS601-Data Communication Latest Solved Mcqs from Midterm Papers

Standard single-purpose processors: Peripherals

Digital Fundamentals

INTERNATIONAL TELECOMMUNICATION UNION DATA COMMUNICATION NETWORK: INTERFACES

PERIPHERAL INTERFACING Rev. 1.0

Module -18 Flip flops

USB Multifunction Arbitrary Waveform Generator AWG2300. User Guide

CONTENTS Sl. No. Experiment Page No

DIGITAL CIRCUITS AND SYSTEMS ASSIGNMENTS 1 SOLUTIONS

EE401,EC401,DEE19,DETE19

Department of Electronics and Communication Engineering

DIGITAL ELECTRONICS: LOGIC AND CLOCKS

Laboratory Manual CS (P) Digital Systems Lab

745 Transformer Protection System Communications Guide

DSP4xxFP SA USER S MANUAL. A01561 Rev. A. This Manual covers all configurations of the DSP4xxSA Modem with the Serial Number SA and up.

DIGITAL ELECTRONICS QUESTION BANK

Multi-Channel RS-232 Serial RF Transceiver

NMEA Protocol Converter 2 Plus 3 Users Guide

Exercise 1: Circuit Block Familiarization

Transcription:

11/20/06 TCSS 372 Laboratory Project 2 RS 232 Serial I/O Interface BACKGROUND In the early 1960s, a standards committee, known as the Electronic Industries Association (EIA), developed a common serial bus interface standard for asynchronous data communications equipment, named RS232. It is still used today for connecting peripheral equipment, like printers, to computers, as well as connecting computers together. It is now being replaced by a faster asynchronous serial bus, USB or Universal Serial Bus. Originally, data communications was thought to mean digital data exchange between a centrally located mainframe computer and a remote computer terminal, or possibly between two terminals without a computer involved. These devices were linked by telephone voice lines, and consequently required a modem at each end for signal translation. While simple in concept, the many opportunities for data error that occur when transmitting data through an analog channel require a relatively complex design. It was thought that a standard was needed first to ensure reliable communication, and second to enable the interconnection of equipment produced by different manufacturers, thereby fostering the benefits of mass production and competition. It specified signal voltages, signal timing, signal function, a protocol for information exchange, and mechanical connectors. You will see both 25 pin and 9 pin connectors used for RS232 today. If the full EIA232 standard is implemented as defined, the equipment at the far end (left end below) of the connection is named the DTE device (Data Terminal Equipment, usually a computer or terminal), and has a male connector. Equipment at the near end (right end below) of the connection (the telephone line interface) is named the DCE device (Data Circuit-terminating Equipment or Data Communications Equipment, usually a modem), has a female connector, and utilizes the same available pins for signals and ground. The cable linking DTE and DCE devices is a parallel straight-through cable with no cross-overs or self-connects in the connector hoods. If all devices exactly followed this standard, all cables would be identical, and there would be no chance that an incorrectly wired cable could be used. This drawing shows the orientation and connector types for DTE and DCE devices:

The signals on an RS232 9 pin connector are: If one wants to connect two computers together, a "null modem" connection can be used in place of the pair of modems. Since both computers are DTE's, the straight through connection from a DTE to a DCE will not work. A null modem crosses the send and receive lines and connects the other wires, the flow control or "handshaking signals", correctly for a DTE to communicate with another DTE. The configuration for a null modem is: "Full Handshaking Null Modem" Sometimes null modems are connected with "loop back" connections to "fake" the handshaking as follows: "Loop back Handshaking Null Modem" Sometimes designers actually don't bother with the handshaking signals at all. They don't program the equipment to either look at or to generate the signals:

"No Handshaking Null Modem" This lack of standard for a connection often gives one fits when configuring a system! Maybe you have been there? For our project we will ignore handshaking. That will make it simpler for us, but still not at all trivial. RS232 transmits a sequence of bytes, each of which is transmitted as a sequence of pulses. These pulses are sent at a selected Baud (or bit) rate: Baud rate: Max speed of transmission of bits: Typically 110, 300, 1200, 2400, 4800, 9600, 19200 bits/sec The protocol for the sequence of pulses representing the bytes of ASCII Characters is: Start bit: A first bit always of the same polarity for equipment to sync on Data Bits: The useful data follows the start bit: Typically 5, 6, 7, or 8 bits Parity Bit: A bit used for error checking: Even Parity, Odd Parity, Mark Parity, Space Parity, No Parity Stop Bits: The trailing bits after the data and parity to ensure time to "catch" data between bytes: Typically 1, 1.5, or 2 bits Understand that both communicating devices must be using the same protocol parameters for the communication to be successful. Here is an example Java program that sends characters or strings of characters over the cable. You may want to use a version of it to generate your characters on the host computer: import java.io.*; import javax.comm.*; public class SimpleWrite { public static void main(string[] args) throws Exception { OutputStream outputstream; outputstream = get_the_serial_port(); byte[] data = {'a'}; for (int i = 0; i < 1000; i++) { outputstream.write(data); // string sent System.out.println ("i = " + i); Thread.sleep(1000); // milliseconds suspended } } public static OutputStream get_the_serial_port() throws Exception

} { } CommPortIdentifier portid; portid = CommPortIdentifier.getPortIdentifier("COM1"); // COM Port # SerialPort serialport; serialport = (SerialPort) portid.open("simplewriteapp", 2000); serialport.setserialportparams(9600, // baud rate SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); return serialport.getoutputstream(); This program uses the javax.comm package. It is not included in the java JDK(jre). It can be obtained at: http://java.sun.com/products/javacomm/index.jsp OBJECTIVE We want to design and build an interface that will capture characters sent by the host computer via the RS 232 serial protocol, and display the data bits on LED s. ASSIGNMENT (Work in pairs.) 1) Do the following procedure to understand the RS-232 protocol: a) Hook channel 1 of the analog oscilloscope to the output of a serial port (Ground is pin 5). The transmitted signal is on pin 3. Here is a picture of our oscilloscope connected to the serial cable from our computer.

Hook channel 2 to the pulse generator output and set the pulse rate to approximately 9600 Hz. b) Transmit a character using Java Comm Library (javax.comm is installed on the laboratory computer JDK's). Describe what you see. Draw a picture of your wave form identifying the frequency, voltage between the transmitted character, the value of a "1" and a "0" level, the start bit, the data bits and their order and orientation, the partiy bit, and the stop bits. Explain how you know those identifications are correct. How did you use the pulse generator display to confirm your identification of the bit rate? c) Transmit a zero (the number 0, not the character '0'), and record the result. d) Choose other characters to transmit, and record the results. e) Choose alternate values for EACH parameter: Baud rates, data bits, parity, and stop bits. Record the results and observations. 2) Design a logic circuit that will capture a character sent. Each time a new character is sent, it should replace the last value. Lets assume the protocol is 1 start bit, 8 data bits, no parity, and two stop bits. Use a 1489 Line Receivers to buffer the signal from the RS-232 line. The voltage levels on the RS-232 cable are approximately 15 volts. The 1489 Line Receiver will handle these and give you a 1 level consistent with 5 volt logic. I would use a 74HC163 4-bit synchronous binary counter for the state machine to control your circuit. The 74HC163 has a synchronous reset. That means that the reset occurs on the next clock pulse after the reset signal appears on the reset pin. I would use a 74HC164 8-bit synchronous shift register to capture the character bits. The outputs can be connected to leds in series with 1k current limiting resistors (we don t want to burn out the leds). 3) After you are comfortable that your design should work, build and test your circuit. REPORT Each individual should submit a formal report. Your report should include documentation of your lab results. Notes: 1) In general, don t leave control inputs open. They should be connected to a logical 1 or a logical 0. 2) The 74HC163 Synchronous Binary Counter has a synchronous reset, i.e., it resets when the reset input is a logical 0 on the rising edge of the clock.

3) The 1489 is an inverting buffer. It accepts an input significantly higher than a logical 1, like the15 volts that the RS-232 line provides. The control inputs on it SHOULD be left open! 4) Our chip inventory includes: 74xx00 2 Input Nand Gates (4) 74xx02 2 Input Nor Gates (4) 74xx04 Invertors (6) 74xx08 2 Input And Gates (4) 74xx32 2 Input Or Gates (4) 74xx74 D Flip Flops (2) 74xx109 J/K Flip Flops (2) 74xx112 J/K Inverted Clock Flip Flops (2) 74xx125 Tri-state Buffers (4) 74xx163 4 Bit Sync Binary Counter with Sync Reset (1) 74xx164 8 Bit Synchronous Shift Register (1) MC1489 Inverting Line Receivers (4)

74HC163 4 Bit Synchronous Binary Counter: http://rocky.digikey.com/weblib/texas%20instruments/web%20data/sn74hc163.pdf 74HC164 8 Bit Synchronous Shift Register: http://rocky.digikey.com/weblib/texas%20instruments/web%20data/sn74hc164.pdf

MC1489N Quad Line Receiver: http://focus.ti.com/lit/ds/symlink/mc1489.pdf Note: The control inputs on it SHOULD be left open!