Computer Architecture 10. Serial Communication Buses

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

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

Application Note 83 Fundamentals of RS 232 Serial Communications

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

Manual Serial PCI Cards

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

USB2.0 <=> I2C V4.4. Konverter Kabel und Box mit Galvanischetrennung

Advanced Data Capture and Control Systems

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

RS232 Data Interface a Tutorial on Data Interface and cables

SyncLink GT2/GT4 Serial Adapter

RS-422/485 Multiport Serial PCI Card. RS-422/485 Multiport Serial PCI Card Installation Guide

Data Cables. Schmitt TTL LABORATORY ELECTRONICS II

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

Industrial Multi-port Serial Cards

RS-232 COMMUNICATIONS

Computer buses and interfaces

Serial Communications

Cable Specifications and Information

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

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

LINDY ELECTRONICS LIMITED & LINDY-ELEKTRONIK GMBH - SECOND EDITION

The Programming Interface

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

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

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

Computer Systems Structure Input/Output

Why you need to monitor serial communication?

Note monitors controlled by analog signals CRT monitors are controlled by analog voltage. i. e. the level of analog signal delivered through the

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

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

PCS0100en Persy Control Services B.V. Netherlands

WHQL Certification Approval...2 User Interface K software FIFO 4 Universal PCI Interface...5 Ready for 64-bit System...5

DS Wire Digital Thermometer and Thermostat

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

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

HARDWARE MANUAL. BrightSign HD120, HD220, HD1020. BrightSign, LLC Lark Ave., Suite 200 Los Gatos, CA

1-Port R422/485 Serial PCIe Card

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

MFRD52x. Mifare Contactless Smart Card Reader Reference Design. Document information

Siemens DECT Engine MD32. Product Description. Information and Communication Products

Modbus Communications for PanelView Terminals

USB TO SERIAL ADAPTER

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

UM I 2 C-bus specification and user manual. Document information

The Secrets of Flow Control in Serial Communication

LS-101 LAN to Serial Device server. User s Manual

Real-time Operating Systems Lecture 27.1

DS1307ZN. 64 x 8 Serial Real-Time Clock

Appendix A. This Appendix includes the following supplemental material:

Single channel data transceiver module WIZ2-434

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Overview of the Cisco 2500 Series Access Server

DS1621 Digital Thermometer and Thermostat

RS485 & RS422 Basics

DS1621 Digital Thermometer and Thermostat

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

UMBC. ISA is the oldest of all these and today s computers still have a ISA bus interface. in form of an ISA slot (connection) on the main board.

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

Remote Serial over IP Introduction on serial connections via IP/Ethernet

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

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

WHQL Certification Approval...2 User Interface...3 SUNIX s COMLab..4

Ethernet. Ethernet Frame Structure. Ethernet Frame Structure (more) Ethernet: uses CSMA/CD

1000BASE-T and 10/100/1000BASE-T Copper SFP Transceiver

Software User Guide UG-461

GTS-4E Hardware User Manual. Version: V1.1.0 Date:

NB3H5150 I2C Programming Guide. I2C/SMBus Custom Configuration Application Note

PCMCIA 1 Port RS EDITION OCTOBER 1999

USB to serial chip CH340

BLUETOOTH SERIAL PORT PROFILE. iwrap APPLICATION NOTE

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

When we look at the connector pinout of the RS232 port, we see two pins which are certainly used

SYNC MAX PCI Adapter

Algemene Theorie en Vaardigheden 2. April 2014 Theaterschool OTT-2

Serial port interface for microcontroller embedded into integrated power meter

DS1104 R&D Controller Board

RS-232 Communications Using BobCAD-CAM. RS-232 Introduction

UART IP Core Specification. Author: Jacob Gorban

Programmable set for Ethernet Modbus/TCP in IP67 TI-BL67-PG-EN-2

ESPA Nov 1984 PROPOSAL FOR SERIAL DATA INTERFACE FOR PAGING EQUIPMENT CONTENTS 1. INTRODUCTION 2. CHARACTER DESCRIPTION

RS-422 and RS-485 Application Note

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

USER GUIDE EDBG. Description

VSCOM USB PRO Series Industrial I/O Adapters

RS-485 Protocol Manual

Elo Interactive Digital Signage (IDS): Remote Management

EvB 5.1 v5 User s Guide

Cable Specifications and Information

Web Site: Forums: forums.parallax.com Sales: Technical:

Designing VM2 Application Boards

a8251 Features General Description Programmable Communications Interface

Docklight Pro Monitor User Manual 10/2015

Using Xbee in Serial Communication

A DIY Hardware Packet Sniffer

Comtrol Cable User Guide

Cabling LANs and WANs

Network Monitoring White Paper

Transcription:

Computer Architecture 10 Serial Communication Buses Ma d e wi t h Op e n Of f i c e. o r g 1

Serial Communication Sending data one bit at one time, sequentially Serial vs parallel communication cable cost (or PCB space), synchronization, distance! speed? Improved serial communication technology allows for transfer at higher speeds and is dominating the modern digital technology: RS232, RS-485, I2C, SPI, 1-Wire, USB, FireWire, Ethernet, Fibre Channel, MIDI, Serial Attached SCSI, Serial ATA, PCI Express, etc. Ma d e wi t h Op e n Of f i c e. o r g 2

RS232, EIA232 The Electronic Industries Alliance (EIA) standard RS-232-C (1969) definition of physical layer (electrical signal characteristics: voltage levels, signaling rate, timing, short-circuit behavior, cable length, etc.) 25 or (more often) 9-pin connector serial transmission (bit-by-bit) asynchronous operation (no clock signal) truly bi-directional transfer (full-duplex) only limited power can be supplied to another device numerous handshake lines (seldom used) many protocols use RS232 (e.g. Modbus) Ma d e wi t h Op e n Of f i c e. o r g 3

Voltage Levels RS-232 standard convert TTL/CMOS-level signals into bipolar voltage levels to improve noise immunity and support long cable lengths TTL/CMOS RS232: 0V = logic zero +3V +12V (SPACE) +5V (+3.3V) = logic one 3V 12V (MARK) Some equipment ignores the negative level and accepts a zero voltage level as the "OFF" state The "dead area" between +3V and -3V may vary, many receivers are sensitive to differentials of 1V or less Ma d e wi t h Op e n Of f i c e. o r g 4

Data frame Complete one-byte frame consists of: start-bit (SPACE), data bits (7, 8), stop-bits (MARK) e.g. 9600, 8N1, 19200, 7E1 TTL (5V) RS-232 byte transfer (ASCII 'b'=0x61 hex) Voltage converter Typical RS-232 byte transfer (ASCII 'b'=0x61 hex) Ma d e wi t h Op e n Of f i c e. o r g 5

Data Rates Pure EIA RS-232C standard permits data rates up to 19200 bps and cable lengths up to 400 meters (but not both) Data rates as high as 256kbps (over less than 2 m) are possible Universal Asynchronous Receiver/Transmitter (UART) component responsible for fast communication via RS-232 Common 16550 UART incorporates a 16-byte FIFO and is mandatory for communications at speeds above 9600 bps Ma d e wi t h Op e n Of f i c e. o r g 6

DTE and DCE The RS-232 defines two classes of devices: data terminal equipment (DTE) computer (male) male chauvinism? data communication equipment (DCE) modem (female) e.g. TD is output line on DTE, but input line on DCE distinction between DTE&DCE allows to avoid confusion Ma d e wi t h Op e n Of f i c e. o r g 7

Signals Complete RS232 standard define a lot of signals and is fairly complex Many communications options exist, but only very few are used in practice CTS DCD DCE DSR DSRS DTE DTR FG NC RCk RI RTS RxD SG SCTS SDCD SRTS SRxD STxD TxD Clear To Send [DCE --> DTE] Data Carrier Detected (Tone from a modem) [DCE --> DTE] Data Communications Equipment eg. modem Data Set Ready [DCE --> DTE] Data Signal Rate Selector [DCE --> DTE] (Not common) Data Terminal Equipment eg. computer, printer Data Terminal Ready [DTE --> DCE] Frame Ground (screen or chassis) No Connection Receiver (external) Clock input Ring Indicator (ringing tone detected) Request To Send [DTE --> DCE] Received Data [DCE --> DTE] Signal Ground Secondary Clear To Send [DCE --> DTE] Secondary Data Carrier Detected (Tone)[DCE -> DTE] Secondary Ready To Send [DTE --> DCE] Secondary Received Data [DCE --> DTE] Secondary Transmitted Data [DTE --> DTE] Transmitted Data [DTE --> DTE] Ma d e wi t h Op e n Of f i c e. o r g 8

Handshaking Hardware handshaking RTS/CTS DTE asserts the "request to send" (RTS) signal when it is ready to receive data and deasserts it when it cannot accept data; a DCE asserts "clear to send" (CTS) when it is ready to receive data DTR/DTE DTE asserts the "data terminal ready" (DTR) signal, and DCE asserts the "data set ready" (DSR) signal Software handshaking XON/XOFF requires that the receiver send a character (Control-S, ASCII 19) to halt data transfer and another character (Control-Q, ASCII 17) to resume transfer Ma d e wi t h Op e n Of f i c e. o r g 9

Seldom used features Signal rate selection The DTE or DCE can specify use of a "high" or "low" signaling rate Timing signals Some synchronous devices provide a clock signal to synchronize data transmission Secondary channel Data can be sent over a secondary channel, which is equivalent to the primary channel Ma d e wi t h Op e n Of f i c e. o r g 10

Interface Sub-D 25, Sub-D 9, RJ45 and others DTE D DCE Straight connection DTE DTE Null-modem (cross-over cable) DTE Loopback wiring Various DB25 to DB9 adapters Ma d e wi t h Op e n Of f i c e. o r g 11

Null-modem Wirings Ma d e wi t h Op e n Of f i c e. o r g 12

Loopback Wirings Ma d e wi t h Op e n Of f i c e. o r g 13

Weaknesses Common ground Requirement for positive and negative supplies Low transfer rate Point-to-point only communication Asymmetrical definitions of DTE and DCE Many unnecessary communication options No method for sending power to a device Recommended connector is large by current standards Ma d e wi t h Op e n Of f i c e. o r g 14

Strengths RS-232 is gradually being superseded by USB for local communications but... USB is more complex (physical layer + protocol + driver) and has no direct analog to the terminal programs for 'raw' communication RS232 control lines of the interface can be easily manipulated by software to control various simple hardware devices (lamps, relays, etc.) Lots of communication protocols can be easily implemented over RS232 (by software or hardware) Simplicity makes it good for all applications where speed is not critical but distance may be quite long It is available in most of microcontrollers Ma d e wi t h Op e n Of f i c e. o r g 15

RS232 Forever... PCI-Express Card with 1 RS232C Port Ma d e wi t h Op e n Of f i c e. o r g 16

Related Standards RS-422 similar to RS-232 but with differential signaling RS-485 a two-wire differential signaling (U+, U-) half-duplex multipoint serial connection (inexpensive local networks) speeds up to 35 Mbit/s (10 m) and 100 kbit/s (1200 m) Ma d e wi t h Op e n Of f i c e. o r g 17

Differential Signaling Tolerance of ground offsets Suitability for use with low-voltage electronics Resistance to electromagnetic interference RS-485, PCI Express, USB,... Ma d e wi t h Op e n Of f i c e. o r g 18

USB Universal Serial Bus (USB) was intended to help retire all legacy varieties of serial and parallel ports (1995) single standardized interface socket plug-and-play + hot swapping providing power to low-consumption devices allowing many standard devices to be used without requiring manufacturer specific No direct access to physical layer Complex software+hardware error correction, protocols, device classes, etc. Ma d e wi t h Op e n Of f i c e. o r g 19

USB Bus Topology USB system: host+interconnect+devices USB always connects devices with host Interconnect topology is a tiered star Ma d e wi t h Op e n Of f i c e. o r g 20

Speed There are 3 data rates: USB high-speed 480 Mb/s USB full-speed 12 Mb/s USB low-speed 1.5 Mb/s Experimental USB 3.0 Super-Speed 4.8 Gbit/s (600 MB/s) The actual throughput attained with real devices is about ⅔ of the maximum theoretical bulk data transfer rate Ma d e wi t h Op e n Of f i c e. o r g 21

Electrical Interface Four-wire cable, differential signaling, half-duplex, Twisted pair data cable with 90Ω ±15% impedance 0.0 0.3V Low and 2.8 3.6V High (Low/Full Speed) ±400mV in High Speed (+ protocol to negotiate HS) Clock tolerance: 480.00 Mbit/s ±0.05% 12.000 Mbit/s ±0.25% 1.50 Mbit/s ±1.5% Ma d e wi t h Op e n Of f i c e. o r g 22

Data Signaling (Low/Full) Data transmission is organized in packets NRZI (non-return-to-zero inverted) encoding Ma d e wi t h Op e n Of f i c e. o r g 23

NRZI Encoding Binary code in which "1s" and "0s" are represented with no other neutral or rest condition Not a self-synchronizing code, synchronization technique must be used to avoid bit slip "1" is represented by a transition "0" has no transition Ma d e wi t h Op e n Of f i c e. o r g 24

I²C - Inter-Integrated Circuit I²C (I-squared-C( I-squared-C) ) Philips (NXP), early 80's (XX) communication between integrated circuits only two wires (+ common ground) small PCB's multi-master/multi-slave, bidirectional, 8-bit no strict baud rate requirements (master sends the clock) 7bit or 10bit unique device addressing simple hardware or (easy) software implementation Ma d e wi t h Op e n Of f i c e. o r g 25

Highly-integrated TV set Ma d e wi t h Op e n Of f i c e. o r g 26

Characteristics Speed: 100 kbps (standard mode) 400 kbps (fast mode) 3.4 Mbps (high-speed mode) Two-wired bus serial data line (SDA) serial clock line (SCL) Voltage levels not fixed, depends on supply level of voltage HIGH 1 LOW 0 Ma d e wi t h Op e n Of f i c e. o r g 27

Bit Transfer Bit transfer is level triggered SCL = 0 1 SDA = valid data one clock pulse per data bit stable data during high clocks data change during low clocks Ma d e wi t h Op e n Of f i c e. o r g 28

Start and Stop SCL & SDA are high when idle open-drain + pull-up resistor Start condition (S) SDA 1 0 transition when SCL = 1 Stop condition (P) SDA 0 1 transition when SCL = 1 Ma d e wi t h Op e n Of f i c e. o r g 29

Acknowledge All transfers are initiated by master Slave must respond with acknowledge Ma d e wi t h Op e n Of f i c e. o r g 30

Data Frame Start + Slave address + Direction Command Acknowledge from slave Data (master slave slave or slave master master) ) + Ack. Stop Ma d e wi t h Op e n Of f i c e. o r g 31

Master transmitter Frame Formats Master receiver Combined Ma d e wi t h Op e n Of f i c e. o r g 32

Addressing 7-bit addressing max. 112 slaves 7 addresses reserved e.g. broadcast, start-byte, 10-bit extension 10-bit addressing 11110 prefix + 10 address bit (R/W in the middle) 1024 new addresses Ma d e wi t h Op e n Of f i c e. o r g 33

Closing Remarks Elegance of I²C: simplicity & effectiveness shared bus, reasonable speed, two wires (pins), hotplug flexible timing: no strict baud rate, clock stretching arbitration & collision detection in multi-master mode One of most common communication standard for microcontrollers & integrated circuits No licensing fees for I²C implementation, but required to obtain I²C slave addresses Limited Address Space: devices with configurable address higher bits indicate model, lower bits - type Ma d e wi t h Op e n Of f i c e. o r g 34

Derivatives System Management Bus (SMBus) low-bandwidth devices on a PC motherboard laptop's battery, temperature, fan, or voltage sensors, configuration data of DDR2,... VESA Display Data Channel (DDC) connection between monitor graphics card with VGA, DVI, HDMI connectors Two Wire Interface (TWI)... I 2 C implemented on chips from Atmel Ma d e wi t h Op e n Of f i c e. o r g 35

1-Wire Registered trademark of Dallas Semiconductor Corp. (now Maxim-Dallas) Signaling and power using 1 wire (+ ground) Low-speed ( < 1 kbps) Long range (up tp 500m) Low cost Easy implementation Typically used to communicate with small inexpensive devices such as digital thermometers and weather instruments Ma d e wi t h Op e n Of f i c e. o r g 36

Available Devices Memory: EPROM, SRAM, EEPROM, ROM, NV Temperature Sensors and Switches 1-Wire Interfaces A-to-D Converters Timekeeping and Real-Time Clocks Battery Protectors, Selectors, and Monitors... Ma d e wi t h Op e n Of f i c e. o r g 37

Powering 1-Wire Devices With external supply DS18B20 - Programmable Resolution 1-Wire Digital Thermometer, 55 C to +125 C, ±0.5 C accuracy and user-definable nonvolatile alarm settings Parasite-powered Ma d e wi t h Op e n Of f i c e. o r g 38

Device Addressing There is always one bus master Many slave devices can share the same bus Each device has a unique 64-bit serial number There are broadcast commands and commands addressed to particular devices The bus also has an algorithm to recover the address of every device on the bus Ma d e wi t h Op e n Of f i c e. o r g 39

Transaction Sequence Step 1. Initialization reset pulse Step 2. ROM Command (followed by any required data exchange) Search, Read, Match, Skip, Alarm,... Step 3. Function Command (followed by any required data exchange) Read, Write, ReadPowerSupply,... Ma d e wi t h Op e n Of f i c e. o r g 40

Initialization Reset pulse transmitted by the bus master followed by presence pulse(s) transmitted by the slave(s) The presence pulse lets the bus master know that slave devices are on the bus Ma d e wi t h Op e n Of f i c e. o r g 41

Master Write Bit Write time slots are initiated by the master pulling the 1-Wire bus low Write 0 time slot: after pulling the bus low, the bus master continues to hold the bus low for the time slot Write 1 time slot: after pulling the bus low, the bus master releases the bus (pullup will pull the bus high) Ma d e wi t h Op e n Of f i c e. o r g 42

Master Read Bit Slaves can only transmit data to the master after the master issues read-related commands After the master initiates the read time slot, the slave begins transmitting a 1 or 0 on bus 1 is transmitted by leaving the bus high and 0 by pulling the bus low Ma d e wi t h Op e n Of f i c e. o r g 43

SPI Serial Peripheral Interface Bus (SPI) - Motorola four wire" serial bus synchronous serial data link (clock signal) full duplex mode multiple slaves are allowed with individual slave select (chip select) SCLK Serial Clock (output from master) MOSI/SIMO Master Output, Slave Input (output from master) MISO/SOMI Master Input, Slave Output (output from slave) SS Slave Select (active low; output from master) Ma d e wi t h Op e n Of f i c e. o r g 44

Data Transmission During each SPI clock cycle, a full duplex data transmission occurs: the master sends a bit on the MOSI line; the slave reads it from that same line (rising SCLK) the slave sends a bit on the MISO line; the master reads it from that same line (falling SCLK) Ma d e wi t h Op e n Of f i c e. o r g 45

Closing Remarks Advantages Full duplex communication Very fast - higher throughput than I²C Arbitrary choice of message size and content Extremely simple hardware interfacing No arbitration or associated failure modes No synchronization problems Disadvantages more lines/pins than I²C No hardware flow control, no slave acknowledgment limited to a single slave short distances Ma d e wi t h Op e n Of f i c e. o r g 46