AM2612: FSI based SPI reference code

Part Number: AM2612
Other Parts Discussed in Thread: AM2634, AM263P4, C2000WARE, SYSCONFIG

Hello Champs,
 
I'm looking for an SPI Master example code that utilizes the FSI (Fast Serial Interface) peripheral.
While searching through the documentation and forums, I noticed that this specific type of example seems to be available for the F28P650. However, I have been unable to locate a similar FSI-based SPI Master example within the AM26x MCU+ SDK.
Could you please guide me on how or where I can find an FSI SPI Master example code for the AM26x series?
If a dedicated example does not exist in the current SDK, what would be the recommended approach or reference guide to port the F28x FSI SPI code over to the AM26x MCU+ SDK environment?
 
Regards,
Ted
  • Hi Ted,
    there is no dedicated FSI-SPI Master example in the AM26x MCU+ SDK at this time.

    2. FSI-SPI Compatibility Mode: Key Hardware Constraints (AM2612)

    Before porting, you must understand the hardware limitations of FSI-SPI compatibility mode on AM26x (documented in the AM261x TRM, Section 7.5.8.3.10 — sprujb6b.pdf, p.921):
    Constraint Detail
    Word size Only 16-bit supported
    Data edge Transmit on rising, receive on falling clock edge
    Chip select TXD1 acts as active-low CS (auto-driven)
    RXD1 Not used in SPI mode
    Preamble/Postamble Not transmitted; all signals return to IDLE after frame
    Master only Cannot operate as SPI peripheral — FSI TXCLK cannot accept external clock
    AM2612-specific note: The AM2612 has only 1x FSI_TX + 1x FSI_RX (versus 4x on AM2634/AM263P4), so you have only one FSI instance to convert to SPI mode.

    3. How to Port the F28x FSI-SPI Master Code to AM26x

    Since the FSI peripheral hardware is architecturally identical between F28x (C2000) and AM26x, the porting effort is primarily a software/driver API migration. Here's the recommended approach:

    Step 1: Understand the Register-Level Behavior (Common to Both Families)

    Refer to the FSI-SPI Compatibility Mode frame structure:
    SPI Word Contents
    SPI word 0 Start of Frame (1001) + Frame Type (4-bit) + 8-bit User Data
    SPI word 1 Data word 1
    SPI word 2 Data word 2
    SPI word 3 8-bit CRC + 4-bit Frame Tag + End of Frame (0110)

    Step 2: Use the AM26x MCU+ SDK FSI Driver APIs

    The AM26x MCU+ SDK provides the FSI Low-Level Driver (LLD) with full access to FSI TX registers. The key APIs you'll need:
    • FSI_TX_setExtFrameTrigger()
      /
      FSI_TX_startTransmit()
      — to initiate frame
    • FSI_TX_setTxSPIMode()
      or the equivalent SPI mode register bit in
      FSI_TX_CTRL
      (
      SPIMODE
      bit)
    • Set
      NWORDS
      for the number of 16-bit words
    • Configure
      FSI_TX_setUserDefinedData()
      for the user data byte
    • Configure CRC: use
      FSI_TX_enableTxCRC()
      for hardware CRC

    Step 3: Enable SPI Mode

    In the FSI TX control register, set the
    SPI Mode
    bit:
    // Enable FSI-SPI compatibility mode
    FSI_TX_setTxFrameType(base, FSI_FRAME_TYPE_NWORDS_DATA);
    // Set SPI mode bit (device-specific register access via DriverLib)
    HW_WR_FIELD32(base + FSI_O_TX_MAIN_CTRL, FSI_TX_MAIN_CTRL_SPI_PAIRING, 1U);
    Refer to the AM26x TRM Section 7.4.8.3.10 for the exact register field.

    Step 4: Key Porting Differences (F28x → AM26x)

    Aspect F28x (C2000) / C2000Ware AM26x MCU+ SDK
    Peripheral base address C2000 memory map AM26x memory map (see TRM)
    Driver library
    driverlib/fsi.h
    (C2000Ware)
    drivers/fsi/v1/fsi_tx.h
    (MCU+ SDK)
    Interrupt handling PIE controller VIM (Vector Interrupt Manager) via DPL
    Clock source SYSCLK HCLK/PCLK (configured via SysConfig)
    SysConfig N/A Use SysConfig to configure FSI instance, clock, and pinmux
    DMA C28x DMA EDMA (if using DMA-based transfer)

    Step 5: SysConfig Setup

    In AM26x MCU+ SDK, configure the FSI peripheral using SysConfig:
    • Select the FSI TX instance
    • Set SPI Mode = enabled
    • Configure the TX clock frequency (determines SPI SCK rate)
    • Set up pinmux for
      FSI_TX_CLK
      ,
      FSI_TXD0
      ,
      FSI_TXD1
      (TXD1 acts as CS)

    4. Reference Resources

    Resource Link
    AM261x TRM – FSI-SPI Mode (Section 7.5.8.3.10) sprujb6b.pdf, p.921
    AM263x TRM – FSI-SPI Mode (Section 7.4.8.3.10) spruj17i.pdf, p.767
    AM26x MCU+ SDK FSI Driver (AM263x) SDK API Guide
    AM26x Device Comparison (AM2612 FSI count) spradb3a.pdf

    5. Summary Recommendation

    Since no dedicated FSI-SPI Master example exists for AM26x MCU+ SDK:
    1. Start with the existing AM26x MCU+ SDK FSI TX loopback example as your code skeleton (found in
      {SDK_ROOT}/examples/drivers/fsi/fsi_loopback/
      ).
    2. Enable SPI mode by setting the SPI bit in FSI_TX_MAIN_CTRL.
    3. Port the F28x C2000Ware FSI SPI example logic — the register-level FSI behavior is identical; only the API wrapper names and system-level integration (interrupts, clocks, pinmux) differ.
    4. Use SysConfig to handle clock and pin configuration automatically instead of manual register writes used in C2000Ware.