Understanding SPI with Precision Data Converters

Similar documents
EE 456 Fall, Table 1 SPI bus signals. Figure 1 SPI Bus exchange of information between a master and a slave.

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

< W3150A+ / W5100 Application Note for SPI >

Serial Communication. Spring, 2018 Prof. Jungkeun Park

McMaster University Embedded Systems. Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016

App Note Application Note: Addressing Multiple FPAAs Using a SPI Interface

An SPI interface for the 65(C)02 family of microprocessors

spi 1 Fri Oct 13 13:04:

Microcontrollers and Interfacing

SPI 3-Wire Master (VHDL)

The 9S12 Serial Peripheral Inteface (SPI) Huang Section 10.2 through 10.6 SPI Block User Guide

Lecture 14 Serial Peripheral Interface

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

FPGA Implementation Of SPI To I2C Bridge

Raspberry Pi - I/O Interfaces

ECE 471 Embedded Systems Lecture 20

PARALLEL COMMUNICATIONS

PIN ASSIGNMENT PIN DESCRIPTION

SPI Overview and Operation

Growing Together Globally Serial Communication Design In Embedded System

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

SPI Universal Serial Communication Interface SPI Mode

Serial Peripheral Interface. What is it? Basic SPI. Capabilities. Protocol. Pros and Cons. Uses

CprE 488 Embedded Systems Design. Lecture 4 Interfacing Technologies

High Speed SPI Slave Implementation in FPGA using Verilog HDL

Real Time Embedded Systems. Lecture 1 January 17, 2012

Design and Verification of Serial Peripheral Interface 1 Ananthula Srinivas, 2 M.Kiran Kumar, 3 Jugal Kishore Bhandari

Using the Z8051 MCU s USI Peripheral as an SPI Interface

The Serial Peripheral Interface

SPI (Serial & Peripheral Interface)

UART TO SPI SPECIFICATION

i_csn i_wr i_rd i_cpol i_cpha i_lsb_first i_data [15:0] o_data [15:0] o_tx_ready o_rx_ready o_rx_error o_tx_error o_tx_ack o_tx_no_ack

Design Development and Implementation of SPI

Serial Peripheral Interface (SPI)

Serial Peripheral Interface (SPI) Last updated 8/7/18

Introducing SPI Xpress SPI protocol Master / Analyser on USB

Block Diagram. mast_sel. mast_inst. mast_data. mast_val mast_rdy. clk. slv_sel. slv_inst. slv_data. slv_val slv_rdy. rfifo_depth_log2.

ICS Humla CTF. Copyright 2017 Payatu 1

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -4 1 UNIT 4

LAB4. Program the on chip SPI module

DS1306. Serial Alarm Real Time Clock (RTC)

Serial Communication. Simplex Half-Duplex Duplex

Serial Peripheral Interface Bus SPI

or between microcontrollers)

OUTLINE. SPI Theory SPI Implementation STM32F0 SPI Resources System Overview Registers SPI Application Initialization Interface Examples

DataFlash. Application Note. Using Atmel s DataFlash. Introduction (AN-4)

Amarjeet Singh. January 30, 2012

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?

Using the MagAlpha Serial Interface Advanced Features. Application Note

1.3inch OLED User Manual

Part 1 Using Serial EEPROMs

SPI Block User Guide V02.07

More on the 9S12 SPI Using the Dallas Semiconductor DS1302 Real Time Clock with the 9S12 SPI

Interfacing Techniques in Embedded Systems

Serial Peripheral Interface (SPI)

Introduction to I2C & SPI. Chapter 22

Design with Microprocessors

Section 5 SERCOM. Tasks SPI. In this section you will learn:

C8051F700 Serial Peripheral Interface (SPI) Overview

Interfacing the HI7190 to a Microcontroller

Review for Exam III. Analog/Digital Converters. The MC9S12 has two 10-bit successive approximation A/D converters - can be used in 8-bit mode

AN510 Using SPI protocol with pressure sensor modules

DS1305 Serial Alarm Real Time Clock (RTC)

SPI Protocol of the TLE941xy family

EE 308 Spring Using the 9S12 SPI

Universität Dortmund. IO and Peripheral Interfaces

ASNTu2s PCB with Tiger Board USB to 7-Channel 3-Wire Interface Bridge Application Notes

From Datasheets to Digital Logic. synthesizing an FPGA SPI slave from the gates

Groking the Linux SPI Subsystem FOSDEM Matt Porter

User-configurable Resolution. 9 to 12 bits (0.5 C to C)

Serial Peripheral Interface (SPI) Host Controller Data Sheet

AN_1x66B_047 July 2009

AT89S4D12. 8-Bit Microcontroller with 132K Bytes Flash Data Memory AT89S4D12. Features. Description. Pin Configurations

PSIM Tutorial. How to Use SPI in F2833x Target. February Powersim Inc.

power supply Tamper Detect function will detect possible data modification from outside magnetic

Level Translator For SPI and I²C Bus Signals

FM25CL64 64Kb FRAM Serial 3V Memory

a Serial Peripheral Interace (SPI). Embedded RISC Microcontroller Core Peripheral

Serial Communications

DS1305EN. Serial Alarm Real-Time Clock

Mbed Microcontroller SPI. Spring, 2018 Prof. Jungkeun Park

DS1306 Serial Alarm Real-Time Clock

Menu. What is SPI? EEL 3744 EEL 3744 SPI

PIC Serial Peripheral Interface (SPI) to Digital Pot

Introduction the Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications

Digital Thermometers and Thermostats with SPI/3-Wire Interface

Application Note. Interfacing the CS5521/22/23/24/28 to the 68HC05. Figure 1. 3-Wire and 4-Wire Interfaces

Product Family Specification

Serial versus Parallel Data Transfers

DS1305EN. Serial Alarm Real-Time Clock

SILICON MICROSTRUCTURES

Getting Started with ESPI Interface Using the Z8 Encore! XP F1680

Serial Buses in Industrial and Automotive Applications

Low Voltage, 10-Bit Digital Temperature Sensor in 8-Lead MSOP AD7314

FM25L16-DG. 16Kb FRAM Serial 3V Memory. Features. Pin Configuration

Lecture 25 March 23, 2012 Introduction to Serial Communications

DS1305. Serial Alarm Real Time Clock (RTC) FEATURES PIN ASSIGNMENT ORDERING INFORMATION

Serial Communication. Simplex Half-Duplex Duplex

XS1 Link Performance and Design Guidelines

MC3635 FEATURES GENERAL DESCRIPTION

Transcription:

Understanding SPI with Precision Data Converters By: Tony Calabria Presented by: 1

Communication Comparison SPI - Serial Peripheral Interface Bus I2C - Inter- Integrated Circuit Parallel Bus Advantages Four wire interface Medium to fast data transfer speeds Full Duplex Communication Protocol flexibility Sharable Bus Two wire interface Sharable using inband address scheme Formal Standard Fast data transfer speeds Allows for fast Data converter sample rates Faster register loading Disadvantages No Formal Standard No in-band addressing No slave acknowledgement Supports one master Only short to medium distances Slower data transfer speeds Limited to 8 bit words Limited travel distance Requires pull up resistors Requires many pins Requires many traces Could cause complex layout 2

Agenda SPI Basics Timing Requirements Datasheet shown to Scale Conversion Interrupts 3

SPI History Name SPI was created by Motorola (now Freescale) There are 4 lines - 2 control lines and 2 data lines Speed of SPI bus (or clock rate) can go up to 70MHz. SPI transmits in full duplex simultaneously for both input and output data SPI requires one master and one or more slaves SPI bus is a very loose standard for control of almost any digital electronics There are also Queued SPI (QSPI), Microwire trade mark of National Semiconductor, and MicrowirePLUS, each of which is generally considered as an SPI too TI Precision Data converters SPI compatible Interface 4

High Level look Serial Peripheral Interface Bus (SPI) Master/Slave Controller/Receiver Full Duplex Send and receive simultaneously Four-wire serial bus SS Slave Select Serial Clock for the interface MOSI Master Out Slave In MISO Master In Slave Out 5

Typical SPI Bus MSP430 DSP FPGA SS MOSI MISO SPI Slave SS MOSI MISO SPI Slave SPI Master SS3 SS2 SS MOSI MISO SS MOSI MISO SPI Slave 6

SS Slave Select Slave transmit enable signal Commonly known as Chip Select or /CS Activates the SPI bus Commonly active low Sharing the SPI bus Each Slave requires own SS signal Specific SS signal active for communicating slave SS MOSI MISO 7

Clock signal for SPI transfer Transmitted from master Controls when data is transferred and latched Can be run at speeds in the tens of MHz Can Idle high or low (Clock Polarity) SS MOSI MISO 8

MOSI Data input signal DIN, DI, SDI Edge Triggered One edge used to change data Opposite edge used to latch data into slave Time between edges used for bit to transition and settle SS MOSI MISO 9

MISO Data output signal DOUT, DO, SDO Edge Triggered Slave pin becomes tri-state with SS inactive Allow to share the line across a SPI bus SS MOSI MISO 10

Clock Phasing/Polarity Clock Polarity (CPOL) Sets the base value for Clock Phase (CPHA) Determines edge data is captured on. CPHA = 0 Data captured on first clock edge CPHA = 1 Data captured on second clock edge CPOL = 0 CPHA = 0 CPHA = 1 DATA CPOL = 1 CPHA = 0 CPHA = 1 DATA 11

Critical Edge Determines clock edge when data is stable vs changing Used to set CPOL and CPHA Configure the SPI master When to latch in Data from MISO (DOUT) When to have data change on MOSI (DIN) Standard SPI uses same edge to send and receive MOSI (DIN) of converter sets critical edge 12

Critical Edge Example 1 Falling edge = Critical edge 13

Critical Edge Example 2 Timing specs related to rising edge of Rising Edge latches data in 14

Setting up the Interface Rising edge the Critical Edge in example can idle high or low in example CPOL = 0, CPHA = 0 DATA CPOL = 1, CPHA = 1 DATA 15

Agenda SPI Basics Timing Requirements Datasheet shown to Scale Conversion Interrupts 16

Timing Specs Clocking in the bits Setup times Hold times How/When MSB clocked out Propagation Delay Clocking out the bits Setup times Hold times Driving the bit change Speed Limitations Reasserting /CS 17

Clocking in the Bits Setup time Period data must be valid before critical edge Setup time DIN Hold time Required by converter Defined by controller Hold time Trans period Bit Don t Care Period data required to be valid after critical edge * Falling edge critical edge Required by converter 18

Clocking out the MSB Not driven by edge Propagation delay time until MSB out Busy/DRDY Interrupt Driven /CS /SS Enable Serial Interface /RD Signal Driven Data Unknown State MSB 19

MSB Propagation Delay Could miss MSB if clock edge appears too early Interrupt Prop delay * Falling edge critical edge MSB State Unknown DOUT MSB MSB - 1 MSB - 2 20

Clocking out the Bits DOUT Setup time Trans period * Falling edge critical edge MSB - 1 Don t Care Hold time Setup time Period data must be valid before critical edge Required by controller Set by converter Hold time Period data guaranteed to be valid after critical edge Required by controller Defined by converter 21

Driving the Bit Change The change is triggered off of Opposite edge Critical edge Opposite Edge Critical Edge MSB Transition period MSB - 1 MSB - 2 MSB Transition period MSB - 1 Fixed Hold Time 22

Speed limitation Edge driving bit change may limit speed Bit must be settled before latched into controller Bit transition time limits speed Opposite edges used to send/receive data Non-standard SPI interface FPGA Full control DOUT Transition period Bit * Falling edge critical edge 23

Possible Solutions DOUT Increased period Transition period Bit Increase Period Meet Setup/Hold timing of interface Limit throughput of converter. Use Opposite Edge Requires data changes after non-critical edge Verify valid hold time for processor Use opposite edges to read/write may require FPGA * Falling edge critical edge DOUT Read using opposite edge Transition period Bit 24

Reasserting /CS Occurs at End of Frame May latch the data word Not always required Final edge to /CS high 3-State Dout /CS Delay from Critical Edge DOUT LSB 25

ADS8332 Timing Example Reassert /CS MSB Propagation Delay Falling edge drives the bit change Falling edge is critical edge 26

Agenda SPI Basics Timing Requirements Datasheet shown to Scale Conversion Interrupts 27

Datasheet timing 28

Drawn to Scale 20MHz 25ns 50ns Read on falling edge 25ns 5ns DOUT MSB 33ns MSB-1 = 20MHz DVDD = 3.0V Transition Period Visually transition occurs on rising edge 29

Drawn to Scale 1MHz 500ns 1000ns Read on falling edge 500ns 5ns DOUT MSB 33ns MSB-1 = 1MHz DVDD = 3.0V Transition Period Visually transition occurs near falling edge 30

Agenda SPI Basics Timing Requirements Datasheet shown to Scale Conversion Interrupts 31

Interrupt Driven Alert user when conversion complete and new data is ready Signal from device used for an Interrupt Service Routine Frequency set by the data rate Signal types: /DRDY, DOUT/DRDY, EOC, BUSY I/O Alert pin Edge Driven Uses conversion clock for timing 32

Dedicated vs Shared Pin Dedicated Pin New data is ready with /DRDY falling edge /DRDY signal returns high with first falling edge Shared Pin /DRDY functionality shared with DOUT Signal will idle high and use falling edge to indicate data ready. Line will then shift data out 33

/DRDY Visual Interpretation /DRDY will appear differently depending on if the conversions are read back /DRDY will return high once MSB read back /DRDY will remain low until the interface sees an /DRDY /DRDY appears idle high DOUT /DRDY /DRDY appears idle low DOUT 34

Summary Understand the timing specs Make sure the timing specs can be met by the host processor Understand processor flexibility Ask about data rate planned to be used Will tell you required data transfer speed 35