The SPI bus is a common serial protocol that is supported by the RI7100A. SPI differs from I2C buses in that it uses more than just 2 wires for bus, clock and data, SPI uses individual Clock, Write and Read lines plus two strobe lines for Valid Data and Chip Select. This document is not meant to be a SPI tutorial, that is left to other sources, it will however, describe how to implement it on the RI7100A.
On the RI7100A, SPI is a special case of the serial bus. Please review these documents Serial Bus Control; Defining the DUT, Serial Bus Control; Testplan and Serial Bus Control; Data Read.
We will concentrate on the differences for SPI. In this case we will be using the DUT Defined Serial type, locally defined is also available
First as a full duplex bus, read and write are on separate data lines. So in applying tester resources for two DB lines (R and W) are first defined. For SPI as well as other fast serials, DB1, 2,3 or 9,10,and 11 run up to 2.5 MHz and should be used. DB 1 and 2 are typically used as the Read and Write Data lines, and if a triatate bus is required, can be tied to the serial bus Hi voltage through 5K pull up resistors. DB 3 or 11 is normally used as the the clock line. Since the Data Valid and Chip Select lines are not typically high speed, any of the other DB lines are usable.
1.) Here is where the Serial type is defined. Pick "SPIFormat" as the Style (may need to be "StdFormat")
2.) Start the Dut definition with the SPI register address, ignoring the part address which will be controlled by the Chip Select. Therefore it will look like a 16 bit word with the first 8 bits being the SPI register address.
Here are the main differences between other serial implementations:
1.) The Serial Type is DUT Defined. (In the dut it is the defined as SPI)
2.) Use the SPI address button to define the part address of the DUT. And make it seven bits as the 8th bit is reserved for the tester as R/W
3.) Define the Static Digital Von, Voff, Data Read, Data, Clock, Serial Clock Period as you would with other Serial Types
4.) DB2 is set as "open Collector" This is what allows the tester and part to communicate with the "Ack"
This is exactly like all other dut defined Serial
1.) This is slightly different as the I2C Register that is desired must be specified.
Data Write and then Read
A write and read can be combined in one panel
Example of SPI Write/Read with defined Read Start Bit:
When needing to define the "Serial Start" bit to begin reading, the 'Serial Type' needs to be set to "Generic Read", and "Serial Read Size" and "Read Start" buttons need to be defined to match data specifications. Patch p21c.648 is needed to execute the generic reads.
The following SPI example shows a 24-bit sequence which sends a write command (on line 1) which instructs to do a read. It consists of a 5 bit start sequence (11011), a 3-bit desired read register (R2R1R0), 13-bits of data (don't cares), and 3 stop bits (111). The picture below illustrates the write command for a read (on line 1) from register address 3 (011), and the data returned from the read (on line 3).
1.) Since the register begins with a start sequence and contains an address, data, and stop bits, choose "serialStdFormat" as the Style.
2.) Start the Dut definition with the SPI start sequence, followed by the register address, data bits, and stop bits.
This example uses positive clock edge, negative strobe, and MSB first.
The read size defines the length of the read (in this example, 13 bits = D12->D0) and the start bit defines where the read will start (the 11th bit from the MSB as in line 3 of the case above). For this example, a read from register address 3 will produce a 256 (0000100000000), with a leading 10-bit start sequence (1111111101) and one following stop bit (1).
Data Write and then Read:
In order to read back a certain register value, then the method of using a "Generic Read" to define the read start and size must also be used in conjunction with a "Generic Serial Write" template in order to perform a read. The Generic Serial Writeis used to send the read command while the Generic Readcalculation button is used to read back the value in decimal form.
When doing the read, the Generic Serial Writetemplate sets up the proper write command to instruct a read (data, line 1 = 11011[R2R2R0]0000000000000111) with the register address values set by a range([R2R1R0] = XXX), so they can easily be modified. This can be created using Registers X, Y, and/or Z, found under "Static Digital-> Advanced I2C". The figure below shows a setup of a read command from register addresses 2 and 3.