SPI Express VI

LabVIEW 2015 roboRIO Toolkit Help

Edition Date: June 2015

Part Number: 374999A-01

»View Product Info
Download Help (Windows Only)

Requires: myRIO Toolkit or roboRIO Toolkit

Writes data to or reads data from a serial peripheral interface (SPI) slave device through the SPI channels on the myRIO or the roboRIO.

In addition to the SPI channels on the MXP port, the roboRIO also has an SPI port. The SPI port contains four chip select (CS) lines to support up to four slave devices. You also can use the CS lines as DIO lines. The roboRIO uses a 3.3 V voltage rail on the SPI port for powering SPI peripherals and provides 3.3 V DIO lines for generating SPI signals.

Details  

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs

Dialog Box Options

ParameterDescription
Node nameSpecifies the name of this Express VI. You can also double-click the name of this Express VI on the expandable node to edit the name.
ChannelSpecifies the SPI channel to which to write data to or read data from an SPI slave device.
ConnectionsShows the myRIO or roboRIO pins that correspond to the SPI logic signals.
ModeSpecifies the mode of operation that this Express VI uses to communicate with the SPI slave device. Mode contains the following options:
  • Write—Specifies that this Express VI writes data to the SPI slave device.
  • Read—Specifies that this Express VI reads data from the SPI slave device.
  • Write/Read—Specifies that this Express VI writes data to and reads data from the SPI slave device at the same time.
FrequencySpecifies the frequency of the generated clock signal. If you specify a frequency that is invalid, this Express VI coerces the specified value to the nearest valid value when you click the Validate button.
  • Frequency value—Specifies the value of the frequency. The default is 1.
  • Frequency unit—Specifies the unit of the frequency. The default is MHz.
  • Validate—Validates whether this Express VI can generate the frequency that you specify. If the specified frequency is not valid, this Express VI coerces the specified value to the nearest valid value.
Frame lengthSpecifies the number of bits that make up one SPI transmission frame. The default is 8 bits.
Advanced optionsSpecifies advanced configuration options for communicating with the SPI slave device.
  • Clock phase—Specifies the clock phase at which the data remains stable in the SPI transmission cycle. The default is Leading, which means the data is stable on the leading edge and changes on the trailing edge. The other option is Trailing, which means the data is stable on the trailing edge and changes on the leading edge.
  • Clock polarity—Specifies the base level of the clock signal and the logic level of the leading and trailing edges. The default is Low, which means the clock signal is low when idling, the leading edge is a rising edge, and the trailing edge is a falling edge. The other option is High, which means the clock signal is high when idling, the leading edge is a falling edge, and the trailing edge is a rising edge.
  • Data direction—Specifies the order in which the bits in the SPI frame are transmitted. The default is Most significant bit first, which specifies to send the most significant bit first and the least significant bit last. The other option is Least significant bit first, which specifies to send the least significant bit first and the most significant bit last.
View CodeDisplays the underlying code of this Express VI.
Connection DiagramShows the I/O connector pinouts on the myRIO or the roboRIO. The highlighted pinouts represent the channels that you configure.

Block Diagram Inputs

ParameterDescription
Frames to WriteSpecifies the data to write to the SPI slave device. You can write multiple frames to the device at the same time. This input is available when you set Mode to Write or Write/Read.
Frame CountSpecifies the number of frames to read from the SPI slave device. This input is available when you set Mode to Read.
error in (no error)Describes error conditions that occur before this node runs.

Block Diagram Outputs

ParameterDescription
Frames ReadReturns the data frames that this Express VI reads from the SPI channel. This output is available when you set Mode to Read or Write/Read.
error outContains error information. This output provides standard error out functionality.

SPI Details

Related Information

I/O Connectors (myRIO Toolkit)

I/O Connectors (roboRIO Toolkit)

Generating FPGA Clocks (myRIO Toolkit)

Generating FPGA Clocks(roboRIO Toolkit)

Power Supply for Peripheral Devices (roboRIO Toolkit)

DIO Lines (roboRIO Toolkit)

WAS THIS ARTICLE HELPFUL?

Not Helpful