STREAM Communications

Uncompressed data format
Stream board samples uses 1 bit for I or Q channel selection and 12 bits for amplitude. One pair of I and Q samples makes up one frame. Each frame is transferred using 4 bytes as shown below.This data format is used for uploading and downloading samples.

Stream board PC and FX3 communications
Stream board can be connected to the PC by USB 2.0 or USB 3.0. The software can perform SPI registers writing and reading operations over USB device’s control endpoints using LMS64C control protocol. The control endpoints should be configured as shown below. The following commands are supported in Stream board bridge MCU (FX3):
 * CMD_GET_INFO
 * CMD_LMS_RST
 * CMD_SI5351_WR
 * CMD_SI5351_RD
 * CMD_LMS6002_WR
 * CMD_LMS6002_RD
 * CMD_LMS7002_WR
 * CMD_LMS7002_RD
 * CMD_ADF4002_WR
 * LMS_BRDSPI16_WR
 * LMS_BRDSPI16_RD
 * CMD_ALTERA_FPGA_GW_WR

Getting board information
Send a CMD_GET_INFO command to the bridge MCU to get information about the hardware. Stream board information is returned by MCU as shown below:

Resetting LMS chip
Send a CMD_LMS_RST command to the bridge MCU to to reset the LMS chip.

Communicating with LMS transceivers
Various expansion boards may be connected to the Stream board. Expansion boards may be populated with LMS6002D or LMS7002M transceivers. The commands CMD_LMS6002_WR, CMD_LMS6002_RD, CMD_LMS7002_WR and CMD_LMS7002_RD are designed to set-up and read set-up data to these transceivers.

Communicating with Si5351
The Stream board has a Si5351 clock synthesiser onboard. The commands CMD_SI5351_WR and CMD_SI5351_RD are dedicated for Si5351 clock synthesiser set-up.

Communicating with ADF4002
The Stream board has an ADF4002 PLL onboard. The command CMD_ADF4002_WR is dedicated for ADF4002 set-up. It is not possible to read the configuration data from ADF4002.

FPGA modules setup
The FPGA hardware on the Stream board is controlled by 16 bit memory registers, which can be read or written by using the LMS64C data protocol, CMD_BRDSPI16_WR and CMD_BRDSPI16_RD commands. The SPI registers are shown below.

FPGA programming
FPGA programming is performed by sending data to the USB device’s control end point. Data needs to be encapsulated in LMS64C packet, using the CMD_ALTERA_FPGA_GW_WR command.

IQ sample writing
IQ sample writing is performed by sending data to the USB device’s bulk end point, which has the address 0x01. Before that, the Stream board has to be configured to accept incoming data. The general steps for IQ sample writing are:
 * 1) Enable STREAM_LOAD and disable STREAM_TXEN, STREAM_RXEN.
 * 2) Transfer sample data to USB Endpoint whose address is 0x01. Sample writing can be done either in one transaction, or several successive transactions.
 * 3) Disable STREAM_LOAD and enable STREAM_TXEN.

IQ sample reading
IQ sample reading is performed by reading data from the USB device’s bulk end point, which has address 0x81. Before that, the Stream board has to be configured to send out data samples. The general steps for IQ sample reading are:
 * 1) Enable STREAM_RXEN.
 * 2) Read data samples from USB Endpoint whose address is 0x81. Reading can be repeated indefinitely.
 * 3) After reading is done, disable STREAM_RXEN.

Introduction
Communication between the FX3 USB microcontroller and FPGA are performed using the GPIF II interface configured as slave FIFO with a 16 bit width data bus. Implementation is based on the AN65974 application note from Cypress.

GPIF II-related connections between FX3 and FPGA
FX3 and FPGA GPIF II related connections are as shown in the below image.

Detailed description of the signals is provided below.

StreamIN data transfers (from FPGA to FX3)
StreamIN transmits the data from the FPGA to FX3 and then to the PC. To implement StreamIN data transfers some signals, listed in GPIF II-related connections, may be connected to the high or low level as shown below; please note that the active (asserted) signal level is low. Check application note AN65974 from Cypress, "Design Example 1: Interfacing an Xilinx FPGA to FX3’s Synchronous Slave FIFO Interface," for a more detailed explanation on how to implement the StreamIN interface between FX3 and FPGA.

StreamOUT data transfers (from FX3 to FPGA)
StreamOUT transmits the data from the PC to FX3 and then to the FPGA. To implement StreamOUT data transfers some signals, listed in GPIF II-related connections, may be connected to the high or low level as shown below; please note that the active (asserted) signal level is low. Check application note AN65974 from Cypress, "Design Example 1: Interfacing an Xilinx FPGA to FX3’s Synchronous Slave FIFO Interface," for a more detailed explanation on how to implement the StreamIN interface between FX3 and FPGA.