SlideShare a Scribd company logo
By/ Mostafa Khamis
Mostafaa.soc@riotmicro.com
I2C-Bus Design Specs
 Introduction
 Data Format Validation
 General Call Address Programming
 Arbitration
 Synchronization
 Clock Stretching
 Ultra Fast-mode Protocol
 Features Applicability
 I2C-Bus Registers
 Verification Specs.
Outline
Mostafa KhamisI2C-Bus Design and Verification Specs
Introduction
 Philips Semiconductors (now NXP Semiconductors) developed a simple bidirectional 2-wire bus for efficient inter-IC control. This bus is
called the Inter-IC or I2C-bus which is a 8-bit oriented serial bus. Only two bus lines are required:
 a serial data line (SDA)
 a serial clock line (SCL).


 Data transfers operation modes:
1) Standard-mode >> up to 100 kbit/s
2) Fast-mode >> up to 400 kbit/s
3) Fast-mode plus (Fm+) >> up to 1 Mbit/s
4) High-speed mode >> up to 3.4 Mbit/s
5) Ultra Fast-mode (uni-directional mode) >> up to 5 Mbit/s
6)
7)
 All I2C-bus compatible devices incorporate an on-chip interface which allows them to communicate directly with each other via the I2C-bus.
This design concept solves the many interfacing problems encountered when designing digital control circuits.
Introduction
Mostafa KhamisI2C-Bus Design and Verification Specs
Some intelligent control, usually a single-chip micro—controller

 General-purpose circuits like LCD and LED drivers, remote I/O ports, RAM, EEPROM, real-time clocks or A/D and D/A
converters

 Application-oriented circuits such as digital tuning and signal processing circuits for radio and video systems, temperature
sensors, and smart cards
I2C-bus Applications:
Mostafa KhamisI2C-Bus Design and Verification Specs
Only two bus lines are required; a serial data line (SDA) and a serial clock line (SCL).

 Each device connected to the bus is software addressable by a unique address and simple master/slave relationships exist at
all times; masters can operate as master-transmitters or as master-receivers.

 It is a true multi-master bus including collision detection and arbitration to prevent data corruption if two or more masters
simultaneously initiate data transfer.

 Serial, 8-bit oriented, bidirectional data transfers can be made at up to 100 kbit/s in the Standard-mode, up to 400 kbit/s in
the Fast-mode, up to 1 Mbit/s in Fast-mode Plus, or up to 3.4 Mbit/s in the High-speed mode. The freq could be easily
programmed by software.

 Serial, 8-bit oriented, unidirectional data transfers up to 5 Mbit/s in Ultra Fast-mode

 The number of ICs that can be connected to the same bus is limited only by a maximum bus capacitance. More capacitance
may be allowed under some conditions.
I2C Features
Mostafa KhamisI2C-Bus Design and Verification Specs
Compatible with multiple masters.

 Includes clock stretching, so it could support a wait state generation.

 The acknowledge bit is software programmable.

 The core has interrupt driven byte-by-byte data transfers.

 The core supports different modes of operating conditions like- start, stop, repeated start and detects these conditions.

 Support to detect if the bus is busy processing other requests.

 Provides support for both 7-bit and 10-bit addressing modes.
I2C Features
Mostafa KhamisI2C-Bus Design and Verification Specs
Terminology
 The I2C-bus is a multi-master bus. This means that more than one device capable of controlling the bus can be connected
to it. As masters are usually microcontrollers, let us consider the case of a data transfer between two microcontrollers
connected to the I2 C-bus
Mostafa KhamisI2C-Bus Design and Verification Specs
Terminology
A is a master, addresses B(Slave)
 For transmission and receiving
 A terminates the transfer
 A generates the clk signals
Mostafa KhamisI2C-Bus Design and Verification Specs
Data Format Validation
Data Validity
Mostafa KhamisI2C-Bus Design and Verification Specs
Start and Stop Conditions
From high to low
while SCL is high
From low to high
while SCL is high
 Generated by the master
 The bus is considered to be busy after start (S) condition and free after stop (P)
 The same for repeated start (Sr)
Mostafa KhamisI2C-Bus Design and Verification Specs
Byte Format
Mostafa KhamisI2C-Bus Design and Verification Specs
ACK and NACK
The Acknowledge signal is defined as follows: the transmitter releases the SDA line during the acknowledge clock
pulse so the receiver can pull the SDA line LOW and it remains stable LOW during the HIGH period of this clock
pulse. Set-up and hold times must also be taken into account.

 When SDA remains HIGH during this ninth clock pulse, this is defined as the Not Acknowledge signal. The master
can then generate either a STOP condition to abort the transfer, or a repeated START condition to start a new
transfer.



 NACK Conditions:
 No receiver is present on the bus with the transmitted address so there is no device to respond with an
acknowledge.
 The slave is unable to receive or transmit because it is performing some real-time function and is not ready to
start communication with the master.
 During the transfer, the receiver gets data or commands that it does not understand.
 During the transfer, the receiver cannot receive any more data bytes.
 A master-receiver must signal the end of the transfer to the slave transmitter.
Mostafa KhamisI2C-Bus Design and Verification Specs
Slave Address and R/W bit
Mostafa KhamisI2C-Bus Design and Verification Specs
Slave Address and R/W bit
A master-transmitter addressing
a slave receiver with a 7-bit address

A master reads a slave immediately after the first byte

 Combined format
Mostafa KhamisI2C-Bus Design and Verification Specs
10-bit Addressing
10-bit addressing expands the number of possible addresses

 The first seven bits of the first byte are the combination 1111 0XX of which the last two bits (XX) are the two Most-
Significant Bits (MSB) of the 10-bit address; the eighth bit of the first byte is the R/W bit that determines the
direction of the message.

 The remaining first 5 bits are reserved for future I2C bus enhancements.

 A master-transmitter addresses a slave-receiver with a 10-bit address




 A master-receiver addresses a slave-transmitter with a 10-bit address
Mostafa KhamisI2C-Bus Design and Verification Specs
General Call Address Programming
General Call Address
 This format is done to write or program all slaves that are connected on the I2C bus.
 The master is waiting for acknowledgement at least from one slave.

 The general call address format




 When B = ‘0’: The second byte has the following meanings:
 0000 0110 (06h): Reset and write programmable part of slave address by hardware.
 0000 0100 (04h): Write programmable part of slave address by hardware.
 0000 0000 (00h): This code is not allowed to be used as the second byte.

 When B = ‘1’: The second byte is a hardware general call, this means that the transmitted sequence is sent by a
hardware master device, such as keyboard scanner (which can be programmed to transmit a desired slave
address).
 Note: the remaining 7-bits are for the hardware master
 address to acknowledge all connected slaves.
Mostafa KhamisI2C-Bus Design and Verification Specs
Bus Clear
If the data line (SDA) is stuck LOW, the master should send nine clock pulses.
The device that held the bus LOW should release it sometime within those nine clocks.
If not, then use the HW reset or cycle power to clear the bus.
Mostafa KhamisI2C-Bus Design and Verification Specs
Device ID
An optional 3-byte read-only (24 bits) word giving the following information:
 Could be accessed as follows:
1) START condition
2) The master sends the Reserved Device ID I2C-bus address followed by the R/W bit set to ‘0’ (write): ‘1111 1000’.
3) The master sends the I2C-bus slave address of the slave device it must identify.
4) The master sends a Re-START condition.
5) The master sends the Reserved Device ID I2C-bus address followed by the R/W bit set to ‘1’ (read): ‘1111 1001’.
6) The Device ID Read can be done, starting with the 12 manufacturer bits followed by the nine part identification bits, and then the
three die revision bits.
7) The master ends the reading sequence by NACKing the last byte, thus resetting the slave device state machine and allowing the
master to send the STOP condition.
8)
1) Note: If the master continues to ACK the bytes after the third byte, the slave rolls back to the first byte and keeps sending the
Device ID sequence until a NACK has been detected.
Mostafa KhamisI2C-Bus Design and Verification Specs
Twelve bits with the manufacturer name, unique per manufacturer
Nine bits with the part identification, assigned by manufacturer
Three bits with the die revision, assigned by manufacturer
Device ID
Assigned Manufacturer IDs:
Mostafa KhamisI2C-Bus Design and Verification Specs
Arbitration
If two or more masters try to put information onto the bus, the first to produce a ‘one’ when the other produces a ‘zero’ loses
the arbitration. The clock signals during arbitration are a synchronized combination of the clocks generated by the masters using
the wired-AND connection to the SCL line.

 Slaves are not included in the arbitration procedure.

 Arbitration proceeds bit by bit. During every bit, while SCL is HIGH, each master checks to see if the SDA level matches what
it has sent.

 Two masters can actually complete an entire transaction without error, as long as the transmissions are identical.

 A master that loses the arbitration can generate clock pulses until the end of the byte in which it loses the arbitration and
must restart its transaction when the bus is free.
Arbitration Logic
Mostafa KhamisI2C-Bus Design and Verification Specs

 Undefined conditions, if the arbitration procedure is still in progress at the moment when one master sends a repeated
START or a STOP condition:
 Master 1 sends a repeated START condition and master 2 sends a data bit.
 Master 1 sends a STOP condition and master 2 sends a data bit.
 Master 1 sends a repeated START condition and master 2 sends a STOP condition.
Arbitration Procedure
Mostafa KhamisI2C-Bus Design and Verification Specs
Synchronization
Generation of clock signals on the I2C-bus is always the responsibility of master devices; each master generates its own clock
signals when transferring data on the bus. Bus clock signals from a master can only be altered when they are stretched by a slow
slave device holding down the clock line or by another master when arbitration occurs.

 Two masters can begin transmitting on a free bus at the same time and there must be a method for deciding which takes
control of the bus and complete its transmission. This is done by clock synchronization and arbitration using the wired-AND.
In single master systems, clock synchronization and arbitration are not needed.
Synchronization Logic
A synchronized SCL clock is generated with its
LOW period determined by the master with the
longest clock LOW period, and its HIGH period
determined by the one with the shortest clock
HIGH period.
Mostafa KhamisI2C-Bus Design and Verification Specs
Clock Stretching
Instead of the master and slave agreeing to a predefined baud rate, the master controls the clock speed.

 Optional procedure, for pausing the transaction by holding the SCL to low.

 The transaction cannot continue until the line is released HIGH again

 Slaves are not applicable to stretch the clock because they don’t have SCL driver.

 For byte date level, when being sent in a fast rate, the device needs more time to store the byte before start another one.
So, a clock stretching here is needed after reception and acknowledgement of a byte by forcing the master into a wait state.

 Also, it can be used to slow down the bus clk when communicating with other controller with/without limited hardware.
Clock Stretching
Mostafa KhamisI2C-Bus Design and Verification Specs
Ultra Fast-mode Protocol
Operates from DC to 5 MHz transmitting data in one direction.

 It is most useful for speeds greater than 1 MHz to drive LED controllers and other devices that do not need feedback.

 Is based on the standard protocol which consists of START, slave address, command bit, ninth clock, and a STOP bit. But the
command bit is a ‘write’ only, and the data bit on the ninth clock is driven HIGH, ignoring the ACK cycle due to the
unidirectional nature of the bus.

 The 2-wire push-pull driver consists of a UFm serial clock (USCL) and serial data (USDA).

 Since UFm I2C-bus uses push-pull drivers, it does not have the multi-master capability of the wired-AND open-drain Sm, Fm,
and Fm+ I2C-buses.

 The possibility of connecting more than one UFm master to the UFm I2C-bus is not allowed due to bus contention on the
push-pull outputs. (One Hot MUX)
Ultra Fast-mode (Ufm) protocol
Mostafa KhamisI2C-Bus Design and Verification Specs
Features Applicability
Applicability of I2C-bus protocol features
Mostafa KhamisI2C-Bus Design and Verification Specs
Applicability of UFm I2C-bus
Mostafa KhamisI2C-Bus Design and Verification Specs
I2C-Bus Registers
I2C-Bus Registers
Mostafa KhamisI2C-Bus Design and Verification Specs
 Prescaler 16-bits registers:
 The prescaler factor can be determined through the following equation: prescaler = (peripheral_clock / (5 * desired_SCL)) -1.
 Control Register:
Transmit Register:

 Receive Register
I2C-Bus Registers
Mostafa KhamisI2C-Bus Design and Verification Specs
Command Register:

 To generate and tells the Core what commands to do next. All the bits of this register are automatically cleared
and are usually read as Zeros.
I2C-Bus Registers
Mostafa KhamisI2C-Bus Design and Verification Specs
Status Register:

 Gives information about the status of the core and if any data transfer is in progress.
I2C-Bus Registers
Mostafa KhamisI2C-Bus Design and Verification Specs
Verification Specs.
I2C-Bus UVM Environment
Mostafa KhamisI2C-Bus Design and Verification Specs
 I2C Interface:
 It consists of Clock, Reset, SCL, and SDA signals for communication with the bus functional model and DUT.

 I2C BFM:
 It is used as drivers to drive the I2C interface signals through untimed separated tasks.
 UVM driver controls the BFM anyway and calls the tasks in BFM.
 UVM monitor also can call the BFM tasks to read from the DUT.

 I2C BFM Tasks:
 Reset Task
 Write Task
 It takes in the arguments delay, the master interface handle, the address and the data that needs to be
written
 Read Task
 It is similar to the write task in terms of the parameter it takes in but instead of writing data, the task read
data from the given address
I2C-Bus UVM Environment
Mostafa KhamisI2C-Bus Design and Verification Specs
Mostafa KhamisI2C-Bus Design and Verification Specs
I2C-Bus Design and Verification Specs

More Related Content

What's hot

I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
Abhijeet kapse
 
I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)Varun Mahajan
 
SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)
SUNODH GARLAPATI
 
The I2C Interface
The I2C InterfaceThe I2C Interface
The I2C Interface
Corrado Santoro
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
Anurag Tomar
 
I2 c bus
I2 c busI2 c bus
Apb
ApbApb
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
Sudhanshu Janwadkar
 
AHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptxAHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptx
GuckChick
 
UVM Driver sequencer handshaking
UVM Driver sequencer handshakingUVM Driver sequencer handshaking
UVM Driver sequencer handshaking
HARINATH REDDY
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
Aditya Porwal
 
I2C
I2CI2C
Advance Peripheral Bus
Advance Peripheral Bus Advance Peripheral Bus
Advance Peripheral Bus
SIVA NAGENDRA REDDY
 
Amba presentation2
Amba presentation2Amba presentation2
Amba presentation2
Rashi Aggarwal
 
Ral by pushpa
Ral by pushpa Ral by pushpa
Ral by pushpa
Pushpa Yakkala
 
Session 8,9 PCI Express
Session 8,9 PCI ExpressSession 8,9 PCI Express
Session 8,9 PCI ExpressSubhash Iyer
 
Axi
AxiAxi
axi protocol
axi protocolaxi protocol
axi protocol
Azad Mishra
 

What's hot (20)

I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)I2C Bus (Inter-Integrated Circuit)
I2C Bus (Inter-Integrated Circuit)
 
SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)
 
The I2C Interface
The I2C InterfaceThe I2C Interface
The I2C Interface
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
I2 c bus
I2 c busI2 c bus
I2 c bus
 
Apb
ApbApb
Apb
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
AHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptxAHB To APB BRIDGE.pptx
AHB To APB BRIDGE.pptx
 
AMBA_APB_pst
AMBA_APB_pstAMBA_APB_pst
AMBA_APB_pst
 
UVM Driver sequencer handshaking
UVM Driver sequencer handshakingUVM Driver sequencer handshaking
UVM Driver sequencer handshaking
 
Serial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System ProtocolSerial peripheral Interface - Embedded System Protocol
Serial peripheral Interface - Embedded System Protocol
 
I2C
I2CI2C
I2C
 
Advance Peripheral Bus
Advance Peripheral Bus Advance Peripheral Bus
Advance Peripheral Bus
 
Amba presentation2
Amba presentation2Amba presentation2
Amba presentation2
 
Ral by pushpa
Ral by pushpa Ral by pushpa
Ral by pushpa
 
Session 8,9 PCI Express
Session 8,9 PCI ExpressSession 8,9 PCI Express
Session 8,9 PCI Express
 
Axi
AxiAxi
Axi
 
UART
UARTUART
UART
 
axi protocol
axi protocolaxi protocol
axi protocol
 

Similar to I2C-Bus Design and Verification Specs

I2C PRESENTATION.PPT
I2C PRESENTATION.PPTI2C PRESENTATION.PPT
I2C PRESENTATION.PPT
venkatesh405785
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systems
Raghunath reddy
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
RAMPRAKASHT1
 
Inter intergrated circuits-communication protocol
Inter intergrated circuits-communication protocolInter intergrated circuits-communication protocol
Inter intergrated circuits-communication protocol
Revathi Subramaniam
 
COM_BASIC.pptx
COM_BASIC.pptxCOM_BASIC.pptx
COM_BASIC.pptx
BhagvatShukla
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
Techvilla
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
Ankur Soni
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsRaspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Mohamed Abdallah
 
Implementation of I2C Master Bus Protocol on FPGA
Implementation of I2C Master Bus Protocol on FPGAImplementation of I2C Master Bus Protocol on FPGA
Implementation of I2C Master Bus Protocol on FPGA
IJERA Editor
 
Isa bus nptel
Isa bus nptelIsa bus nptel
Isa bus nptel
M.V Mahesh Vanamuthu
 
I2c buses
I2c busesI2c buses
I2c buses
Naveen Dubey
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems
VijayKumar5738
 
Assembler4
Assembler4Assembler4
Assembler4
Omar Sanchez
 
7.MODBus and CANBus.pptx
7.MODBus and CANBus.pptx7.MODBus and CANBus.pptx
7.MODBus and CANBus.pptx
usamamaqsod1
 
An Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDLAn Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDL
IJMER
 
I2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingI2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacing
Bhargav Kakadiya
 
Serial Busses.pptx
Serial Busses.pptxSerial Busses.pptx
Serial Busses.pptx
ssuser1542b11
 
Io Architecture
Io ArchitectureIo Architecture
Io ArchitectureAero Plane
 
Final Report - morse code.pdf
Final Report - morse code.pdfFinal Report - morse code.pdf
Final Report - morse code.pdf
HanaBaSabaa
 
IEEE Paper A SystemC AMS Model of an I2C Bus Controller
IEEE Paper A SystemC AMS Model  of an I2C Bus ControllerIEEE Paper A SystemC AMS Model  of an I2C Bus Controller
IEEE Paper A SystemC AMS Model of an I2C Bus Controller
Dweapons Art
 

Similar to I2C-Bus Design and Verification Specs (20)

I2C PRESENTATION.PPT
I2C PRESENTATION.PPTI2C PRESENTATION.PPT
I2C PRESENTATION.PPT
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systems
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
Inter intergrated circuits-communication protocol
Inter intergrated circuits-communication protocolInter intergrated circuits-communication protocol
Inter intergrated circuits-communication protocol
 
COM_BASIC.pptx
COM_BASIC.pptxCOM_BASIC.pptx
COM_BASIC.pptx
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
 
Raspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication ProtocolsRaspberry Pi - Lecture 3 Embedded Communication Protocols
Raspberry Pi - Lecture 3 Embedded Communication Protocols
 
Implementation of I2C Master Bus Protocol on FPGA
Implementation of I2C Master Bus Protocol on FPGAImplementation of I2C Master Bus Protocol on FPGA
Implementation of I2C Master Bus Protocol on FPGA
 
Isa bus nptel
Isa bus nptelIsa bus nptel
Isa bus nptel
 
I2c buses
I2c busesI2c buses
I2c buses
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems
 
Assembler4
Assembler4Assembler4
Assembler4
 
7.MODBus and CANBus.pptx
7.MODBus and CANBus.pptx7.MODBus and CANBus.pptx
7.MODBus and CANBus.pptx
 
An Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDLAn Implementation of I2C Slave Interface using Verilog HDL
An Implementation of I2C Slave Interface using Verilog HDL
 
I2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacingI2C protocol and DS1307 RTC interfacing
I2C protocol and DS1307 RTC interfacing
 
Serial Busses.pptx
Serial Busses.pptxSerial Busses.pptx
Serial Busses.pptx
 
Io Architecture
Io ArchitectureIo Architecture
Io Architecture
 
Final Report - morse code.pdf
Final Report - morse code.pdfFinal Report - morse code.pdf
Final Report - morse code.pdf
 
IEEE Paper A SystemC AMS Model of an I2C Bus Controller
IEEE Paper A SystemC AMS Model  of an I2C Bus ControllerIEEE Paper A SystemC AMS Model  of an I2C Bus Controller
IEEE Paper A SystemC AMS Model of an I2C Bus Controller
 

Recently uploaded

English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 

Recently uploaded (20)

English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 

I2C-Bus Design and Verification Specs

  • 2.  Introduction  Data Format Validation  General Call Address Programming  Arbitration  Synchronization  Clock Stretching  Ultra Fast-mode Protocol  Features Applicability  I2C-Bus Registers  Verification Specs. Outline Mostafa KhamisI2C-Bus Design and Verification Specs
  • 4.  Philips Semiconductors (now NXP Semiconductors) developed a simple bidirectional 2-wire bus for efficient inter-IC control. This bus is called the Inter-IC or I2C-bus which is a 8-bit oriented serial bus. Only two bus lines are required:  a serial data line (SDA)  a serial clock line (SCL).    Data transfers operation modes: 1) Standard-mode >> up to 100 kbit/s 2) Fast-mode >> up to 400 kbit/s 3) Fast-mode plus (Fm+) >> up to 1 Mbit/s 4) High-speed mode >> up to 3.4 Mbit/s 5) Ultra Fast-mode (uni-directional mode) >> up to 5 Mbit/s 6) 7)  All I2C-bus compatible devices incorporate an on-chip interface which allows them to communicate directly with each other via the I2C-bus. This design concept solves the many interfacing problems encountered when designing digital control circuits. Introduction Mostafa KhamisI2C-Bus Design and Verification Specs
  • 5. Some intelligent control, usually a single-chip micro—controller   General-purpose circuits like LCD and LED drivers, remote I/O ports, RAM, EEPROM, real-time clocks or A/D and D/A converters   Application-oriented circuits such as digital tuning and signal processing circuits for radio and video systems, temperature sensors, and smart cards I2C-bus Applications: Mostafa KhamisI2C-Bus Design and Verification Specs
  • 6. Only two bus lines are required; a serial data line (SDA) and a serial clock line (SCL).   Each device connected to the bus is software addressable by a unique address and simple master/slave relationships exist at all times; masters can operate as master-transmitters or as master-receivers.   It is a true multi-master bus including collision detection and arbitration to prevent data corruption if two or more masters simultaneously initiate data transfer.   Serial, 8-bit oriented, bidirectional data transfers can be made at up to 100 kbit/s in the Standard-mode, up to 400 kbit/s in the Fast-mode, up to 1 Mbit/s in Fast-mode Plus, or up to 3.4 Mbit/s in the High-speed mode. The freq could be easily programmed by software.   Serial, 8-bit oriented, unidirectional data transfers up to 5 Mbit/s in Ultra Fast-mode   The number of ICs that can be connected to the same bus is limited only by a maximum bus capacitance. More capacitance may be allowed under some conditions. I2C Features Mostafa KhamisI2C-Bus Design and Verification Specs
  • 7. Compatible with multiple masters.   Includes clock stretching, so it could support a wait state generation.   The acknowledge bit is software programmable.   The core has interrupt driven byte-by-byte data transfers.   The core supports different modes of operating conditions like- start, stop, repeated start and detects these conditions.   Support to detect if the bus is busy processing other requests.   Provides support for both 7-bit and 10-bit addressing modes. I2C Features Mostafa KhamisI2C-Bus Design and Verification Specs
  • 8. Terminology  The I2C-bus is a multi-master bus. This means that more than one device capable of controlling the bus can be connected to it. As masters are usually microcontrollers, let us consider the case of a data transfer between two microcontrollers connected to the I2 C-bus Mostafa KhamisI2C-Bus Design and Verification Specs
  • 9. Terminology A is a master, addresses B(Slave)  For transmission and receiving  A terminates the transfer  A generates the clk signals Mostafa KhamisI2C-Bus Design and Verification Specs
  • 11. Data Validity Mostafa KhamisI2C-Bus Design and Verification Specs
  • 12. Start and Stop Conditions From high to low while SCL is high From low to high while SCL is high  Generated by the master  The bus is considered to be busy after start (S) condition and free after stop (P)  The same for repeated start (Sr) Mostafa KhamisI2C-Bus Design and Verification Specs
  • 13. Byte Format Mostafa KhamisI2C-Bus Design and Verification Specs
  • 14. ACK and NACK The Acknowledge signal is defined as follows: the transmitter releases the SDA line during the acknowledge clock pulse so the receiver can pull the SDA line LOW and it remains stable LOW during the HIGH period of this clock pulse. Set-up and hold times must also be taken into account.   When SDA remains HIGH during this ninth clock pulse, this is defined as the Not Acknowledge signal. The master can then generate either a STOP condition to abort the transfer, or a repeated START condition to start a new transfer.     NACK Conditions:  No receiver is present on the bus with the transmitted address so there is no device to respond with an acknowledge.  The slave is unable to receive or transmit because it is performing some real-time function and is not ready to start communication with the master.  During the transfer, the receiver gets data or commands that it does not understand.  During the transfer, the receiver cannot receive any more data bytes.  A master-receiver must signal the end of the transfer to the slave transmitter. Mostafa KhamisI2C-Bus Design and Verification Specs
  • 15. Slave Address and R/W bit Mostafa KhamisI2C-Bus Design and Verification Specs
  • 16. Slave Address and R/W bit A master-transmitter addressing a slave receiver with a 7-bit address  A master reads a slave immediately after the first byte   Combined format Mostafa KhamisI2C-Bus Design and Verification Specs
  • 17. 10-bit Addressing 10-bit addressing expands the number of possible addresses   The first seven bits of the first byte are the combination 1111 0XX of which the last two bits (XX) are the two Most- Significant Bits (MSB) of the 10-bit address; the eighth bit of the first byte is the R/W bit that determines the direction of the message.   The remaining first 5 bits are reserved for future I2C bus enhancements.   A master-transmitter addresses a slave-receiver with a 10-bit address      A master-receiver addresses a slave-transmitter with a 10-bit address Mostafa KhamisI2C-Bus Design and Verification Specs
  • 18. General Call Address Programming
  • 19. General Call Address  This format is done to write or program all slaves that are connected on the I2C bus.  The master is waiting for acknowledgement at least from one slave.   The general call address format      When B = ‘0’: The second byte has the following meanings:  0000 0110 (06h): Reset and write programmable part of slave address by hardware.  0000 0100 (04h): Write programmable part of slave address by hardware.  0000 0000 (00h): This code is not allowed to be used as the second byte.   When B = ‘1’: The second byte is a hardware general call, this means that the transmitted sequence is sent by a hardware master device, such as keyboard scanner (which can be programmed to transmit a desired slave address).  Note: the remaining 7-bits are for the hardware master  address to acknowledge all connected slaves. Mostafa KhamisI2C-Bus Design and Verification Specs
  • 20. Bus Clear If the data line (SDA) is stuck LOW, the master should send nine clock pulses. The device that held the bus LOW should release it sometime within those nine clocks. If not, then use the HW reset or cycle power to clear the bus. Mostafa KhamisI2C-Bus Design and Verification Specs
  • 21. Device ID An optional 3-byte read-only (24 bits) word giving the following information:  Could be accessed as follows: 1) START condition 2) The master sends the Reserved Device ID I2C-bus address followed by the R/W bit set to ‘0’ (write): ‘1111 1000’. 3) The master sends the I2C-bus slave address of the slave device it must identify. 4) The master sends a Re-START condition. 5) The master sends the Reserved Device ID I2C-bus address followed by the R/W bit set to ‘1’ (read): ‘1111 1001’. 6) The Device ID Read can be done, starting with the 12 manufacturer bits followed by the nine part identification bits, and then the three die revision bits. 7) The master ends the reading sequence by NACKing the last byte, thus resetting the slave device state machine and allowing the master to send the STOP condition. 8) 1) Note: If the master continues to ACK the bytes after the third byte, the slave rolls back to the first byte and keeps sending the Device ID sequence until a NACK has been detected. Mostafa KhamisI2C-Bus Design and Verification Specs Twelve bits with the manufacturer name, unique per manufacturer Nine bits with the part identification, assigned by manufacturer Three bits with the die revision, assigned by manufacturer
  • 22. Device ID Assigned Manufacturer IDs: Mostafa KhamisI2C-Bus Design and Verification Specs
  • 24. If two or more masters try to put information onto the bus, the first to produce a ‘one’ when the other produces a ‘zero’ loses the arbitration. The clock signals during arbitration are a synchronized combination of the clocks generated by the masters using the wired-AND connection to the SCL line.   Slaves are not included in the arbitration procedure.   Arbitration proceeds bit by bit. During every bit, while SCL is HIGH, each master checks to see if the SDA level matches what it has sent.   Two masters can actually complete an entire transaction without error, as long as the transmissions are identical.   A master that loses the arbitration can generate clock pulses until the end of the byte in which it loses the arbitration and must restart its transaction when the bus is free. Arbitration Logic Mostafa KhamisI2C-Bus Design and Verification Specs
  • 25.   Undefined conditions, if the arbitration procedure is still in progress at the moment when one master sends a repeated START or a STOP condition:  Master 1 sends a repeated START condition and master 2 sends a data bit.  Master 1 sends a STOP condition and master 2 sends a data bit.  Master 1 sends a repeated START condition and master 2 sends a STOP condition. Arbitration Procedure Mostafa KhamisI2C-Bus Design and Verification Specs
  • 27. Generation of clock signals on the I2C-bus is always the responsibility of master devices; each master generates its own clock signals when transferring data on the bus. Bus clock signals from a master can only be altered when they are stretched by a slow slave device holding down the clock line or by another master when arbitration occurs.   Two masters can begin transmitting on a free bus at the same time and there must be a method for deciding which takes control of the bus and complete its transmission. This is done by clock synchronization and arbitration using the wired-AND. In single master systems, clock synchronization and arbitration are not needed. Synchronization Logic A synchronized SCL clock is generated with its LOW period determined by the master with the longest clock LOW period, and its HIGH period determined by the one with the shortest clock HIGH period. Mostafa KhamisI2C-Bus Design and Verification Specs
  • 29. Instead of the master and slave agreeing to a predefined baud rate, the master controls the clock speed.   Optional procedure, for pausing the transaction by holding the SCL to low.   The transaction cannot continue until the line is released HIGH again   Slaves are not applicable to stretch the clock because they don’t have SCL driver.   For byte date level, when being sent in a fast rate, the device needs more time to store the byte before start another one. So, a clock stretching here is needed after reception and acknowledgement of a byte by forcing the master into a wait state.   Also, it can be used to slow down the bus clk when communicating with other controller with/without limited hardware. Clock Stretching Mostafa KhamisI2C-Bus Design and Verification Specs
  • 31. Operates from DC to 5 MHz transmitting data in one direction.   It is most useful for speeds greater than 1 MHz to drive LED controllers and other devices that do not need feedback.   Is based on the standard protocol which consists of START, slave address, command bit, ninth clock, and a STOP bit. But the command bit is a ‘write’ only, and the data bit on the ninth clock is driven HIGH, ignoring the ACK cycle due to the unidirectional nature of the bus.   The 2-wire push-pull driver consists of a UFm serial clock (USCL) and serial data (USDA).   Since UFm I2C-bus uses push-pull drivers, it does not have the multi-master capability of the wired-AND open-drain Sm, Fm, and Fm+ I2C-buses.   The possibility of connecting more than one UFm master to the UFm I2C-bus is not allowed due to bus contention on the push-pull outputs. (One Hot MUX) Ultra Fast-mode (Ufm) protocol Mostafa KhamisI2C-Bus Design and Verification Specs
  • 33. Applicability of I2C-bus protocol features Mostafa KhamisI2C-Bus Design and Verification Specs
  • 34. Applicability of UFm I2C-bus Mostafa KhamisI2C-Bus Design and Verification Specs
  • 36. I2C-Bus Registers Mostafa KhamisI2C-Bus Design and Verification Specs
  • 37.  Prescaler 16-bits registers:  The prescaler factor can be determined through the following equation: prescaler = (peripheral_clock / (5 * desired_SCL)) -1.  Control Register: Transmit Register:   Receive Register I2C-Bus Registers Mostafa KhamisI2C-Bus Design and Verification Specs
  • 38. Command Register:   To generate and tells the Core what commands to do next. All the bits of this register are automatically cleared and are usually read as Zeros. I2C-Bus Registers Mostafa KhamisI2C-Bus Design and Verification Specs
  • 39. Status Register:   Gives information about the status of the core and if any data transfer is in progress. I2C-Bus Registers Mostafa KhamisI2C-Bus Design and Verification Specs
  • 41. I2C-Bus UVM Environment Mostafa KhamisI2C-Bus Design and Verification Specs
  • 42.  I2C Interface:  It consists of Clock, Reset, SCL, and SDA signals for communication with the bus functional model and DUT.   I2C BFM:  It is used as drivers to drive the I2C interface signals through untimed separated tasks.  UVM driver controls the BFM anyway and calls the tasks in BFM.  UVM monitor also can call the BFM tasks to read from the DUT.   I2C BFM Tasks:  Reset Task  Write Task  It takes in the arguments delay, the master interface handle, the address and the data that needs to be written  Read Task  It is similar to the write task in terms of the parameter it takes in but instead of writing data, the task read data from the given address I2C-Bus UVM Environment Mostafa KhamisI2C-Bus Design and Verification Specs
  • 43. Mostafa KhamisI2C-Bus Design and Verification Specs