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.

CCS/TMS320F28379D: SPI CLOCK NOT SUPPORTING 50MHZ SPEED

Part Number: TMS320F28379D

Tool/software: Code Composer Studio

Hi, 

I am working on a project based on TMS320F28379D involves high-speed (up to 50-MHz) SPI data transfer. I referred  "spi_ex3_external_loopback_fifo_interrupts"  example from c2000 ware driver library.   I am able to get SPI frequency up to 6.25Mhz, even though I enabled "SPI HIGH-SPEED MODE", with correct GPIO pins.
Following is my configurations,
  • SPI pins connected are GPIO58 as SPISIMOA,  GPIO59 as SPISOMIA,  GPIO60 as SPICLKA and GPIO61 as SPISTEA.
  • SPI example used is spi_ex3_external_loopback_fifo_interrupts from driver library.
  • SPI high speed mode enabled using  SPI_enableHighSpeedMode() function from driverlib/spi.h
I tried changing "LSPCLK"  from   (DEVICE_SYSCLK_FREQ / 4)  to (DEVICE_SYSCLK_FREQ / 1) and even 
#define DEVICE_LSPCLK_FREQ          (DEVICE_SYSCLK_FREQ ), 
it is giving an error at 
"ASSERT(bitRate <= (lspclkHz ));"   driverlib/spi.c.
Is there any other configuration we need to do?
How to enable High-speed SPI?

  • Chanakya,

    I made the following changes and didn;t get any error as you reported.

    #define DEVICE_LSPCLK_FREQ          (DEVICE_SYSCLK_FREQ / 1)

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

    SPI_enableHighSpeedMode(SPIB_BASE);

    Please answer the following questions:-

    1) What is the baud rate you're trying to set?

    2) What is LSPCLK frequency you are trying to set?

    3) What is your SYSCLK frequency?

    Regards,

    Manoj

  • Hi Manoj, 

    Thanks for the immediate reply, 
     My application requires an SPI module to run at a frequency more than 50 Mhz, so the data transfer between master and slave would be faster. 

    As well I would be using SPIA  for this application.

    As you asked please  check my replies,

    1) What is the baud rate you're trying to set?

    ---  50 Mhz (50000).

    2) What is LSPCLK frequency you are trying to set?

    --- 200 Mhz (same as DEVICE_SYSCLK_FREQ).

    3) What is your SYSCLK frequency?

    --- 200Mhz

    Apart from changing LSPCLK to Higher values, is there any way to get SPI working at more than 50Mhz so that only an SPI module should get affected, rather affecting all Low-Speed Peripherals?

    as well if I want to compile a "Driverlib" separately, how I should be doing, is CCS has provision to compile driverlib separately?

     Thanks and Regards
    Chanakya

  • Chanakya,

    No, you can't run SPI module at frequency greater than 50MHz. Max SPI frequency supported on this device is only 50 MHz.

    Also, SPICLK is derived from LSPCLK. So, there is no way to achieve SPICLK = 50 MHz without setting LSPCLK = 200 MHz.

    When you compile your project you do get driverlib library file (driverlib.lib). You can include that in your project if necessary.

    Regards,

    Manoj

  • Hi Manoj,

    Thank you for your support now I am able to  run my SPI device at a frequency of 50 Mhz. I am able to achieve it by changing

     #define DEVICE_LSPCLK_FREQ          (DEVICE_SYSCLK_FREQ / 1) and 

    SysCtl_setLowSpeedClock(SYSCTL_LSPCLK_PRESCALE_4) to SysCtl_setLowSpeedClock(SYSCTL_LSPCLK_PRESCALE_1) 

    in Device_init function.

     


    Thanks,

    Chanakya Macharla