Arbitration and Switching Between Bus Masters



Similar documents
LMS is a simple but powerful algorithm and can be implemented to take advantage of the Lattice FPGA architecture.

Pre-tested System-on-Chip Design. Accelerates PLD Development

SPI Flash Programming and Hardware Interfacing Using ispvm System

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

Using Altera MAX Series as Microcontroller I/O Expanders

LatticeECP3 High-Speed I/O Interface

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

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Chapter 02: Computer Organization. Lesson 04: Functional units and components in a computer organization Part 3 Bus Structures

ice40 Oscillator Usage Guide

Simulating Power Supply Sequences for Power Manager Devices Using PAC-Designer LogiBuilder

LatticeXP2 Configuration Encryption and Security Usage Guide

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

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

EMC6D103S. Fan Control Device with High Frequency PWM Support and Hardware Monitoring Features PRODUCT FEATURES ORDER NUMBERS: Data Brief

Eureka Technology. Understanding SD, SDIO and MMC Interface. by Eureka Technology Inc. May 26th, Copyright (C) All Rights Reserved

ZL30136 GbE and Telecom Rate Network Interface Synchronizer

DS Wire Digital Thermometer and Thermostat

Application Note 132. Introduction. Voice Video and Data Communications using a 2-Port Switch and Generic Bus Interface KSZ MQL/MVL

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

1. Introduction IIM7010A Features. WIZnet Inc.

LatticeECP2/M S-Series Configuration Encryption Usage Guide

DS1621 Digital Thermometer and Thermostat

LogiCORE IP AXI Performance Monitor v2.00.a

Introduction to PCI Express Positioning Information

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

DS1307ZN. 64 x 8 Serial Real-Time Clock

MAX II ISP Update with I/O Control & Register Data Retention

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication

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

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

LC898300XA. Functions Automatic adjustment to the individual resonance frequency Automatic brake function Initial drive frequency adjustment function

Software User Guide UG-461

AVR315: Using the TWI Module as I2C Master. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

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

7 OUT1 8 OUT2 9 OUT3 10 OUT4 11 OUT5 12 OUT6 13 OUT7 14 OUT8 15 OUT9 16 OUT10 17 OUT11 18 OUT12 19 OUT13 20 OUT14 21 OUT15 22 OUT16 OUT17 23 OUT18

Serial port interface for microcontroller embedded into integrated power meter

DS1621 Digital Thermometer and Thermostat

HDMM01 V1.0. Dual-axis Magnetic Sensor Module With I 2 C Interface FEATURES. Signal Path X

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

Transmission of High-Speed Serial Signals Over Common Cable Media

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

Embedded Multi-Media Card Specification (e MMC 4.5)

Command Processor for MPSSE and MCU Host Bus Emulation Modes

ST19NP18-TPM-I2C. Trusted Platform Module (TPM) with I²C Interface. Features

Table 1: Address Table

APNT#1168 Modbus - Establishing Communications Hints

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

SAN Conceptual and Design Basics

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

Security & Chip Card ICs SLE 44R35S / Mifare

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

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

MachXO2. CAT5e Cable. MachXO2

TWI module seems buggy in multi-master communications

Future Technology Devices International Ltd

MCF54418 NAND Flash Controller

2015 Qualcomm Technologies, Inc. All rights reserved.

TERMINAL Debug Console Instrument

Von der Hardware zur Software in FPGAs mit Embedded Prozessoren. Alexander Hahn Senior Field Application Engineer Lattice Semiconductor

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

MMC314xMR. Ultra Small 3-axis Magnetic Sensor, With I 2 C Interface. Signal Path X. Signal Path Y. Signal Path Z FEATURES

Application Note 120 Communicating Through the 1-Wire Master

Measurement and Analysis Introduction of ISO7816 (Smart Card)

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

EC313 - VHDL State Machine Example

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

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

AVR311: Using the TWI Module as I2C Slave. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

Description. IO and RF AGC. ASIC controller and power management. Carrier recovery loop. GPIO switch matrix. Lock indicator and monitoring DVBS2 FEC

5495A DM Bit Parallel Access Shift Registers

TDA General description. 2. Features and benefits. Multiple smart card slot interface IC

Serial Communications

Programming Interface. for. Bus Master IDE Controller. Revision 1.0

MPR121 Serial Communication

Computer Organization & Architecture Lecture #19

Serial Communications

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

HT1632C 32 8 &24 16 LED Driver

PCA9564 Parallel bus to I 2 C-bus controller INTEGRATED CIRCUITS Sep 01. Product data sheet Supersedes data of 2004 Jun 25

PMC-XM-DIFF & EADIN/MODBUS Virtex Design

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

Manchester Encoder-Decoder for Xilinx CPLDs

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

Sam440ep-flex User Guide

Am186ER/Am188ER AMD Continues 16-bit Innovation

SDLC Controller. Documentation. Design File Formats. Verification

Pericom PCI Express 1.0 & PCI Express 2.0 Advanced Clock Solutions

Thermostat Application Module Kit

Qualcomm IR-I 2 C Bridge Demo

AXI Performance Monitor v5.0

The FT6x06 series ICs include FT6206 /FT6306, the difference of their specifications will be listed individually in this datasheet.

isppac-powr1220at8 I 2 C Hardware Verification Utility User s Guide

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

HP03 BAROMETER MODULE Version: 1.1

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

PART B QUESTIONS AND ANSWERS UNIT I

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

Chapter 5 Real time clock by John Leung

Transcription:

February 2010 Introduction Reference Design RD1067 Since the development of the system bus that allows multiple devices to communicate with one another through a common channel, bus arbitration has been a critical component of system designs Devices capable of controlling the bus are called the masters of the bus Bus arbitration is a way to determine which master is allowed access to a bus and when Its mechanism often grants higher priority to critical devices on the bus, such as a processor, and assigns lower-priority devices a longer waiting time In addition to arbitration, bus switching is necessary when redundancy is required in the system Switching between communication channels can protect a system from disruption This reference design provides a mode of connection and arbitration between multiple bus masters While an I 2 C bus is used in this design, it is a generic implementation and the algorithm could be applied to any communication protocols The I 2 C bus is chosen for its simple two-wire connection that reduces the board design complexity Features Multiple master arbitration, up to eight masters Supports up to eight slave devices 1:N switching between masters and slaves I 2 C compatible master and slave devices Figure 1 is an example application of this reference design Figure 1 Bus Arbitration Application Example Arbitration Control and Switch Master 1 Slave 1 Master Arbitration Slave Switch Master N Slave N The master devices and slave devices can access the design independently Once the master arbitration is done, the slave switch is used to select a slave device as requested by the master device Functional Description By default, this design connects two master devices (master 1 and master 2) and eight slave devices The design consists of a master arbitration block and a slave switch block, as shown in Figure 2 2010 Lattice Semiconductor Corp All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at wwwlatticesemicom/legal All other brand or product names are trademarks or registered trademarks of their respective holders The specifications and information herein are subject to change without notice wwwlatticesemicom 1 rd1067_011

Figure 2 Arbitration Control Block Diagram clk rst scl_master1 sda_master1 scl_master2 sda_master2 arb_switch_topv Master Arbitration Slave Switch i2c_slavev arb_switch_regv ms_judgev I 2 C Slave Interface Arbitrator Register Switch Register Driver scl_slave1 sda_slave1 scl_slave2 sda_slave2 Table 1 Bus Arbitration I/O Interface Descriptions Master Arbitration Signal Name Signal Direction Active State Description System Interface clk Input N/A System clock rst Input High Reset signal I 2 C Master Interface scl_master1 Bi-directional High, Low Master 1 SCL signal sda_master1 Bi-directional High, Low Master 1 SDA signal scl_master2 Bi-directional High, Low Master 2 SCL signal sda_master2 Bi-directional High, Low Master 2 SDA signal I 2 C Slave Interface scl_slave(n) (n=1,2,8) Bi-directional High, Low Slave SCL signal sda_slave(n) (n=1,2,8) Bi-directional High, Low Slave SDA signal Master arbitration determines which master device controls the bus This work is done by the register arbitrator_control which is defined in the module arb_switch_reg The address of this register is 0x00 and the width is 8 bits Bit descriptions are listed in Table 2 Table 2 arbitrator_control Register Bit Descriptions Bit 7 to 0 Reset Value Bit Description Active Access 0 1 1 0 0 - No control from master 1 1 - Master 1 controls the I 2 C bus Default is master 1 0 - No control from master 2 1 - Master 2 controls the I 2 C bus Default is master 1 Note: Other bits of this register are not defined The value for these is 0 When a bit is set to 1 in this register, the corresponding master will control the bus The least 2 bits in this register control the bus arbitration Bit 0 corresponds to master 1, and bit 1 corresponds to master 2 When either bit is set to 1, the corresponding master will control the bus 2

This register can be read by all masters at any time If the value of the register is 0x01, master 1 controls the bus Similarly, a value of 0x02 indicates that master 2 controls the bus The default value 0x00 indicates that the bus is not controlled by any master The register can be written by all masters at any time If master 2 requests ownership of the bus, it should write the value 0x02 to the register to take control of the bus In the same manner, master 1 can write the value 0x01 to the register to take control of the bus Writing any value other than 0x01 for master 1or 0x02 for master 2 will result in a 0x00 value in the register and neither master can control the bus If master 1 and master 2 write to this register at the same time, master 1 has the higher priority Although a master can have ownership of the bus by writing the appropriate value to the arbitrator_control register at any time, this will interrupt the ongoing communication between the current master and its slave device For example, when master 1 has control of the bus and is communicating with a slave device, writing a value of 0x02 to the arbitrator_control register by master 2 will result in an interruption of master 1 s communication with the slave device This allows quick switching from one master to another if there is the potential for failure in the current link If such behavior is not desired, the master should read the arbitrator_control register periodically before writing to the register The writing of the register is carried out only if the value of the register is 0x00 After a master finishes a bus transfer, it should write an invalid value to the arbitrator_control register to make the value of this register become 0x00 How to Read From and Write To a Register The masters access the registers defined in the module arb_switch_reg through the module i2c_slave The module i2c_slave is used to implement an I 2 C slave which can connect to the I 2 C master directly It receives the serial data from the I 2 C master and converts these serial data to parallel to write to the registers Conversely, it also reads the parallel data from registers and converts these parallel data to serial data to send to the I 2 C master The I 2 C slave module is taken from Lattice reference design RD1054, I 2 C Slave/Peripheral It is compatible with the I 2 C bus specification and supports most of the basic functionalities such as 7-bit addressing, random read/write, and sequential read/write As an I 2 C slave, the module i2c_slave has an address This address value is hard-coded as for this design The module i2c_slave implements the data transfer between the I 2 C master and the register The module i2c_slave transmits or receives data to/from the I 2 C master based on the I 2 C bus protocol Figure 3 shows the process of the I 2 C master writing data to the arbitrator_control register Figure 4 shows the I 2 C master reading data from the arbitrator_control register Figure 3 I 2 C Master Writes Data to the arbitrator_control Register write i2c_arbitrator_control address (0x00) register data Figure 4 I 2 C Master Reads Data from the arbitrator_control Register value of i2c_arbitrator_control register read 3

How the Slave Switch Works The slave switch determines which slave device can be directly connected to the selected master This work is done by the register switch_control which is defined in the module arb_switch_reg The address of this register is 0x01 and the width is 8 bits The bits are described in Table 3 Table 3 switch_control Register Bit Descriptions Bit Reset Value Description Active Access 0 0 Enables I 2 C bus access to I 2 C slave 1 1 0 Enable I 2 C bus access to I 2 C slave 2 2 0 Enable I 2 C bus access to I 2 C slave 3 3 0 Enable I 2 C bus access to I 2 C slave 4 4 0 Enable I 2 C bus access to I2C slave 5 5 0 Enable I 2 C bus access to I 2 C slave 6 6 0 Enable I 2 C bus access to I 2 C slave 7 7 0 Enable I2 2 C bus access to I 2 C slave 8 This register provides point-to-point access for the master to the slave When the bit is set to 1 in this register, the corresponding slave can be selected to communicate with the master This register can be read from and written to by all masters at any time Even if the master does not control the bus, it is capable of reading from and writing to the register Only the master that has ownership of the bus can have point-to-point access to a slave to write appropriate values to the register If a master without control of the bus writes an appropriate value to this register, it is possible to interrupt the communication between the current master and its slave Therefore, before the master writes data to this register, it should have ownership of the bus If a master writes multiple 1's into the register, the corresponding salves are selected to communicate with the master The designer can choose this function by application Figure 5 shows the master writing data to the switch_control register Figure 6 shows the master reading data from the switch_control register Figure 5 I 2 C Master Writing Data to the switch_control Register write i2c_switch_control address (0x01) register data 4

Figure 6 I 2 C Master Reading Data from the switch_control Register read value of i2c_arbitrator_control register value of i2c_switch_control register How the Master Accesses the Slave 1 The master reads the arbitrator_control register until the value of the register is 0x00 2 The master writes the appropriate data to the arbitrator_control register to control the bus 3 The master writes the appropriate data to the switch _control register to select the slave 4 The master accesses the slave 5 When the master has accessed the slave, it writes data to the arbitrator_control register to relinquish control of the bus Test Bench Description The test bench for this design shows how the I 2 C master accesses the I 2 C slave After resetting master 1 and master 2, read the registers arbitrator_control and switch _control Figure 7 Master 1 and Master 2 Read the Register The value of the arbitrator_control register is 0x01, indicating that master 1 has ownership of the I 2 C bus Master 1 writes the data 0x01 to the switch _control register to access slave 1 Figure 8 Master 1 Accesses I 2 C Slave 1 5

When master 1 has accessed the I 2 C slave 1, master 2 writes data 0x20 to the arbitrator_control register to control the I 2 C bus It then writes the data 0x02 to the switch _control register to access I 2 C slave 2 Figure Master 2 Accesses I 2 C Slave 2 Implementation This design is implemented in Verilog/VHDL language and the Lattice isplever design tool is used for implementation Table 4 Performance and Resource Utilization Architectual Device Family Language Speed Grade I/O f MAX (MHz) Utilization Resources MachXO 1 Verilog -5 22 >50 245 LUTs N/A VHDL -5 22 >50 247 LUTs N/A ispmach Verilog -5 (ns) 22 >50 206 Macrocells N/A 4000ZE 2 VHDL -5 (ns) 22 >50 20 Macrocells N/A LatticeXP2 3 Verilog -5 22 >50 314 LUTs N/A VHDL -5 22 >50 334 LUTs N/A 1 Performance and utilization characteristics are generated using LCMXO2280C-5T100C with Lattice isplever 80 software When using this design in a different device, density, speed, or grade, performance and utilization may vary 2 Performance and utilization characteristics are generated using LC4256ZE-5TN100C with Lattice isplever Classic 13 software When using this design in a different device, density, speed, or grade, performance and utilization may vary 3 Performance and utilization characteristics are generated using LFXP2-5E-5M132C with Lattice isplever 80 software When using this design in a different device, density, speed, or grade, performance and utilization may vary Technical Support Assistance Hotline: 1-800-LATTICE (North America) +1-503-268-8001 (Outside North America) e-mail: techsupport@latticesemicom Internet: wwwlatticesemicom Revision History Date Version Change Summary January 2010 010 Initial release February 2010 011 Added support for LatticeXP2 device family Added VHDL support for all device families 6