BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012

Slides:



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

INPUT-OUTPUT ORGANIZATION
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.
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
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.
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.
Microprocessor Block Diagram
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)
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
4.0 rtos implementation part II
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.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
11/16/2006 WSN Mote- MCU & Sensor Hardware 1 ECET 581 Wireless Sensor Networks Mote – MCU & Sensor Hardware 2 of 3 Fall 2006
I2C Master Core Simulation Environment. I2C Master Core Requirements Coverage (*) Requirement I2C IP RS-906: The I2C IP shall define the period of time,
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.
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
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.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Embedded Communication Protocols Don Heer 10/18/10 1.
PlayStation 2 DualShock 2 Controller Ryan O’Keefe, Kabir Singh and Adrian Padin 1.
Microcontroller basics Embedded systems for mortals.
Networked Embedded Systems Sachin Katti & Pengyu Zhang EE107 Spring 2016 Lecture 9 Serial Buses – SPI, I2C.
BIRLA VISHVAKARMA MAHAVIDYALAY SUBJECT: SPI PROTOCOL & MAX7221 DISPLAY INTERFACING SUBMITTED BY: KISHAN AVASTHI( ) MANSI CHANDEGARA( )
میکرو کنترلرهای AVR Serial Interfaces, I2C and SPI
MICROCONTROLLER AND INTERFACING Presented by: Shefali Jethva ( ) Shivali Panchal ( ) Komal Soni ( ) Roll no. :- 14EC308.
©F.M. Rietti Communication Lines Fundamentals. ©F.M. Rietti LM-18 Computer Science SSI Embedded Systems I 2 Communication Lines Generally used to connect.
ECE 3430 – Intro to Microcomputer Systems
Serial Communication Originally created by Anurag Dwidedi and Rudra Pratap Suman.
ECE 3430 – Intro to Microcomputer Systems
Outline Analog to digital conversion (ADC) of NuMaker TRIO
Microcontrollers, Basics Fundamentals of Designing with Microcontrollers 16 January 2012 Jonathan A. Titus.
Serial Communication Buses: I2C and SPI
Microcontroller basics
The I2C Bus.
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Inter-IC Bus (I C) 2.
Chapter 11: Inter-Integrated Circuit (I2C) Interface
ECE 3430 – Intro to Microcomputer Systems
(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
E3165 DIGITAL ELECTRONIC SYSTEM
Atmega32 Serial Programming Basics
I2C PROTOCOL SPECIFICATION
Communication Lines Fundamentals.
EEPROM Comparison – Parallel or Serial
Computer Organization and Design
Internet-of-Things (IoT)
Interfacing Memory Interfacing.
Serial Communication Interface: Using 8251
Serial EEPROM (Atmel 24C-512)
I2C Protocol and RTC Interfacing
SPI Protocol Sepehr Naimi
Serial Peripheral Interface Bus
IN5350 – CMOS Image Sensor Design
Presentation transcript:

BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012 Serial Communication BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012

Bit serial communication concepts Serial  one bit at a time Most often using logic level signals Timing information needs to be shared between sender and receiver Transitions between bits, duration of a bit Introduction to Mechatronics, Figure 7.2 p. 107. Two major types of bit serial protocols Synchronous (shared clock) Ex. SPI, I2C Asynchronous (no shared clock) Sender and receiver maintain independent clocks Ex. RS-232, USB http://www.quatech.com/support/figures/async1.gif 9/21/2018 BJ Furman SJSU Mechanical and Aerospace Engineering ME 106

Synchronous serial communication Characteristics of synchronous serial At least one connection for serial data A clock connection Shared ground Common types Serial Peripheral Interface (SPI, developed by Freescale) Inter-Integrated Circuit bus (I2C, developed by Philips (NXT)) Arduino support I2C and SPI See next slide 9/21/2018 BJ Furman SJSU Mechanical and Aerospace Engineering ME 106

BJ Furman SJSU Mechanical and Aerospace Engineering ME 106 Developed in 1982 by Philips (now NXP) To connect CPU to peripherals in televisions Two signal lines, both are ‘open drain’, thus pull-up resistors are needed SDA (serial data) SCL (serial clock) Devices are either masters or slaves Master is the device that always drives SCL and initiates a transfer Each device has an address Data is sent in 8 bit bytes http://www.byteparadigm.com/kb/article/AA-00255/22/Introduction-to-SPI-and-IC-protocols.html Use 1.2k - 2.2k pull up resistors for Vcc = 3.3 V or 1.8 - 3.3k resistors for Vcc = 5 V 9/21/2018 BJ Furman SJSU Mechanical and Aerospace Engineering ME 106

Analog pins 4 (SCL) and 5 (SDA) must be pulled up, and a common ground is needed Margolis, M. (2012). Arduino Cookbook, O’Reilly Media, Inc., Sebastopol, CA, p. 422.

You may need to shift the voltage level from 5 V (Arduino) to 3 You may need to shift the voltage level from 5 V (Arduino) to 3.3 V for some sensors Margolis, M. (2012). Arduino Cookbook, O’Reilly Media, Inc., Sebastopol, CA, p. 423.

BJ Furman SJSU Mechanical and Aerospace Engineering ME 106 I2C protocol Master initiates transfer with a START bit (SDA from high to low while SCL is high Slave address (7 or 10 bits, 7 is most common) Transfer type (1 bit: 0 to write, 1 to read) All ICs compare address to their address If address matches, device sends an ACKNOWLEDGE signal If address does not match, device waits until bus is released by STOP condition Once master receives ACKNOWLEDGE, it then sends (writes) or receives (reads) data Receiver sends back ACKNOWLEDGE for each byte received Master concludes the transfer with STOP bit General structure of a 2-byte transfer http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html Writing 2-bytes (shaded bits are put on the bus by the master) Reading 2-bytes (shaded bits are put on the bus by the master) http://www.byteparadigm.com/kb/article/AA-00255/22/Introduction-to-SPI-and-IC-protocols.html 9/21/2018 BJ Furman SJSU Mechanical and Aerospace Engineering ME 106

Many digital components use I2C See the list from: http://forums.parallax.com/showthread.php?99160-List-of-I2C-devices

The Arduino can be ‘expanded’ using an I2C port expander device (pcf8574) http://garagelab.com/profiles/blogs/tutorial-arduino-i-o-port-expander-with-pcf8574

The Arduino can be ‘expanded’ using an I2C port expander device (pcf8574) http://garagelab.com/profiles/blogs/tutorial-arduino-i-o-port-expander-with-pcf8574

I2C device – SRF10 Ultrasonic Range Finder Devantech SRF10 3 cm – 6 m range 20 Hz max rep rate Range results in in., cm., or ms (time of flight) Always a slave (default address is 0xE0) Four registers: http://www.robot-electronics.co.uk/htm/srf10tech.htm Three commands: 9/21/2018 BJ Furman SJSU Mechanical and Aerospace Engineering ME 106

SPI interface and protocol At least one ‘master’ and ‘slave’ needed Master controls: Unidirectional data line, MOSI Master Out, Slave In (data from the master to the slave) Shared clock line, SCK (synchronizes the data transfer) Slave select line(s), SS* Which slave to be addressed Slave controls: Unidirectional data line, MISO Master In, Slave Out (data from slave to the master) Shared by slaves Non-selected slaves, “tri-state” their MISO outputs SPI is a ‘data exchange’ protocol As a bit is clocked out of the master and received by the slave, the slave clocks out a bit that is received by the master Introduction to Mechatronics, Figure 7.4 p. 109. Introduction to Mechatronics, Figure 7.5 p. 110. 9/21/2018 BJ Furman SJSU Mechanical and Aerospace Engineering ME 285

SPI data transfer modes Four transfer modes Mode 0: SCK idle low, rising edge Mode 1: SCK idle low, falling edge Mode 2: SCK idle high, falling edge Mode 3: SCK idle high, rising edge Used most often Mode 0 Mode 1 Mode 2 Mode 3 Introduction to Mechatronics, Figure 7.6 p. 111. 9/21/2018 BJ Furman SJSU Mechanical and Aerospace Engineering ME 285

Many digital components use SPI See the (partial) list of SPI devices: http://www.mct.net/faq/spi.html