©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.

Slides:



Advertisements
Similar presentations
I2C bus Inter Integrated Circuits bus by Philips Semiconductors
Advertisements

INPUT-OUTPUT ORGANIZATION
Serial Buses. Serial Bus Features Allows several devices to be connected to a set of common signal wires Reduces inter-connections and complexity Asynchronous.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Guest Lecturer Pat Pannuto Lecture 10: Serial buses Oct 6, 2011.
Embedded Systems I2CI2C. Feature 3 wire GND SCL(clock) SDA(data) All devices share the same bus wire Using wire and, each device gain access to bus (become.
Serial Interfaces, Part Deux -I 2 C and SPI December 4, 2002 Presented by Eugene Ho.
SPI Serial Peripheral Interface. SPI Serial Peripheral Interface is communication between two devices, one bit at a time sequential one bit at time over.
Lecture 8: Serial Interfaces
PH4705 ET4305 Interface Standards A number of standard digital data interfaces are used in measurement systems to connect instruments and computers for.
Serial Communication Buses: I 2 C and SPI By Brody Dunn.
9/20/6Lecture 3 - Instruction Set - Al Hardware interface (part 2)
I2CI2C CS-423 Dick Steflik. Inter-Integrated Circuit Developed and patented by Philips for connecting low speed peripherals to a motherboard, embedded.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
Lecture 27: LM3S9B96 Microcontroller – Inter- Integrated Circuit (I 2 C) Interface.
Haptic Belt team Informational Presentation.  I 2 C is a form of control bus (multi-master) which allows communication between multiple integrated circuits.
INPUT-OUTPUT ORGANIZATION
Interfaces A practical approach. Lesson 2 I2C and SPI
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 10: Serial buses Oct 6, 2011.
2 Lines Electronics I 2 C Analyzer Ching-Yen Beh Robert S. Stookey Advisor: Dr. J. W. Bruce.
SERIAL BUS COMMUNICATION PROTOCOLS
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
1 © Unitec New Zealand I2C Lecture 10 Date: - 2 Nov, 2011 Embedded Hardware ETEC 6416.
Computer Architecture Lecture 08 Fasih ur Rehman.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output.
Lecture 111 Lecture 11: Lab 3 Overview, the ADV7183B Video Decoder and the I 2 C Bus ECE 412: Microcomputer Laboratory.
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
VERIFICATION OF I2C INTERFACE USING SPECMAN ELITE By H. Mugil Vannan Experts Mr. Rahul Hakhoo, Section Manager, CMG-MCD Mr. Umesh Srivastva, Project Leader.
Embedded Bus – i2c David E. Culler Lab 2 Feb 2, 2015
Ballooning Bundle. What is a Microcontroller? Small computer with a processor core, memory and programmable input/output Continuously repeats software.
4.0 rtos implementation part II
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK–
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces: I2C & USB Rajesh K. Gupta Computer Science and Engineering University of California, San.
7/23 Inter-chip Serial Communication: SPI and I 2 C Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee.
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
1 Microprocessor-based Systems Course 9 Design of the input/output interfaces (continue)
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
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.
11/16/2006 WSN Mote- MCU & Sensor Hardware 1 ECET 581 Wireless Sensor Networks Mote – MCU & Sensor Hardware 2 of 3 Fall 2006
1 Synchronous Serial IO Send a separate clock line with data –SPI (serial peripheral interface) protocol –I 2 C (or I2C) protocol Encode a clock with data.
Refer to Chapter 15 in the reference book
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
GBT SCA overview Slide 1-5 Work status Slide 6-10 Shuaib Ahmad Khan.
PS/2 Mouse/Keyboard Port
Programmable Interrupt Controller (PIC)
Essentials of Communication This simple model requires many guarantees. Sender Receiver Communication Link Data.
Embedded Communication Protocols Don Heer 10/18/10 1.
Networked Embedded Systems Sachin Katti & Pengyu Zhang EE107 Spring 2016 Lecture 9 Serial Buses – SPI, I2C.
میکرو کنترلرهای AVR Serial Interfaces, I2C and SPI
MICROCONTROLLER AND INTERFACING Presented by: Shefali Jethva ( ) Shivali Panchal ( ) Komal Soni ( ) Roll no. :- 14EC308.
Lab 9 Multiprocessor, Buses, SPI, I2C. Multiprocessors Why multiprocessors? The structure of multiprocessors. Elements of multiprocessors: – Processing.
Chapter 6 Input/Output Organization
Outline Analog to digital conversion (ADC) of NuMaker TRIO
Chapter 11: Inter-Integrated Circuit (I2C) Interface
I/O Memory Interface Topics:
(Inter-IC bus) By Tejaswini Gadicherla
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
I2C PROTOCOL SPECIFICATION
Communication Lines Fundamentals.
BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012
Asynchronous Serial Communications
Overview of Computer Architecture and Organization
COSMOS Summer 2008 Necessary Electronics
Overview of Computer Architecture and Organization
Presentation transcript:

©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.

Roadmap Topic: –Computer interfaces: electricals, signaling, protocols This lecture –Concepts covered: Input/Output, Addressing, Synchronous, Asynchronous, Access Arbitration, Protocols, Packets, Messaging Next lecture –The USB Interface Reference –None ©2008 R. Gupta, UCSD Keywords: Bidirectional Address space Address decoding Multi-master Wired AND I2C, Master/Slave

A Processor’s Interfaces Two basic types –Communicate ‘via’ memory –Communicate directly How do we measure goodness of an interface? –Maximum data-rate of transfer? Bits or bytes per second? ©2008 R. Gupta, UCSD

Peripheral Interfaces Two ‘low cost’ interfaces –SPI: Serial Peripheral Interface (4-wire) –I2C: Inter-Integrated Circuit (2-wire) A microcontroller can control a network of devices with just two general-purpose IO pins and software. Let us examine I2C –Used for: reading from DAC, ADC, changing monitor settings, sound volume control to intelligent speakers, controlling LCD displays, reading diagnostic sensors, reading real-time clocks, turning on/off power supply for components… Many USB-to-I2C adapters to enable their use in PCs. ©2008 R. Gupta, UCSD

I2C Connects multiple devices on a multi-drop bus –“Multi-master” –Bidirectional, low-speed, synchronous to a common clock Devices can be attached or detached without affecting other devices –7-bit address space, 16 reserved, 112 nodes maximum –Distances up to a few meters (400 picoFarad max) Standard: 100 kbps (can go down to DC) –Low speed: 10 kbps, Fast: 400 kbps, FM+ 1 Mbps, HS 3.4 Mbps ©2008 R. Gupta, UCSD

I2C Wires Two Wires, bidirectional wires –SDA: Serial Data –SCL: Serial Clock ‘Open drain’: normally high when not in use –MASTER node issues the SCL and addresses SLAVES –SLAVE node receives the SCL and the address –“Wired AND” logical function. Four modes for a given device: –Master TX, Master RX, Slave TX, Slave RX ©2008 R. Gupta, UCSD

So, how do we write or read? Normally, both SDA and SCL are ‘high’ –“sense” before you drive a line A device that wants to write pulls SDA low –Followed by SCL going low So, everyone else knows that a transmission is starting ©2008 R. Gupta, UCSD

START, Data, Data,…,Data, STOP!

Putting it together Start Condition: With SCL low, SDA goes H  L Bits are ‘sampled’ on the rising edge of SCL Stop Condition: With SCL high, SDA goes L  H ©2008 R. Gupta, UCSD

“START”, “BIT” & “STOP” Start Condition: With SCL low, SDA goes H  L Bits are ‘sampled’ on the rising edge of SCL Stop Condition: With SCL high, SDA goes L  H ©2008 R. Gupta, UCSD

QUIZ Question 1: What is on SDA when it makes a transition with SCL low? Question 2: What is on SDA when it makes a transition with SCL high? Question 3: What happens if Slave is not ready to receive next BIT?

“The Protocol” Any number of bytes in an I2C packet –MSB first, each bytes transmitted must be acknowledged by the receiver –After each 8 th bit, MASTER releases SDA and then generates an additional clock pulse on SCL Receiver can then acknowledge by pulling SDA low Receiver can always abort the transmission by holding SCL low –Can not go up by the MASTER, thus no bit sampling edge ©2008 R. Gupta, UCSD

Bi-directional Data Transfers

“The Protocol” Master sends START –followed by 7-bit address of the Slave followed by single bit representing write to (0) or read from (1) the slave. Slave responds with ACK bit for that address –Master then continues in either TX or RX mode Communication transfer follows. All other MASTERS monitor START and STOP bits. ©2008 R. Gupta, UCSD

Note the direction of signaling

Multi-Master = Conflicts? More than one Master may attempt to START at the same time Signaling provides ability to prioritize and exclude ©2008 R. Gupta, UCSD

Conflicts and Tricks When a node is transmitting ‘1’ and another transmits a ‘0’ –First node can sense something is wrong…since data node is not default high Slave can do this on SCL to ‘stretch the clock’ –Or slow down the master Master can do this on the SDA to ‘get control’ (arbitration) ©2008 R. Gupta, UCSD

More on Conflicts What happens if two masters are sending a message to two different slaves? Master sending to the lower slave address always ‘wins’ arbitration ©2008 R. Gupta, UCSD

Types of Messages on I2C Single message where a Master writes to a Slave Single message where a Master reads from a Slave Combined messages where a Master issues at least two reads and/or writes to one or more slaves –Each RD or WR begins with START and the slave address –A Repeat START is not preceded by STOP Slaves figure out that data following repeat START is part of the same message. ©2008 R. Gupta, UCSD

What do messages mean? “Message Semantics” Most commonly request/response control model –Bytes following a Write command are either a command or address ©2008 R. Gupta, UCSD

Role of Software in I2C SDA and SCL lines can be controlled by simple subroutines. Example: –I2Start: check if SCL is high; wait a few micro seconds; Transition SDA H to L; wait a few micro seconds; ©2008 R. Gupta, UCSD

EXAMPLE: Memory connection ©2008 R. Gupta, UCSD

What are the limitations of I2C? Small address space Speed? –I2C implemented in Software may not even support 100 kbps? –*All* devices must at least partially support the highest speed used or they may detect spurious addresses Clock stretching affects everyone. ©2008 R. Gupta, UCSD

Exercise Is I2C communication synchronous or asynchronous? –But START and STOP delimit data packets? Is I2C duplex? Fully duplex? Draw SDA and SCL waveforms in case of transmission of START followed by $A2 = ( ) ©2008 R. Gupta, UCSD

Recap Computers interfaces with devices via memory or via direct ports I2C defines a 2-pin interface that –Performs Master-Slave communications The interface defines electrical behavior (signaling) –And the data transfer protocols (messaging) –What about the mechanicals? Next: USB interface.