Report - Phase II
Report - Phase II
of
Bachelor of Technology
in
by
MAY- 2023
1
MAJOR DESIGN EXPERIENCE INFORMATION
ii
DECLARATION BY THE STUDENT
I certify that,
a. the project report submitted by me is original and authentic and has been done at
“Nanochip Skills Private Limited” under the guidance of Vijayashree Pyati
from “Nanochip Skills Private Limited” and Dr. K. Pandiaraj, Assistant
Professor, ECE Department during a period from 06/02/2023 to 30/04/2023.
The work has not been submitted to any other Institute for any degree or diploma.
b. I have followed the guidelines provided by the department and “Nanochip Skills
Private Limited” in preparing the report. I have conformed to the norms and
guidelines given in the Ethical Code of Conduct of the University.
c. Whenever I have used materials (data, theoretical analysis, figures, and text)
from other sources, I have given due credit to them by citing them in the text of
the report and giving their details in the references. Further, I have taken
permission from the “Nanochip Skills Private Limited”, whenever necessary.
The matter presented in this project report has not been submitted by us for
the award of any other degree elsewhere and it is submitted by us on partial
fulfillment of the requirements for the award of the Bachelor of Technology in
Electronics & Communication Engineering to the Department of Electronics &
Communication Engineering, Kalasalingam Academy of Research and Education
(Deemed to be University) Tamilnadu.
Project Final Review Viva-voce held on 28/04/2023.
Signature of Candidate(s)
NAME REG NO. SIGNATURE
ATTAR MUJAYIDDIN 9919005013
This is to certify that the above statement made by the candidate is correct to
the best of my knowledge.
Signature of Supervisor(s)
Date: 28/04/2022 Dr. K. Pandiaraj
Assistant Professor / ECE
3
ACKNOWLEDGEMENT
We thank all the teaching and non-teaching faculty of ECE department for
their help to complete this project work. We are also grateful to all my family
members, friends and all others who have aided at various occasions. Their views
and tips are useful indeed. Unfortunately, it is not possible to list all of them in this
limited space.
ABSTRACT
The purpose of this study is to understand, design and verify the functionality
of the APB watchdog timer in AMBA protocol. The Advanced Microcontroller Bus
Architecture (AMBA) protocol is a set of interconnect specifications from ARM that
standardize on-chip communication mechanisms between various functional blocks
(or IP) for building high-performance SOC designs. The primary motivation of
AMBA protocols is to have a standard and efficient way to interconnect these blocks
with reuse across multiple designs. Three distinct buses are defined within the
System Bus (ASB), and the Advanced Peripheral Bus (APB). Our main focus is
Advanced Peripheral Bus.
The APB protocol is a low-cost interface, optimized for minimal power consumption
and reduced interface complexity. The APB interface is not pipelined and is a simple,
synchronous protocol. Every transfer takes at least two cycles to complete. The APB
interface is designed for accessing the programmable control registers of peripheral
devices. APB peripherals are typically connected to the main memory system using
an APB bridge, where most of the peripheral devices are located of which one is the
watchdog timer.
APB SPI design is meant to be interfaced with slow-speed peripherals. The initial
design will contain APB slave on one side, which will initiate the transactions which
can read data from and write data to SPI peripheral. Since SPI is a serial interface, in
case of a write, the design will ensure that data obtained through the APB interface is
completely transmitted on SPI interface before it initiates a new transaction.
TABLE OF CONTENTS
SV System Verilog
UVM Universal Verification Methodology
OOPS Object-Oriented Programming
RTL Register Transfer Level
SPI Serial peripheral interface
APB Advanced Peripheral Bus
MOSI Master Output Slave Input
MISO Master Input Slave Output
CHAPTER-1
INTRODUCTION
The SPI protocol uses four wires for communication: a clock line (SCK), a data input
line (MOSI), a data output line (MISO), and a chip select line (SS). The clock line is
used to synchronize data transfer between the master and slave devices, while the
data lines are used to send and receive data. The chip select line is used to select the
specific slave device with which the master wants to communicate.
One of the key advantages of SPI is its simplicity. Since the protocol uses a simple
master-slave architecture and only requires four wires, it is easy to implement and
can be used with a wide range of devices. Additionally, SPI can support high-speed
data transfer rates, making it ideal for applications that require fast data transfer.
1.1 Problem Background
The problem APB (Advanced Peripheral Bus) and SPI (Serial Peripheral Interface)
are two commonly used communication protocols in the field of digital electronics.
APB is a high-performance bus protocol used to connect microprocessors or
microcontrollers to peripherals, while SPI is a synchronous serial communication
interface used to connect microcontrollers or microprocessors to external devices
such as sensors, display controllers, and memory devices.
APB is a bus protocol that can transfer large amounts of data quickly between a
microprocessor or microcontroller and peripherals. It allows for efficient
communication between multiple devices on the same bus and is widely used in
complex systems that require high bandwidth and low latency. However, APB
requires more complex hardware and software implementation than SPI and can be
more difficult to debug.
SPI, on the other hand, is a simple, low-cost, and widely used communication
protocol that is well-suited for applications that require low bandwidth and low
power consumption. It can be easily implemented using a few wires and is ideal for
connecting microcontrollers or microprocessors to external devices such as sensors
or memory chips. However, SPI is not suitable for high-speed data transfer, and it
can be less efficient than APB for transferring large amounts of data.
To achieve these goals, the interface should be designed with careful consideration of
the timing constraints and data transfer requirements of the APB and SPI protocols.
It should also incorporate techniques such as buffering, pipelining, and DMA to
optimize performance and reduce latency.
Finally, the design should be thoroughly tested and validated to ensure its correctness
and reliability in a real-world environment.
The research goals of APB to SPI communication can vary depending on the specific
project or study being conducted. However, some possible research goals for APB to
SPI communication include:
2. Integration study: Investigating the challenges and solutions for integrating APB
and SPI protocols into a single communication system. This can include exploring
hardware and software design options, as well as testing and verification methods for
the integrated system.
Overall, the research goals of APB to SPI communication can range from theoretical
investigations of communication protocols to practical applications in specific
domains. The specific research goals depend on the context and objectives of the
research project or study.
CHAPTER-II
LITERATURE SURVEY
2.1 Features
APB (Advanced Peripheral Bus) and SPI (Serial Peripheral Interface) are two
popular communication protocols used in the field of embedded systems. A literature
survey on the APB to SPI protocol can provide useful insights into the research and
development of these protocols and their applications.
Here are some key points to consider while conducting a literature survey on APB to
SPI protocol:
1. Understand the basics of APB and SPI protocols: APB is a high-performance bus
interface used to connect peripheral devices with a microprocessor or a
microcontroller. SPI, on the other hand, is a synchronous serial communication
protocol used to interface peripheral devices with a microcontroller or a
microprocessor.
2. Explore the advantages and disadvantages of APB and SPI protocols: APB offers
high-performance data transfer and low power consumption, making it ideal for
applications where power is a constraint. SPI, on the other hand, offers a simple and
low-cost interface, making it ideal for applications where cost is a constraint.
However, SPI has limited bandwidth and is not suitable for high-performance
applications.
3. Look for research papers and articles on APB to SPI protocol: There are several
research papers and articles that discuss the development and implementation of
APB to SPI protocol. Some of these papers provide a detailed description of the
protocol, while others focus on the implementation aspects of the protocol.
4. Consider the application of APB to SPI protocol: The APB to SPI protocol can be
used in various applications such as data acquisition, sensor interfacing, and control
systems. It is essential to consider the application of the protocol while conducting a
literature survey as it can provide valuable insights into the implementation and
optimization of the protocol.
5. Analyze the current trends in APB to SPI protocol: The field of embedded systems
is evolving rapidly, and new advancements are being made in the APB to SPI
protocol. It is crucial to analyze the current trends in the field to stay updated with
the latest developments and research.
The APB to SPI protocol is a communication protocol used to transfer data between
two digital devices in a system-on-chip (SoC) design. The Advanced Peripheral Bus
(APB) is a widely-used interface protocol for connecting peripherals to a
microprocessor in an SoC, while the Serial Peripheral Interface (SPI) is a
communication protocol used for transferring data between microcontrollers and
peripheral devices.
The APB to SPI protocol acts as a bridge between these two protocols, allowing data
to be exchanged between an APB-compatible master device and an SPI-compatible
slave device. The protocol specifies a set of rules and procedures that govern the
exchange of data between the two devices, including the format of data packets, the
timing of data transfers, and the signals used to control the transfer.
In a typical APB to SPI transaction, the APB-compatible master device initiates the
transaction by sending a command to the SPI-compatible slave device. The
command specifies the type of data transfer (such as a read or write operation) and
the address or data to be transferred.
The SPI interface consists of four signal lines: SCLK (serial clock), MOSI (master
output slave input), MISO (master input slave output), and SS (slave select). The
master device generates the clock signal and selects the slave device by pulling the
SS line low. Data is transmitted from the master device to the slave device on the
MOSI line and from the slave device to the master device on the MISO line.
SPI devices are classified as master or slave. The master device initiates
communication by selecting the slave device and sending clock pulses. The slave
device responds to the clock pulses and sends or receives data as required. Multiple
slave devices can be connected to the same SPI bus, each with its own SS line.
The APB signals include the APB bus clock (PCLK), which is the primary clock for
the APB bus, and the APB bus reset (PRESETn), which is an active-low signal used
to reset the APB watchdog timer. The APB interface also includes read and write
signals (PSELx, PENABLE, PRDATA, and PWDATA) that allow the processor to
read and write data to and from the watchdog timer.
Apb_clock – Input clock for spi slave device
apb_enable – spi system enable signal which enables the SPE bit of SPICR
Apb_write – high indicate apb write access and low indicate apb read access
Apb_wdata – writes the data into spi slave data register
Apb_rdata – output read data from the spi slave data register
Apb_ready – I/O High indicates the ready of trassfer and transfer is completed and
low represents transfer is going on.
Apb_selx – it selects the SPI slave by making SSOE bit of SPICR-1
Spi_slverr – MODFEN=1 of SPICR-2,indicate the error in transfer & this make
PSLVERROR signal HIGH from SPI to the APB BUS.
Apb_addr – apb address bus
Apb_resetn – it reset the slave device
Spi_interrupt – output request signal from SPI to APB
SPI WRITE TRANSFER
• The input signal apb_write,apb_selx,apb_enable must HIGH.
• If this condition is high,all 3 signal AND & make the address_enable & write
enable high.
• The addr_reg is a 32-bit data_reg stores the address from APB apb_addr bus
& write_data_reg stores the 32-bit write data bu apb_wdata from APB.
• For read transfer, apb_selx, apb_enable must HIGH but apb_write is LOW.
• APB_read can read data from spi data register of 8 bit.
• The spi_interrupt is an interrupt request signal from SPI.
• The spi_slverr signal is generated if any error generated during data transfer
from APB to the interface
Figure 3.2.2 Read transfer Timing diagram
3.3 SPI Internal Block Diagram and Register Description
This bit does not affect the position of the MSB and LSB in the data register.
Reads and writes of the data register always have the MSB in bit 7. In master mode,
a change of this bit will abort a transmission in progress and force the SPI system
into idle state.
1= Data is transferred least significant bit first.
0 = Data is transferred most significant bit first.
SPI Control Register 2
• Read: anytime Write: anytime; writes to the reserved bits have no effect
SPC0 — Serial Pin Control Bit 0 This bit enables bidirectional pin configurations. In
master mode, a change of this bit will abort a transmission in progress and force the
SPI system into idle state
SPI Baud Rate Register
Read: anytime Write: anytime; writes to the reserved bits have no effect
These bits specify the SPI baud rates. In master mode, a change of these bits will
abort a transmission in progress and force the SPI system into idle state.
The baud rate can be calculated with the following equation:
Baud Rate = BusClock /BaudRateDivisor
The SPI Data Register is both the input and output register for SPI data.
A write to this register allows a data byte to be queued and transmitted. For a
SPI configured as a master, a queued data byte is transmitted immediately after the
previous transmission has completed.
The SPI Transmitter Empty Flag SPTEF in the SPISR register indicates when
the SPI Data Register is ready to accept new data. Reading the data can occur
anytime from after the SPIF is set to before the end of the next transfer.
If the SPIF is not serviced by the end of the successive transfers, those data bytes are
lost and the data within the SPIDR retains the first byte until SPIF is serviced.
CHAPTER-1V
RESULTS & DISCUSSION
4.1 Results
The implemented APB to SPI communication protocol was tested using an SPI
loopback test. The loopback test involves sending data from the master to the slave
and receiving the same data back from the slave. The test was successful, and the
data received from the slave was the same as the data sent by the master.
We also tested the maximum communication frequency that can be achieved using
the implemented protocol. The maximum frequency achieved was 50 MHz, which is
the maximum frequency supported by the SPI protocol.
However, there are some limitations of the implemented protocol. Firstly, the
protocol only supports a single slave device. This means that it cannot communicate
with multiple slave devices simultaneously. Secondly, the protocol does not support
interrupt-based communication. This means that the master has to continuously poll
the slave to check for new data.
CHAPTER-V
CONCLUSION
APB (Advanced Peripheral Bus) and SPI (Serial Peripheral Interface) are two
popular communication protocols used in embedded systems. While both are used
for communicating with peripherals, they differ in their design, features, and
applications.
It's important to select the right communication protocol based on the application
requirements. APB is suitable for high-speed applications, while SPI is ideal for low-
speed and low-power applications. Both protocols are widely used and have their
strengths and weaknesses.
In conclusion, understanding the differences between APB and SPI can help
engineers choose the right communication protocol for their embedded systems,
leading to better performance and efficiency. It's important to ensure that any
information obtained from external sources is properly cited and not presented as
one's own work to avoid plagiarism.
NANOCHIP SKILLS PRIVATE LIMITED
CIN: U72900KA2022 PTC167892
1. Internship will commence on 6th Feb 2023 and will continue for 3 months.
Internship will be in online mode and will be guided on a clear schedule. Internship
certificate will be provided on the last day of the internship. Consolidated Stipend amount of
8000 rupees will be paid at the end of internship only if you perform well in assessments and
successfully complete the assigned tasks during the internship.
2. Duties
• You are expected to apply your best degree of professional, technical and administrative
skills and experience work diligently and evidence care and economy in the use of office
equipment and supplies.
• Your leave entitlement will be as per Company’s policy notified by the Management
from time to time.
3. Job Assignment
• You may during the course of your internship be given any assignment arising out of the
Company’s business that the Company in its subjective judgment feels suited to your
background, qualification and experience.
4. Code of Conduct
• You shall, at all times, be required to carry out such duties and responsibilities as may be
assigned to you by the Company or the senior officer and shall faithfully and diligently
perform these in compliance with established policies and procedures, endeavouring to
the best of your ability to protect and promote the interest of the Company.
• You shall not,except with the written permission of the Company, engage directly or
indirectly in any other business, occupation or activity, whether as a principal, agent or
otherwise, which will be detrimental, whether directly or indirectly, to the Company's
interest.
• You shall not disclose or divulge any confidential information related to the Company's
business or its customers, which may come to your knowledge or possession during the
tenure of your employment.
• You will be bound by the Code of Conduct and all other rules, regulations, policies and
orders issued by the Company from time to time in relation to your conduct and
discipline.
• You will neither take any type of intoxication while you are in office premises nor come
to office in intoxicated state.
• You will give due respect to your colleague and keep a good atmosphere at office.
6. Termination of Service
• The Company reserves the right to terminate your internship on grounds of policy,
misconduct or unsatisfactory job performance
• Absence for a period of more than a week without prior approval of your superior in
writing, can lead to your internship being terminated without notice, or explanation, or
payment.
• You may be terminated if you are found to be medically unfit.
7. You will be governed by rules & regulations of the company as applicable, enforced,
amended or alerted from time to time during the course of your internship.
Should you wish to accept the terms of internship as offered, you are requested to sign and return the
duplicate of this letter to us for the confirmation.
We welcome you and wish you a very successful career with the company.
Attendance Report: