Professional Documents
Culture Documents
RTL Design of SPI Protocol
RTL Design of SPI Protocol
com/in/asimkhan-vlsi
SPI Master
clk cs
rst SPI Master mosi
newd sclk
din [11:0]
Signal Description
Name Description
clk Clock signal controls the timing of the SPI operations, both the read and write operation will
perform on rising edge of clock.
newd This signal is used to indicate when user have a new data, which it needs to transmit to the
device through an SPI transaction.
din Din is user defined data that it needs to communicate to the device connected with an interface.
cs Chip Select is used to enable our slave device and active low, on this, pin will start a transaction.
mosi mosi is the pin used to transmit the data serially from master to slave.
sclk sclk is the serial clock which will be going to slave for synchronization.
1
Visit – https://www.linkedin.com/in/asimkhan-vlsi
Start
No
newd
== 1
Yes
Start tx
No
all bit
send
Yes
End tx
• SPI master operation is very simple, we have to wait till user have a new data. As soon as user make newd
high, we will start sampling the data that we have on the bus and start transmitting it to the slave device.
• First, we start a transaction, usually the ideal value of chip select is high, so when user wish to start
transaction, it conveys to slave by making chip select low.
• Onwards, from the next clock tick, we will start sending data serially one after another.
• As soon as we complete sending all the bits, we will end our transaction
2
Visit – https://www.linkedin.com/in/asimkhan-vlsi
SPI Slave
cs done
mosi SPI Slave
sclk dout[11:0]
Operation
SPI slave operation is also very simple, it just needs to understand the SPI transaction required clock, chip select
and mosi, it will give the output and once the process of data generation is carried, that mean once it converts 12-
bit of serial data into 12-bit number, we will make done signal as high, which indicate our transaction is completed.
Simulation Result=>
3
Visit – https://www.linkedin.com/in/asimkhan-vlsi