VLSI Implementation of SPI and I2C Communication Protocols
VLSI Implementation of SPI and I2C Communication Protocols
ISSN: 2454-132X
Impact factor: 6.078
(Volume 6, Issue 4)
Available online at: https://www.ijariit.com
ABSTRACT
For the frequent communication between the integrated circuits in an electronic system, which are designed to work in a
group rather than a standalone unit, it becomes necessary to adapt serial communication, which is an effective and simple
protocol, that provides efficient communication among these various components as compared to parallel communication in
terms of the pin count and the ease of implementation. The two most widely accepted, tried and true serial global standards are
Serial Peripheral Interface (SPI) and Inter-Integrated Circuit (I2C), which are used for inter-chip and intra-chip serial
communication for a low or medium bandwidth. The Paper’s focus is on the simulationof SPI and I2C protocols.
Keywords: Integrated Circuit, I2C Protocol, SCL (Serial Clock), SDL (Serial Data Line) SPI Protocol, and Protocol
Conversion Unit.
1. INTRODUCTION
For low-end low bandwidth serial communication the two widely accepted standards areI2C and SPI. The two protocols have their
own prospects and are strong opponents to each other in the market. By and large there is a high possibility that they exist in the
digital domain. With a lot of peripheral devices from a different vendor there is always a choice to be made between the I2C and
SPI protocols.
Data transfer takes place through the SDA and SCL lines of I2C. Any data changeover can occur on the SDA line only when the
SCL line is at Logic Low and all these changeovers have to settle down until SCL becomes Logic high. I2C is a bi-directional bit-
oriented communication protocol hence it facilitates a Full Duplex communication between Master and Slave.
2. LITERATURE REVIEW
I2C protocol gives easy communication with no data loss. It gives excellent speed compared to former protocols such as UART,
USB and CAN. It is lightweight, omnipresent and economical. It also increases rate of data transfer when compared other
protocols. The main goal of the paper [1] is to develop the protocol to control the data that can be saved on registers as well as
registers inside the devices and to get high speed communication, through this they were able to control different parameters. I2C
is used in data surveillance for efficiency and accuracy. The ideal surveillance architecture with I2C protocol will be having the
following features: high flexibility, performance, low development cost, easy upgradability, and a migration path to lower cost as
the application grow up and volume upgrades.
The I2C protocol is a renowned serial communication protocol developed by Philips Semiconductor (now it is known as NXP
Semiconductor) in 1980 to exchange data especially between slow and fast devices [2]. It consists of only two external wires SDA
and SCL and its capability to transmit data with no loss makes it simpler and inexpensive than other protocols. This paper [3] is
aimed to present the valuable study on I2C protocol by different scholars over the years.
A SPI bus is a communication protocol that allows serial data transfer between a master and a slave device. In the paper [4], their
focus was on to present a full explanation of a Serial peripheral interface Master/Slave design and implementation. The Design
specification is based on Motorola’s Serial peripheral interface Guide version V03.06. The purpose of the paper is to provide
information about communication among serial peripheral interfaces (SPI) Master to Serial peripheral interface Slave. The
In the world of communication protocols, I2C and SPI are often considered as “little” communication protocols compared to
Ethernet, USB, SATA, PCI-Express and others that shows throughput in the multiple of 100 Mb/s range, if not Gb/s. It is
important that one shouldn’t forget the purpose of each protocol [8][9]. Ethernet, USB, and SATA are meant only for “out of the
box communications” and data exchanges between whole systems. When there is a necessity to implement a communication
among an integrated circuit such as a microcontroller and a set of relatively slow peripherals, there is no need to use excessively
complex protocols. Therefore, SPI and I2C perfectly fit the bill and have become so popular that it is very likely that any
embedded system engineer will use them during his/her careers.
The MOSI lines remain null until the SCL line is high. Here 0 is read bit and 1 is write bit. In Figure 7 the first bit 0 is the
read/write bit. Here it is read bit. The next eight bits are the address bits sent one bit at a time. Then data bits are sent one bit at a
time. Here it is eight bits. The address bits are 10101011 and data bits are 00011001. When a Slave receives address bits and
along with data bits it discards the data bits because it doesn’t require data bits when we have read bit and it will be used only
when we have write bit.
When read-bit is sent, MISO line will be activated with data stored in the address sent to the Slave. MISO line will be active when
last bit of address received.
When write bit is sent, Slave will store the data in the address sent by the Master and it is as shown in Figure 8 and 9. The address
and data in decimals are 171 and 25.
4.1.2 Single Master multiple Slave Configuration: A single Master drives four Slaves, the MOSI line of Master is connected
through a 4:1 Mux to Slaves as shown in Figure 7.1.4. The operation is very similar to single Master Slave configuration except
that it has multiple Slaves.
Fig. 10: Single Master multiple Slave configuration of read and write Operations
Slaves 1, 3 and 4 are used for read operation and Slave 2 used for write operation is as shown in Figure 10. The Data stored in
Slave-2 is as shown in Figure 11.
Master will send the address of the Slave’s register i.e. 1001010, then Slave will respond by ACK bit ‘1’ which represents that the
address is present in the slave. Then Slave will send Data from received register i.e. 01011101 to Master, Then Master will
respond with ACK bit ‘1’ indicates that Master read the data successfully. Communication stops when SDA is at rising edge and
SCL at High as shown in Figure 12.
If the address that is send by master doesn’t match with the slave then it will keep on sending the same address as shown in Figure
13.
5. CONCLUSION
This paper presents the simulation of SPI and I2C protocol communication. Codes are written in Verilog, simulation and synthesis
are carried out in Xilinxs ISE 14.7 and SPI and I2C protocols are industry standard protocols, which are discussed in detail. FSM
implementation of SPI and I2C are explained.
6. REFERENCES
[1] Mankar, Jayant, ChaitaliDarode, KomalTrivedi, MadhuraKanoje, and PrachiShahare. "Review of I2C protocol." International
Journal of Research in Advent Technology 2, no. 1 (2014).
[2] Pandey, Vivek Kumar, Sparsh Kumar, Vimal Kumar, and PankajGoel. "A Review Paper on I2C Communication
Protocol." International Journal of Advance Research, Ideas and Innovations in Technology 4, no. 2 (2018): 340-343.
[3] Leal-del Río, Tatiana, Gustavo Juarez-Gracia, and L. NoéOliva-Moreno. "Implementation of the communication protocols SPI
and I2C using a FPGA by the HDL-Verilog language." Research in Computing Science (2014): 31-41.
[4] Oudjida, AbdelkrimKamel, Ahmed Liacha, D. Benamrouche, M. Goudjil, RachidTiar, and A. Ouchabane. "Universal
Low/Medium Speed I2C-Slave Transceiver: A Detailed FPGA Implementation." Journal of Circuits, Systems, and
Computers 17, no. 04 (2008): 611-626.
[5] Ghanekar, Aviraj, BrajKishor, and SachinBandewar. "Design and Implementation of SPI Bus Protocol." International Journal