You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-18
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
# SPI MASTER AND SLAVE FOR FPGA
2
2
3
-
The SPI master and SPI slave are simple controllers for communication between FPGA and various peripherals via the SPI interface. TThe SPI master and SPI slave have been implemented using VHDL 93 and are applicable to any FPGA.
3
+
The SPI master and SPI slave are simple controllers for communication between FPGA and various peripherals via the SPI interface. The SPI master and SPI slave have been implemented using VHDL 93 and are applicable to any FPGA.
4
4
5
5
**The SPI master and SPI slave controllers support only SPI mode 0 (CPOL=0, CPHA=0)!**
6
6
7
-
The SPI master and SPI slave controllers have been simulated.
7
+
The SPI master and SPI slave controllers were simulated and tested in hardware. If you have a question or you have a tip for improvement, send me an e-mail or create a issue.
8
8
9
9
## Table of resource usage summary:
10
10
11
11
CONTROLLER | LE (LUT) | FF | BRAM | Fmax
12
12
:---:|:---:|:---:|:---:|:---:
13
-
SPI MASTER | 32 | 21 | 0 | 274.1 MHz
14
-
SPI SLAVE | 24 | 15 | 0 | 276.8 MHz
13
+
SPI MASTER | 34 | 23 | 0 | 327.3 MHz
14
+
SPI SLAVE | 24 | 15 | 0 | 318.0 MHz
15
15
16
16
*Synthesis have been performed using Quartus Prime 17 Lite Edition for FPGA Altera Cyclone IV with these settings: CLK_FREQ = 50 MHz, SCLK_FREQ = 2 MHz, SLAVE_COUNT = 1.*
17
17
@@ -39,15 +39,16 @@ CLK | IN | 1 | System clock.
39
39
RST | IN | 1 | High active synchronous reset.
40
40
--- | --- | --- | ---
41
41
SCLK | OUT | 1 | SPI clock.
42
-
CS_N | OUT | SLAVE_COUNT | SPI chip select active in low.
43
-
MOSI | OUT | 1 | SPI serial data signal from master to slave.
44
-
MISO | IN | 1 | SPI serial data signal from slave to master.
42
+
CS_N | OUT | SLAVE_COUNT | SPI chip select, active in low.
43
+
MOSI | OUT | 1 | SPI serial data from master to slave.
44
+
MISO | IN | 1 | SPI serial data from slave to master.
45
45
--- | --- | --- | ---
46
-
ADDR | IN | log2(SLAVE_COUNT) | Slave controller address.
47
-
READY | OUT | 1 | When READY = 1, master is ready to accept input data.
48
-
DIN | IN | 8 | Input data for slave.
49
-
DIN_VLD | IN | 1 | When DIN_VLD = 1, input data are valid and can be accept.
50
-
DOUT | OUT | 8 | Output data from slave.
46
+
ADDR | IN | log2(SLAVE_COUNT) | SPI slave address.
47
+
DIN | IN | 8 | Input data for SPI slave.
48
+
DIN_LAST | IN | 1 | When DIN_LAST = 1, after transmit these input data is asserted CS_N.
49
+
DIN_VLD | IN | 1 | When DIN_VLD = 1, input data are valid.
50
+
READY | OUT | 1 | When READY = 1, valid input data are accept.
51
+
DOUT | OUT | 8 | Output data from SPI slave.
51
52
DOUT_VLD | OUT | 1 | When DOUT_VLD = 1, output data are valid.
52
53
53
54
# SPI slave
@@ -61,11 +62,11 @@ RST | IN | 1 | High active synchronous reset.
61
62
--- | --- | --- | ---
62
63
SCLK | IN | 1 | SPI clock.
63
64
CS_N | IN | 1 | SPI chip select active in low.
64
-
MOSI | IN | 1 | SPI serial data signal from master to slave.
65
-
MISO | OUT | 1 | SPI serial data signal from slave to master.
65
+
MOSI | IN | 1 | SPI serial data from master to slave.
66
+
MISO | OUT | 1 | SPI serial data from slave to master.
66
67
--- | --- | --- | ---
67
-
READY | OUT | 1 | When READY = 1, slave is ready to accept input data.
68
-
DIN | IN | 8 | Input data for master.
69
-
DIN_VLD | IN | 1 | When DIN_VLD = 1, input data are valid and can be accept.
70
-
DOUT | OUT | 8 | Output data from master.
68
+
DIN | IN | 8 | Input data for SPI master.
69
+
DIN_VLD | IN | 1 | When DIN_VLD = 1, input data are valid.
70
+
READY | OUT | 1 | When READY = 1, valid input data are accept.
71
+
DOUT | OUT | 8 | Output data from SPI master.
71
72
DOUT_VLD | OUT | 1 | When DOUT_VLD = 1, output data are valid.
0 commit comments