USART Communication using the RS standard ETEC6416.

Slides:



Advertisements
Similar presentations
RS232 and RS485 Fundamental.
Advertisements

Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
06/11/ L8/1/12 COM347J1 Networks and Data Communications Ian McCrumRoom 5D03B Tel:
Arctic IEC-104 Gateway Jari Lahti, CTO.
Serial I/O - Programmable Communication Interface
Lecture 8: Serial Interfaces
Local Asynchronous Communication and RS-232. Goals Explain how electric current can be used to transmit bits over short distances Present a popular mechanism.
PH4705 ET4305 Interface Standards A number of standard digital data interfaces are used in measurement systems to connect instruments and computers for.
EUT 1040 Lecture 10: Programmable Logic Controllers.
1 Chapter Four Making Connections. 2 Introduction Connecting peripheral devices to a computer has, in the past, been a fairly challenging task Newer interfaces.
CS335 Networking & Network Administration Tuesday, April 6.
CSCI 4550/8556 Computer Networks Comer, Chapter 5: Local Asynchronous Communication (RS-232)
COMP3221: Microprocessors and Embedded Systems
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Input/Output and Communication
EUT 1040 PLC Timers and Motor Protection. Industrial Communications RS-422 (EIA 422): Asynchronous Serial Communications, similar in many respects to.
Serial Communications Standards (Partly Excerpted from Simpl Primer) Cabling Configuration Protocol.
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.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
Embedded Systems Design
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
Technology Training that Works Hands of Data Communications, Networking & TCP/IP Troubleshooting.
Baseboard Aavikkomursu 7.2. Aavikkomursu Micro- controller Extension port for programming microcontroller and sensor input Resistor RS485 interface chip.
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.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Arctic RS-485 / RS-422. RS- 485 Also known as RS-485 Half Duplex, RS wire same pair is used to transmit and receive data only one device can transmit.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
4.0 rtos implementation part II
Networking Technologies Here are a few of the big questions: How will each computer be identified? If two or more computers want to talk at the same time,
1 Ch 5 Local Asynchronous Communication (RS-232).
Data Communications Introduction and Review. Transmission Media Copper Wires Copper Wires Low resistance. Electrical signal produces miniature radio station.
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
1 Microprocessor-based Systems Course 9 Design of the input/output interfaces (continue)
“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)
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
Chapter 5: Local Asynchronous Communication 1. Bit-wise data transmission 2. Asynchronous communication 3. Sending bits with electric current 4. Standard.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Input/Output 2 What is I/O? How we get the CPU to communicate with devices From the computer’s point of view, it’s just 1’s and 0’s Gets interpreted.
Universal Asynchronous Receiver/Transmitter (UART)
Introduction to RS485 Author: Zhu Tao Date:
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
FUNDAMENTALS OF NETWORKING
Unit 1 Lecture 4.
©F.M. Rietti Communication Lines Fundamentals. ©F.M. Rietti LM-18 Computer Science SSI Embedded Systems I 2 Communication Lines Generally used to connect.
Communicating. The ATmega16 communicates through one of the following ways: Serial Peripheral Interface (SPI) Universal Synchronous and Asynchronous serial.
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
NETWORK. To connect a computer with a network we need NETWORK ADAPTER.
Networked Embedded Systems Pengyu Zhang EE107 Spring 2016 Lecture 8 Serial Buses.
8251 USART.
BASICS OF SERIAL COMMUNICATIONS BIRLA VISHWKARMA MAHAVIDYALAYA ELECTRONICS & TELECOMMUNICATION DEPARTMENT PRESENTING BY: ABHISHEK SINGH AMANDEEP.
Serial/Fiber-Converter - IE-MCT-1RS232/485-1SC/ST
NARNARAYAN SHASTRI INSTITUTE OF TECHNOLOGY Prepared by: Wasu Ichcha kaur H Bhalani Nidhi M Dhakate Megha D MICROCONTROLLER.
Lecture 10: Programmable Logic Controllers
Serial mode of data transfer
RS-232 Communications.
Computer buses Adam Hoover connecting stuff together
Serial I/O and Data Communication.
SERIAL PORT PROGRAMMING
Serial Communications
RS-232 Communications.
Local Asynchronous Communication (RS-232)
Asynchronous Serial Communications
Serial Communication Interface
PLC’s Are ... Similar to a Microcontroller: Microprocessor Based
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
EUT 1040 Lecture 10: Programmable Logic Controllers Unrestricted.
Presentation transcript:

USART Communication using the RS standard ETEC6416

The RS232 standard Its origins predate modern computers and it contains many features that are not relevant to the modern user. It can control very old primitive modems and has many control signals to do this in hardware. It is often used without these older control and status lines. It is very common on Microcontrollers and used for communication with microcontroller peripheral devices

What is RS232 RS-232 is a popular communications interface for connecting modems and data acquisition devices (i.e. GPS receivers, electronic balances, data loggers,...) to computers. RS-232 can be plugged straight into the computer’s serial port (know as COM or Comm port). A microcontroller 0-5 TTL signal sent through a max 232 is converted to RS232

Line driver and receiver chips Typical line drivers/receivers chips for RS232 are the MAXIM MAX232 or MAX233 chips. (look these up at the original specification states that RS232 should drive 50 feet but modern line driver/receivers can manage much better than this. The maximum distance before errors occur is also a function of the type of cable used. Baud Rate | max distance | max distance shielded cable unshielded cable | 5000ft | 3000ft 300 | 5000ft| 3000ft 1200 | 3000ft | 3000ft 2400 | 1000ft | 500ft 4800 | 1000ft | 250ft 9600 | 250ft | 250ft The speed is quoted as the “BAUD” rate. Technically this is the number of signals per second. For simple transmissions this is the same as “Bits Per Second” or BPS. When RS232 is converted to audio whistles for transmission through the telephone this one to one relationship does not always hold. By using 4 different signals we can send 600 changes of signal per second ( 600 baud) but representing 2400 bits of information per second. This special coding suits the telephone system which has severe bandwidth limitations.

The transmission and reception of serial data The transmission and reception of serial data using the RS232 protocol can be undertaken in two ways; hardware and software. A special chip or special circuitry within a Microcontroller (USART) that uses a number of shift registers and holding latches/registers. Other circuitry can analyse the incoming character and detect errors such as parity, overrun and framing. Using software to control the implement the USART signal can be undertaken but most modern microcontrollers use a hardware implementation.

RS485/RS422 The main difference between RS 232 and RS 422 & 485 are The RS 232 signals are represented by voltage levels with respect to ground. There is a wire for each signal, together with the ground signal (reference for voltage levels). This interface is useful for point-to-point communication at slow speeds. For example, port COM1 in a PC can be used for a mouse, port COM2 for a modem, etc. This is an example of point-to-point communication: one port, one device. Due to the way the signals are connected, a common ground is required. This implies limited cable length - about 30 to 60 meters maximum. (Main problems are interference and resistance of the cable.) Shortly, RS 232 was designed for communication of local devices, and supports one transmitter and one receiver. RS 422 & 485 uses a different principle: Each signal uses one twisted pair (TP) line - two wires twisted around themselves. We're talking 'Balanced data transmission', or 'Differential voltage transmission'. If we label one of the TP wires 'A' and the other one 'B'. Then, the signal is inactive when the voltage at A is negative and the voltage at B is positive. Otherwise, the signal is active, A is positive and B is negative. Of course, the difference between the wires A and B matters. For RS 422 & 485 the cable can be up to 1200 meters (4000 feet) long, and commonly available circuits work at 2.5 MB/s transfer rate.

RS422/485 Implications for networking of the differences between 422 and 485 The Electrical principle is the same: both use differential transmitters with alternating voltages 0 and 5V. However, RS 422 is intended for point-to-point communications (but can be used in limited network applications). RS 422 is often used to extend a RS 232 line, or in industrial environments. RS 485 is used for multipoint communications: more devices may be connected to a single signal cable - similar to e.g. ETHERNET networks, which use coaxial cable. Most RS 485 systems use Master/Slave architecture, where each slave unit has its unique address and responds only to packets addressed to this unit. These packets are generated by Master, which periodically polls all connected slave units.

Differential signal The transmission of the RS422/485 signal is called differential, that are the result of the difference between the voltages of the two wires that make up the bus

RS485 Bus Polarity of the line According to the standard RS485 the line connections are indicated by: A also called - (minus) B also called B + (plus) GND All devices connected on the line must be connected in parallel

Twisted pair A typical network 485 may be wired using twisted pair wiring as shown It is very important that the wiring is done with twisted cable that provides maximum noise immunity. It is also possible use an unshielded cable, but this reduces network speed

Terminations,cable lengths, data transfer speed RS 422/485 line termination is essential, especially for faster data transfer rates and long cables. Main reasons for correct termination are reflections at the ends of the line, and the minimum transmitter load requirement. For RS 422, the termination is fairly simple (see picture comparing RS 422 and RS 485). A terminating resistor of 100Ohm is connected to the end of the line. If there are more RS 422 receivers connected to the line, the resistor can be a little bigger. The value can be calculated since the input impedance of the receivers is known. There are more sophisticated methods that will “bias” the line into a known state if ALL transmitters are disabled, this can be very important to avoid detection of false start bits. Also the power consumption of the terminators can be reduced, see the national semiconductor website for application notes (

Commonly available parts for RS 422/485. MAXIM; they make about ten versions - differences are in speed (0.25 or 2.5 Mbit/s), operation type (half/full duplex), number of devices (32, 128), and in several other parameters. They are labeled MAX481, 485, 487, 491 and so on. ( Another manufacturer is National Semiconductors, label DS3695A. I assume that every major manufacturer offers some circuits for RS 422/485 ( Some info in this article comes from excellent publication by Texas Instruments, who make a whole family of RS 422/485 circuits labelled SN 7517X, where X is one- or two-digit type specification. ( Also Linear Technology make 485 line drivers, receivers and transceivers. All of these manufacturers have good application notes that will help you design RS485 networks.

RS-485 Network RS-485 provides Half-Duplex, Multidrop communications over a single twisted pair cable. MASTER SLAVE-1 SLAVE-2 SLAVE-3 The standard specifies up to 32 drivers and 32 receivers can share a multidrop network Terminator resistors avoid reflected signal

RS-485 Half-duplex Half-Duplex configurations for Data Collecting and Master/Slave layouts. Usually we call this the Multidrop network Slave 1 TX ENABLE RX Slave 2 TX ENABLE RX Slave N TX ENABLE RX RTX485+ RTX GND Master TX ENABLE RX

Micro-controller connections for RS485 network Implementing RS485, one pin on each micro is used to control reading or writing R/W. All slaves have the R/W pin set to R while the master has the R/W pin set to W The master writes a signal to its usart with the R/W pin set to W. The master then sets the R/W pin to R Each slave receives the message The slave that responds set the R/W pin to W and writes a message to its USART.