SV Uvm 7
SV Uvm 7
1/20/24
Block Diagram
MASTER SLAVE
SCL (Serial Clock)
1|Page
YASWANTH B
1/20/24
I2C Protocol
I2C START and STOP I2C communication is initiated from the controller device with an I2C START
condition. If the bus is open, an I2C controller claims the bus for communication by sending an I2C
START. To do this, the controller device first pulls the SDA low and then pulls the SCL low. This
sequence indicates that the controller device is claiming the I2C bus for communication, forcing other
controller devices on the bus to hold their communication. When the controller device has completed
communication, the SCL releases high and then the SDA releases high. This indicates an I2C STOP
condition. This releases the bus to allow other controllers to communicate or to allow for the same
controller to communicate with another device.
At the beginning of the address frame, the controller device initiates a START condition. The controller
device first pulls SDA low and then pulls SCL low for the START. This allows the controller device to
claim the bus without contention from other controller devices on the bus. Each I2C target device has
an associated I2C address. When beginning communications with a particular target device the
controller uses the target device address to send or receive data in the following I2C frames. The I2C
address consists of 7 bits and devices on the I2C bus, each having a unique address on the bus. A 7-bit
address implies 27 (or 128) unique addresses. However, there are several reserved I2C addresses which
limits the number of possible devices. Reserved addresses. The address is sent with the SDA as the data
and the SCL as the serial clock. With this information, you can read through the I2C communication of
2|Page
YASWANTH B
1/20/24
a device and understand what is being sent back and forth between the controller device and the target
device. The 8th bit of this frame following the address, is the read-write (R/W) bit. If this bit is 1, the
controller is asking to read data from the target device. If this bit is 0, the controller asks to write data
to the target device. After any communication byte, an extra 9th bit is used to verify the communication
was successful. At the end of the address byte communication, the target device pulls down the SDA
during the SCL pulse to indicate to the controller that the address was received. This is known as an
acknowledge (ACK) bit. If this bit is high, then no target device received the address and the
communication was unsuccessful. If the bit is high, this is known as a NACK and there was no ACK.
The address frame is followed by one or more data frames. These frames are sent one byte at a time.
After each data byte is transferred, there is another ACK. If the data byte is a write to the device, then
the target device pulls the SDA low to ACK the transfer. If the data byte is a read from the device, the
controller pulls the SDA low to acknowledge the data has been received. The ACK is a useful debugging
tool. The absence of this bit can indicate that the target peripheral did not receive the proper I2C address
for communication, or that the controller peripheral did not receive the expected data. After the
communication is completed, the controller issues an I2C STOP condition. SCL is first released and
then SDA is released. The controller uses the STOP to indicate that the communication is completed
and the I2C bus is released. This is the basic protocol for any I2C communication between the controller
device and the target device. Communication can consist of more than one byte of data. In some cases
where a target device has multiple data and configuration registers, a read from a device can begin with
a write to the device to indicate which register is to be read. The following sections show examples of
how to read from and write to different data converter devices.
3|Page
YASWANTH B
1/20/24
4|Page