Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS



Similar documents
SPI I2C LIN Ethernet. u Today: Wired embedded networks. u Next lecture: CAN bus u Then: wireless embedded network

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

Eliminate Risk of Contention and Data Corruption in RS-485 Communications

Serial Communications

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

User Manual IC-485AI

MDM192 MULTI-DROPS DIGITAL MODEM FOR PRIVATE LINE. USER GUIDE Document reference :

Cable Guide. Click on the subject to view the information. Digi Cables Building Cables General Cable Information

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

Local Interconnect Network Training. Local Interconnect Network Training. Overview

Why you need to monitor serial communication?

2-Port RS232/422/485 Combo Serial to USB2.0 Adapter (w/ Metal Case and Screw Lock Mechanism) Installation Guide

USB TO SERIAL ADAPTER

Distributed Real-Time Systems (TI-DRTS) Track 2. CAN-BUS Introduction. Version Ref. VECTOR application note & Motorola note

LIN (Local Interconnect Network):

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

Implementing SPI Communication Between MSP430 G2452 and LTC ADC

Process Control and Automation using Modbus Protocol

Implementing MOD bus and CAN bus Protocol Conversion Interface

Single channel data transceiver module WIZ2-434

How To Encode Data From A Signal To A Signal (Wired) To A Bitcode (Wired Or Coaxial)

Application Note 83 Fundamentals of RS 232 Serial Communications

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

RS-232 COMMUNICATIONS

Tutorial.

Modbus Communications for PanelView Terminals

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Raspberry Pi. Hans- Petter Halvorsen, M.Sc.

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

ALL-USB-RS422/485. User Manual. USB to Serial Converter RS422/485. ALLNET GmbH Computersysteme Alle Rechte vorbehalten

Understanding SAE J1939. by Simma Software, Inc.

Vehicle data acquisition using CAN By Henning Olsson, OptimumG

Software User Guide UG-461

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

Date Rev. Details Author

Welcome to the Introduction to Controller Area Network web seminar My name is William Stuart, and I am a Applications Engineer for the Automotive

USB to serial chip CH340

Manual Serial PCI Cards

Encore Controller to Router Connections

Data Cables. Schmitt TTL LABORATORY ELECTRONICS II

RS485 & RS422 Basics

Tutorial Introduction

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

Serial Communications (Chapter 10) RS232, SPI, I2C

DS Wire Digital Thermometer and Thermostat

Real-time Operating Systems Lecture 27.1

FOSTCDR. Industrial Serial to Multimode Fiber Optic Converter PRODUCT INFORMATION B&B ELECTRONICS. Specifications Serial Technology

1.Eastron SDM220Modbus Smart Meter Modbus Protocol Implementation V1.0

RS-232/422/485, Power over Ethernet

Current Loop Application Note 1495

MODBUS over Serial Line. Specification & Implementation guide V1.0

T1 Networking Made Easy

SyncLink GT2/GT4 Serial Adapter

2.1 CAN Bit Structure The Nominal Bit Rate of the network is uniform throughout the network and is given by:

MCB3101 (Class I) WiRobot Serial Bluetooth Wireless Module User Manual

Serial Communications

DS1621 Digital Thermometer and Thermostat

Fast Ethernet and Gigabit Ethernet. Networks: Fast Ethernet 1

s!nus-elektrotechnikai bt. Industrial IT & Automation

Bluetooth UART/RS232 Module

M-Bus Network Installation Notes

1-Port R422/485 Serial PCIe Card

What is Easy-Radio? Devices Covered. Frequency Hopping Transceiver. Where x00 denotes frequency of operation. E.g. 400 = 433MHz

Cable Guide Including all PortServer TS, Digi Connect, and Digi One Products

applicomio Profibus-DP

DK40 Datasheet & Hardware manual Version 2

MODBUS over Serial Line. Specification and Implementation Guide V1.02

1.1 Connection Direct COM port connection. 1. Half duplex RS232 spy cable without handshaking

USER GUIDE EDBG. Description

Cable Guide For all PortServer TS, Digi Connect, and Digi One Products

Objectives. Basics of Serial Communication. Simplex vs Duplex. CMPE328 Microprocessors (Spring ) Serial Interfacing. By Dr.

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

In-Vehicle Networking

SafeSPI - Serial Peripheral Interface for Automotive Safety

Chapter 9A. Network Definition. The Uses of a Network. Network Basics

Fast Ethernet and Gigabit Ethernet. Computer Networks: Fast and Gigabit Ethernet

GE Power Controls FIELDBUS APPENDIX PROFIBUS DP. Doc. No.: ASTAT Plus PB_Appendix-v0

Introduction: Implementation of the MVI56-MCM module for modbus communications:

KOM200. Industrial Serial to Fiber Media Converter. User s Manual

Automotive Communication Network Trends

DeviceNet Communication Manual

2-Port RS232/422/485 Combo Serial PCI Card

Embedded Systems Design Course Applying the mbed microcontroller

Bluetooth Audio Data Transfer between Bluetooth chipset (PMB6752&PMB6625) and TriCore Host TC1920

RS232C < - > RS485 CONVERTER S MANUAL. Model: LD15U. Phone: / 97 / 98 (M)

RS-422 and RS-485 Application Note

Cable Pinouts. SRP I/O Module

CS263: Wireless Communications and Sensor Networks

RJ45 Shielded (standard) port pinout. CS9000, Jetstream , Lanstream 2000, RTA8/RJX, RRC16, MTA8/RJX & SXDC8/RJX

Quectel Cellular Engine

The Programming Interface

Bluetooth to Serial Adapter

LOW COST GSM MODEM. Description. Part Number

SMS based remote control system

DS1621 Digital Thermometer and Thermostat

Data Bulletin. Communications Wiring for POWERLINK G3 Systems Class 1210 ABOUT THIS BULLETIN APPLICATION INTRODUCTION.

Computer Systems Structure Input/Output

Lizy Kurian John Electrical and Computer Engineering Department, The University of Texas as Austin

Based on Computer Networking, 4 th Edition by Kurose and Ross

Transcription:

SERIAL I/O COMMON PROTOCOLS

RS-232 Fundamentals

What is RS-232 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).

RS-232 Signals Architecturally RS-232 is a bi-directional point to point link. Two independent channels are established for two-way (fullduplex) communications. RS-232 can also carry additional signals used for flow control (RTS, CTS) and modem control (DCD, DTR, DSR, RI). (serial port - PC side)

RS-232 Line Driver Unbalanced Line Drivers Each signal appears on the interface connector as a voltage with reference to a signal ground. The idle state (MARK) has the signal level negative with respect to common whereas the active state (SPACE) has the signal level positive respest to the same reference.

RS-232 Speed How fast can RS-232 be? The maximum speed, according to the standard, is 20kbit/s. However, modern equipment can operate much faster than this. (i.e. Lynx can reach 115200 baud.) The length of the cable also plays a part in maximum speed. The longer the cable and the slower the speed at which you can obtain accurate results. A large wire capacitance and inductance limits the maximum length of the cable and/or the maximum speed; Moreover higher is the capacitance of the cable higer is the interference between two adjacent signal wire. 50 feet (15m) @ max baudrate is commonly quoted as the maximum distance. It is not specified in EIA standard but it s recommended respect these values.

RS-232 sw settings One byte of async data has: Start Bit = 1 (always); Stop bits = 1 (or 2) Data Bits = 8 (or 7); Parity = NONE (or EVEN or ODD) + 25-25

What is RS-485? RS-485 is a EIA standard interface which is very common in the data acquisition world RS-485 provides balanced transmission line which also can be shared in Multidrop mode. It allows high data rates communications over long distances in real world environments. How fast can RS-485 be? RS-485 was designed for greater distance and higher baudrates than RS-232. According to the standard, 100kbit/s is the maximum speed and distance up to 4000 feet (1200 meters) can be achieved.

RS-485 Line Driver Balanced Line Drivers Voltage produced by the driver appears across a pair of signal wires that transmit only one signal. Both wires are driven opposite. RS-485 driver has always the Enable direction control signal. Differential system provides noise immunity, because much of the common mode signal can be rejected by the receiver. So ground shifts and induced noise signals can be nullified.

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

RS-485 Half-duplex TX ENABLE RX Master RTX485+ RTX485-485GND TX ENABLE RX TX ENABLE RX TX ENABLE RX Slave 1 Slave 2 Slave N

RS-485 Full-duplex Potentially RS-485 interface can also use 4-wires to communicate in multidrop mode ENABLE TX RX Scanner TX485+ RX485+ TX485- RX485-485GND TX RX Other device ENABLE

RS-232 vs RS-485 The architectural difference between RS-232 and RS-485 is that 232 is a bi-directional point to point link, whereas 485 is a single channel bus. Electrically, each 232 signal uses a single wire with symmetric voltages about a common ground wire. 485 uses two wires to carry the single signal differentially. The big difference to the software is that only one device on a 485 bus can transmit at a time, whilst there is not similar limitation on RS232 because is a peer-to-peer link

RS-232 vs RS-485

I 2 C and SPI

I 2 C and SPI Serial communication protocols Meant for short distances inside the box Low complexity Low cost Low speed (a few Mbps at the fastest )

What is I 2 C? Shorthand for an Inter-integrated circuit bus Developed by Philips Semiconductor for TV sets in the 1980 s I 2 C devices include EEPROMs, thermal sensors, and real-time clocks Used as a control interface to signal processing devices that have separate data interfaces, e.g. RF tuners, video decoders and encoders, and audio processors. I 2 C bus has three speeds: Slow (under 100 Kbps) Fast (400 Kbps) High-speed (3.4 Mbps) I 2 C v.2.0 Limited to about 10 feet for moderate speeds

I 2 C Bus Configuration 2-wire serial bus Serial data (SDA) and Serial clock (SCL) Half-duplex, synchronous, multi-master bus No chip select or arbitration logic required Lines pulled high via resistors, pulled down via opendrain drivers (wired-and)

I 2 C Protocol 1. Master sends start condition (S) and controls the clock signal 2. Master sends a unique 7-bit slave device address 3. Master sends read/write bit (R/W) 0 - slave receive, 1 - slave transmit 4. Receiver sends acknowledge bit (ACK) 5. Transmitter (slave or master) transmits 1 byte of data

I 2 C Protocol (cont.) 6. Receiver issues an ACK bit for the byte received 7. Repeat 5 and 6 if more bytes need to be transmitted. 8.a) For write transaction (master transmitting), master issues stop condition (P) after last byte of data. 8.b) For read transaction (master receiving), master does not acknowledge final byte, just issues stop condition (P) to tell the slave the transmission is done

I 2 C Signals Start high-to-low transition of the SDA line while SCL line is high Stop low-to-high transition of the SDA line while SCL line is high Ack receiver pulls SDA low while transmitter allows it to float high Data transition takes place while SCL is low, valid while SCL is high

I 2 C Features Clock stretching when the slave (receiver) needs more time to process a bit, it can pull SCL low. The master waits until the slave has released SCL before sending the next bit. General call broadcast addresses every device on the bus 10-bit extended addressing for new designs. 7-bit addresses all exhausted

I 2 C Tradeoffs Advantages: Good for communication with on-board devices that are accessed occasionally. Easy to link multiple devices because of addressing scheme Cost and complexity do not scale up with the number of devices Disadvantages: The complexity of supporting software components can be higher than that of competing schemes ( for example, SPI ).

What is SPI? Shorthand for Serial Peripheral Interface Defined by Motorola on the MC68HCxx line of microcontrollers Generally faster than I 2 C, capable of several Mbps Applications: Like I 2 C, used in EEPROM, Flash, and real time clocks Better suited for data streams, i.e. ADC converters Full duplex capability, i.e. communication between a codec and digital signal processor

SPI Bus Configuration Synchronous serial data link operating at full duplex Master/slave relationship 2 data signals: MOSI master data output, slave data input MISO master data input, slave data output 2 control signals: SCLK clock /SS slave select (no addressing)

SPI vs. I 2 C For point-to-point, SPI is simple and efficient Less overhead than I 2 C due to lack of addressing, plus SPI is full duplex. For multiple slaves, each slave needs separate slave select signal More effort and more hardware than I 2 C

SPI Protocol 2 Parameters, Clock Polarity (CPOL) and Clock Phase (CPHA), determine the active edge of the clock CPOL CPHA Active edge 0 0 Rising 0 1 Falling 1 0 Falling 1 1 Rising Master and slave must agree on parameter pair values in order to communicate

CAN Protocol

ISO-OSI Reference Model 7. Application Layer CAN Layers 2. Data Link Layer 1. Physical Layer 6. Presentation Layer 5. Session Layer 4. Transport Layer 3. Network Layer HLPs: CANopen, DeviceNet, OSEK/VDX CAN Protocol Partially Implemented by High Layer Protocol (HLP)

CAN Bus Logic 1 Recessive (r) 0 Dominant (D) Two logic states on the CAN bus Node 1 Node 2 Node 3 Bus D D D D D D r D D r D D D r r D r D D D r D r D r r D D r r r r Wired-AND Function Bus in dominant state Bus in recessive state or idle

Typical CAN Node TXD CAN_H µcontroller CAN Controller CAN Transceiver RXD CAN_L CAN Bus is a simple 2-wire differential serial bus CAN Bus is terminated on each side by a 120 Ohm resistor CAN Bus

CAN Bit Coding & Bit Stuffing Bit Coding : NRZ (Non-Return-To-Zero code) does not ensure enough edges for synchronization Stuff Bits are inserted after 5 consecutive bits of the same level Stuff Bits have the inverse level of the previous bit. No deterministic encoding, frame length depends on transmitted data Number of consecutive bits with the same polarity

CAN Bus Access and Arbitration: CSMA/CD and AMP CSMA/CD: Carrier Sense Multiple Access / Collision Detection AMP: Arbitration by Message Priority

CAN Bus Synchronization Hard synchronization at Start Of Frame bit Re-Synchronization on each Recessive to Dominant bit