This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Support DMA for SPI mode MibSPI in TMS570LS1227

Other Parts Discussed in Thread: HALCOGEN

In reg_spi.h created by HalCoGen 03.05.02 for SPI 1-5 (TMS570LS1227ZWT) in structure spiBASE_t there are no DMA registers: DMACTRL, DMACOUNT, DMACNTLEN:

typedef volatile struct spiBase
{
    uint32  GCR0;                 /**< 0x0000: Global Control 0 */
    uint32  GCR1;                  /**< 0x0004: Global Control 1 */    
    uint32  INT0;                  /**< 0x0008: Interrupt Register */    
    uint32  LVL;                  /**< 0x000C: Interrupt Level */
    uint32  FLG;                  /**< 0x0010: Interrupt flags */        
    uint32  PCFUN;                /**< 0x0014: Function Pin Enable */
    uint32  PCDIR;                /**< 0x0018: Pin Direction */
    uint32  PCDIN;                /**< 0x001C: Pin Input Latch */
    uint32  PCDOUT;               /**< 0x0020: Pin Output Latch */
    uint32  PCSET;                /**< 0x0024: Output Pin Set */
    uint32  PCCLR;                /**< 0x0028: Output Pin Clr */
    uint32  PCPDR;                /**< 0x002C: Open Drain Output Enable */
    uint32  PCDIS;                /**< 0x0030: Pullup/Pulldown Disable */
    uint32  PCPSL;                /**< 0x0034: Pullup/Pulldown Selection */
    uint32  DAT0;                 /**< 0x0038: Transmit Data */
    uint32  DAT1;                 /**< 0x003C: Transmit Data with Format and Chip Select */
    uint32  BUF;                  /**< 0x0040: Receive Buffer */
    uint32  EMU;                  /**< 0x0044: Emulation Receive Buffer */
    uint32  DELAY;                /**< 0x0048: Delays */
    uint32  CSDEF;                /**< 0x004C: Default Chip Select */
    uint32  FMT0;                 /**< 0x0050: Data Format 0 */
    uint32  FMT1;                 /**< 0x0054: Data Format 1 */
    uint32  FMT2;                 /**< 0x0058: Data Format 2 */
    uint32  FMT3;                 /**< 0x005C: Data Format 3 */
    uint32  INTVECT0;             /**< 0x0060: Interrupt Vector 0 */
    uint32  INTVECT1;             /**< 0x0064: Interrupt Vector 1 */
    uint32  SRSEL;                /**< 0x0068: Slew Rate Select */
    uint32  RESERVED[50U];        /**< 0x006C to 0x0130: Reserved */    
    uint32  IOLPKTSTCR;           /**< 0x0134: IO loopback */
} spiBASE_t;

In IAR ARM 6.60 simulator on tab Register SPI 2, 4 structure of registers differs from spiBASE_t since FMT. But in IAR are available DMA registers DMACTRL, DMACOUNT, DMACNTLEN

Answer please:

1)    Whether is DMA in SPI 1-5 in TMS570LS12x11? How actually looks spiBASE_t?

2)    Where it is possible to look the correct bit-by-bit description of registers SPI 1-5

  • Hi Alex,

    There are two header files: reg_mibspi.h, and reg_spi.h. The first one is for multibuffer mode, and 2nd one is for SPI compatible mode. Those DMA config registers are used for mibspi, so they are defined in reg_mibspi.h. Please refer to the following thread or related thread as reference.

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/160782/585423.aspx#585423

    You can find the TRM on ti.com. SPI and mibspi are in chapter 28.

    http://www.ti.com/lit/ug/spnu515/spnu515.pdf

    Regards,

    QJ

  • Hi QJ,

    I am confused with discrepancies in structure of registers for mode SPI in  Reference Manual TMS570LS12x/11x, HalCoGen 03.05.02, IAR ARM 6.6 and CCS 5.4 

    In 28 chapter the mode mibspi is in detail described, but about a mode spi is said a little. There is in spi a mode support DMA whether or not I have not understood.

    In HalCoGen  structure spiBASE_t differs from structure mibspiBASE_t and does not contain DMA registers, that likely means that DMA is not supported.

    In IAR ARM the structure of registers in mode SPI has the 2-d variant, differs from mibspiBASE_t but DMA registers there are, that likely means that DMA in SPI mode is. 

    The structure of registers in mode SPI in CCS 5.4, for example for SPI2 (development kit TMDX570LS12HDK) is completely similar to structure mibspiBASE_t. That likely means that DMA in SPI mode is.

     

     So is DMA in SPI mode whether or not?

  • Alex,

    MibSPI is a superset of SPI.  In fact, it starts out acting like SPI until you enable the MIB unit.

    All MibSPI registers are at offset 0x70 and above in the MibSPI address space.  So the MibSPI DMACTRL, DMACOUNT, and DMACNTLEN do not exist for SPI.   However, these are 'advanced' DMA registers that allow the length of messages on the different MibSPI channels to be configured.

    In basic SPI mode, the DMA request is simple - it's generated as the interrupt request would be based on TXEMPTY and RXFULL without any counters.   So the CPU must start/stop the transfer but the DMA can make all the data transfers in between start & stop without CPU intervention.

    In this basic SPI mode, the DMA control is set in the SPIINT0 register.  Bit 16 is DMAREQEN.  The notes in the register description explain when the DMA requests are generated.

    Best Regards,

    Anthony

  • Thanks Anthony,

    Thus dma in spi mode for mibspi1,3,5 and spi 2,4 is present, but has the limited opportunities.

    It would be useful structures of registers in spi mode in IAR ARM 6.6 and CCS 5.4 to make equally and correctly.

     Best Regards

  • Hi Alex,

    Thanks for pointing this out.  I'll see what we can do about the CCS XMLs and we'll also let IAR know.

    It probably will take a while to get the fix into CCS though;  so I'd expect to see the fix later this year.

    -Anthony