SPRUI33H November 2015 – June 2024 TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1
FILE: fsi_ex11_spifsi_full_duplex.c
FSI supports SPI compatibility mode to talk to the devices not having FSI but SPI module. API to decode FSI frame received at SPI end is implemented and checks are made to ensure received details(frame tag/type, userdata, data) match with transfered frame.
This program is the FSI part of SPI-to-FSI communication. It enables both TX and RX module in SPI-mode for full functionality of SPI-master. Then it sends Ping frame with tag 0 to request a flush sequence from SPI. After getting flush sequence, it sends Ping frame with tag 1, 1_WORD frame, 2_WORD frame, N_WORD frame with 3 words, 4_WORD frame, N_WORD frame with 5 words, 6_WORD frame, N_WORD frame with 7 words and so on in duplicate manner. To enable echo-functionality with FSI and SPI RX/TX FIFO, we need to prime SPI- side's TX FIFO to stage the frame by sending two identical frames in succession, so FSI gets the previously staged frame when FSI transmits the same frame for the second time. It is because SPI-slave is driven by SPI-master, FSI-master in this case; SPI-slave will only talk back to FSI when FSI is talking to SPI.
To enable full functional duplex of SPI-to-FSI, you must load fsi_ex11_spifsi_full_duplex to f28004x device and spi_ex4_spifsi_full_duplex to any device that has SPI module. You must run SPI-side before FSI-side.
If there are any comparison failures during transfers or any of error event occurs, execution will stop.
External Connections
Number in parenthesis indicates a pin number on docking station. GPIOs on controlCARD. f28004x_FSITX f2837x_SPIA f28004x_FSIRX -TXCLK, GPIO7(56) -> SPICLK, GPIO18(71) -TXD0, GPIO6(54) -> SPISIMO, GPIO16(67) -TXD1, GPIO5(52) -> ~SPISTE, GPIO19(73) -SPISOMI, GPIO17(69) -> RXD0, GPIO12(57)
Watch Variables