FILE: fsi_ex1_loopback_cpucontrol.c
Example sets up infinite data frame transfers where trigger happens through CPU. Automatic(Hw triggered) Ping frame transmission is also setup along with data.
User can edit some of configuration parameters as per usecase. These are as below. Default values can be referred in code where these globals are defined
- nWords - Number of words per transfer may be from 1 -16
- nLanes - Choice to select single or double lane for frame transfers
- fsiClock - FSI Clock used for transfers
- txUserData - User data to be sent with Data frame
- txDataFrameTag - Frame tag used for Data transfers
- txPingFrameTag - Frame tag used for Ping transfers
- txPingTimeRefCntr - Tx Ping timer reference counter
- rxWdTimeoutRefCntr - Rx Watchdog timeout reference counter
For any errors during transfers i.e.
error events such as Frame Overrun, Underrun, Watchdog timeout and CRC/EOF/TYPE errors, execution will stop immediately and status variables can be looked into for more details. Execution will also stop for any mismatch between received data and sent ones and also if transfers takes unusually long time(detected through software counters - txTimeOutCntr and rxTimeOutCntr)
External Connections
For FSI internal loopback (EXTERNAL_FSI_ENABLE == 0), no external connections needed
For FSI external loopback (EXTERNAL_FSI_ENABLE == 1), external connections are required. The FSI TX pins should be connected to the FSI RX pins of the same device. See below for external connections to include and GPIOs used:
External Connections Required between FSI TX and RX of the same device:
- FSIRX_CLK to FSITX_CLK
- FSIRX_RX0 to FSITX_TX0
- FSIRX_RX1 to FSITX_TX1
ControlCard FSI Header GPIOs:
- GPIO_27 -> FSITX_CLK
- GPIO_26 -> FSITX_TX0
- GPIO_25 -> FSITX_TX1
- GPIO_13 -> FSIRX_CLK
- GPIO_12 -> FSIRX_RX0
- GPIO_11 -> FSIRX_RX1
Watch Variables
- dataFrameCntr Number of Data frame transfered
- error Non zero for transmit/receive data mismatch