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.

TMS320F280049: SPI bitrate over 10Mhz

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE

Hi,

In C2000Ware_1_00_06_00 f280049 driverlib example, spi_ex5_external_loopback_fifo_interrupts.c ,

If  SPI_setConfig() set over 10Mhz SPICLK ,the program always go to ASSERT error (ESTOP0) .

The example with 500KHz and  5Mhz SPICLK  is OK.

Any suggestion?

thanks,

best regards,

Simen

  • Hi Simen,

    The maximum allowed SPI baud rate = LSPCLK/128 where LSPCLK is Low-speed peripheral clock frequency of the device

    This is the formula for baud rate calculation:

    SPI baud rate = LSPCLK/(SPIBRR + 1)
    where SPIBRR is a 7 bit register => maximum value = 127

    Regards,
    Veena
  • Veena,

    Could you help to find out the bug with  TI example code SPI_setConfig() function?

    You can try   spi_ex5_external_loopback_fifo_interrupts.c,

    And modify

    SPI_setConfig(SPIB_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA0, SPI_MODE_MASTER, 500000, 16);

    to

    SPI_setConfig(SPIB_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA0, SPI_MODE_MASTER, 10000000, 16);

    thanks,

    best regards,

    Simen

  • HI SImen,

    I am sorry that my previous reply was incorrect. LSPCLK./128 is the 'minimum' baud rate allowed and the maximum allowed baud rate LSPCLK/4.

    For SPIBRR = 3 to 127: SPI Baud Rate = LSPCLK / (SPIBRR + 1)
    For SPIBRR = 0, 1, or 2: SPI Baud Rate = LSPCLK / 4

    If you are using the default clock configuration, the LSPCLK is 25MHz an dthe maximum allowed SPI baud rate = 25/4 = 6.25MHz

    Regards,

    Veena

  • Veena,


    Thanks for your suggestion.
    I have modified LSPCLK as device frequency, (#define DEVICE_LSPCLK_FREQ (DEVICE_SYSCLK_FREQ ))
    Then SPICLK can over 10MHz.


    best regards,
    Simen
  • Hi Simen,

    Make sure that you have updated the LSPCLK divider in the clock configuration code (usually done as part of Device_init)

    Regards,
    Veena