Professional Documents
Culture Documents
Overview
The SPI/serial interface module implements a generic 4-bit wide SPI interface to connect to
several peripherals on the Orange Platform, namely:
i)
ii)
iii)
iv)
This module presents a common programming interface to software abstracting out the individual
differences within these devices w.r.t to the SPI protocol implementation.
FPGA Implementation
Figure 1 below illustrates the high level implementation of the SPI serial interface block. As shown in the
figure, the logic for asserting the clock and data lines is common for all peripherals, and the chip select is
asserted based on the device being asserted.
2.1
The SPI state machine shown in Figure 1 handles the bulk of the functionality implemented in this
module. Figure 2 illustrates the state transition diagram.
2.2
Clocking
This module expects a 50MHz input clock (though the top level could feed another input clock frequency
if needed) and drives out a divided-by-two version to peripherals as the serial clock during an active
access. MO
2.3
Processor Interface
This block implements the control/ status registers and FIFOs required to interface with the P1010 host.
The FIFO interface implemented here is borrowed from the Obsidian design, which essentially presents
the head entry of a FIFO as a 32-bit register to the processor.
2.3.1
Bit(s
)
Parameter
Description
31:28
Unused
NA
31:24
Unused
N/A
23:20
19:16
15:8
Number of Bits
7:4
Device Select
0000 = DEV_1_ICS_307
0001 = DEV_2_DAC_128S085
0010 = DEV_3_DAC_8555
0011 = DEV_4_HC594
2.3.2
R_W
0 = Read, 1 = Write
Start bit
Bit(s)
Parameter
Description
31:10
Unused
NA
Rd FIFO Empty
Wr FIFO Full
Rd access complete
Rd FIFO Status
Empty
Rd FIFO Empty
Rd FIFO Overflow
Rd FIFO overflow
Rd FIFO Above
Threshold
Wr access complete
WrFIFO Status
Empty
Wr FIFO Empty
Wr FIFO Overflow
Wr FIFO overflow
Wr FIFO Above
Threshold
2.4
2.4.1
Write Access
Configure control register with start bit = 0 and other fields as required for transaction specifics
(e.g write/read, transaction length, etc.)
2.4.2
Read Access
Configure control register with start bit = 0 and other fields as required for transaction specifics.