Interfaces A practical approach. Lesson 2 I2C and SPI

Slides:



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

LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.
ECE 371 Unit 13 - Part 1 Serial Peripheral Interface (SPI)
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
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.
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
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
Serial Communication Buses: I 2 C and SPI By Brody Dunn.
Serial Peripheral Interface (SPI)
SPISPI Term Dr Abdelhafid Bouhraoua Term Dr Abdelhafid Bouhraoua.
I2CI2C CS-423 Dick Steflik. Inter-Integrated Circuit Developed and patented by Philips for connecting low speed peripherals to a motherboard, embedded.
CSS Lecture 2 Chapter 3 – Connecting Computer Components with Buses Bus Structures Synchronous, Asynchronous Typical Bus Signals Two level, Tri-state,
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
Haptic Belt team Informational Presentation.  I 2 C is a form of control bus (multi-master) which allows communication between multiple integrated circuits.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 10: Serial buses Oct 6, 2011.
SERIAL BUS COMMUNICATION PROTOCOLS
1 © Unitec New Zealand I2C Lecture 10 Date: - 2 Nov, 2011 Embedded Hardware ETEC 6416.
Serial Peripheral Interface (SPI) Bus. SPI Bus There is no official specification for the SPI bus. It is necessary to consult the data sheets of the devices.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
CRKit RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
4.0 rtos implementation part II
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK–
CRKit RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
CRKit RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
©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.
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
University of Calcutta CBM 1 ROC Design Issues Dr. Amlan Chakrabarti, Dr. Sanatan Chattopadhyay & Mr. Suman Sau.
11/16/2006 WSN Mote- MCU & Sensor Hardware 1 ECET 581 Wireless Sensor Networks Mote – MCU & Sensor Hardware 2 of 3 Fall 2006
1 Chap. 3 Interface. 2 Interface  Physical connection between node and transceiver  Network interface card (NIC)  Physical connection between transceivers.
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
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.
Microprocessor based Design for Biomedical Applications MBE 3 – MDBA XI : Project Outlooks.
Network and Systems Laboratory nslab.ee.ntu.edu.tw se.
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta
OCRP RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
OCRP RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Essentials of Communication This simple model requires many guarantees. Sender Receiver Communication Link Data.
Revised: Aug 1, ECE263 Embedded System Design Lessons 27, 28 Serial Peripheral Interface.
Department of Electronic & Electrical Engineering Serial interfaces Serial Interfaces allow communication between devices sending one bit at a time. In.
Serial Peripheral Interface SPI I2C (i-squared cee)
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Communicating. The ATmega16 communicates through one of the following ways: Serial Peripheral Interface (SPI) Universal Synchronous and Asynchronous serial.
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.
1 Serial Peripheral Interface What is it? Basic SPI Capabilities Protocol Pros and Cons Uses Serial Peripheral Interface
©F.M. Rietti Communication Lines Fundamentals. ©F.M. Rietti LM-18 Computer Science SSI Embedded Systems I 2 Communication Lines Generally used to connect.
Lab 9 Multiprocessor, Buses, SPI, I2C. Multiprocessors Why multiprocessors? The structure of multiprocessors. Elements of multiprocessors: – Processing.
Serial Communication Originally created by Anurag Dwidedi and Rudra Pratap Suman.
ECE 382 Lesson 15 Lesson Outline S/W Delays Wrap up
Serial Communication Buses: I2C and SPI
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Chapter 11: Inter-Integrated Circuit (I2C) Interface
Communication Lines Fundamentals.
BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012
EEPROM Comparison – Parallel or Serial
SPI Protocol Sepehr Naimi
Serial Peripheral Interface Bus
I/O Experiments Assignment 1.
Presentation transcript:

Interfaces A practical approach. Lesson 2 I2C and SPI 20-4-2017

Hardware description 20-4-2017

PIC18F2580 board 20-4-2017

PIC18F2580 board schematics 20-4-2017

PIC18F2580 board connector 20-4-2017

SPI Serial Peripheral Interface Bus Devices communicate in master/slave mode where the master device initiates the data frame. 20-4-2017

SPI Serial Peripheral Interface Bus 2 The SPI bus specifies four logic signals: 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). 20-4-2017

SPI Serial Peripheral Interface Bus 3 Advantages Full duplex communication Higher throughput than I²C or SMBus Complete protocol flexibility for the bits transferred Not limited to 8-bit words Arbitrary choice of message size, content, and purpose Extremely simple hardware interfacing Typically lower power requirements than I²C or SMBus due to less circuitry (including pullups) No arbitration or associated failure modes Slaves use the master's clock, and don't need precision oscillators Slaves don't need a unique address -- unlike I²C or GPIB or SCSI Transceivers are not needed 20-4-2017

SPI Serial Peripheral Interface Bus 3 Disadvantages Requires more pins on IC packages than I²C, even in the "3-Wire" variant No in-band addressing; out-of-band chip select signals are required on shared buses No hardware flow control by the slave (but the master can delay the next clock edge to slow the transfer rate) No hardware slave acknowledgment (the master could be "talking" to nothing and not know it) Supports only one master device No error-checking protocol is defined Generally prone to noise spikes causing faulty communication Without a formal standard, validating conformance is not possible Only handles short distances compared to RS-232, RS-485, or CAN-bus 20-4-2017

Hardware description SPI pic182550 20-4-2017

MASTER SYNCHRONOUS SERIAL PORT (MSSP) SPI and I2C • Serial Peripheral Interface (SPI) • Inter-Integrated Circuit (I2C™) - Full Master mode - Slave mode (with general address call) The I2C interface supports the following modes in hardware: • Master mode • Multi-Master mode • Slave mode 20-4-2017

SPI example with mcp28s08(1) 20-4-2017

SPI example with mcp28s08(2) 20-4-2017

Pic18f2580 SPI/I2C • Serial Data Out (SDO) – RC5/SDO • Serial Data In (SDI) – RC4/SDI/SDA • Serial Clock (SCK) – RC3//SCK/SCL Additionally, a fourth pin may be used when in a Slave mode of operation: • Slave Select (SS) – RA5/AN4/SS/ 20-4-2017

Inter-Intergrated circuit. I2C Two-wire interface Philips 1990’s Opend Drain signals SDA SCL +5V or 3.3 V 7 bits address -16 reserved = 112 nodes possible 10 kbits/s 100kbits/s 400 kbits/s 3.4Mbits/s 20-4-2017

I2C Protocoll overheads Rp pull up for open drain. SDA SCL Maximum bus capacitance 400 pF Protocoll overheads -slave address -sometimes registeraddress -ACK/NACK bits 20-4-2017

I2C –bus protocol 20-4-2017

I2C example MCP23008 20-4-2017

I2C example MCP23008 20-4-2017

I2C example MCP23008 init 20-4-2017

I2C example MCP23008 data out 20-4-2017

I2C example use of MCP23008 20-4-2017