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: CCS/TMS320F28379D

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hello good time.


  What is the way to get the CPU frequency as defined below?


#define CPU_RATE 5.00L // for a 200MHz CPU clock speed (SYSCLKOUT)

How did this number (5.00L) come about ??

  • Saeed,

    CPU_RATE is the device cycle time in nanoseconds.  See the file F2837xD_Examples.h in C2000Ware, folder C:\ti\c2000\C2000Ware_x_xx_xx_xx\device_support\f2837xd\common\include

    -----------------------------------------

    //
    // Specify the clock rate of the CPU (SYSCLKOUT) in nS.
    //

    // Take into account the input clock frequency and the PLL multiplier
    // selected in step 1.
    //
    // Use one of the values provided, or define your own.
    // The trailing L is required tells the compiler to treat
    // the number as a 64-bit value.
    //
    // Only one statement should be uncommented.
    //
    // Example: 200 MHz devices:
    // CLKIN is a 10 MHz crystal or internal 10 MHz oscillator
    //
    // In step 1 the user specified the PLL multiplier = 40 for a
    // 200 MHz CPU clock (SYSCLKOUT = 200 MHz).
    //
    // In this case, the CPU_RATE will be 5.000L
    // Uncomment the line: #define CPU_RATE 5.000L
    //

    #define CPU_RATE 5.00L // for a 200MHz CPU clock speed (SYSCLKOUT)
    //#define CPU_RATE 5.263L // for a 190MHz CPU clock speed (SYSCLKOUT)
    //#define CPU_RATE 5.556L // for a 180MHz CPU clock speed (SYSCLKOUT)
    //#define CPU_RATE 5.882L // for a 170MHz CPU clock speed (SYSCLKOUT)
    //#define CPU_RATE 6.250L // for a 160MHz CPU clock speed (SYSCLKOUT)
    //#define CPU_RATE 6.667L // for a 150MHz CPU clock speed (SYSCLKOUT)
    //#define CPU_RATE 7.143L // for a 140MHz CPU clock speed (SYSCLKOUT)
    //#define CPU_RATE 7.692L // for a 130MHz CPU clock speed (SYSCLKOUT)
    //#define CPU_RATE 8.333L // for a 120MHz CPU clock speed (SYSCLKOUT)

    -----------------------------------------

    Regards,

    David

  • How are these numbers obtained ??

    5.00L

    5.263L

    5.556L

    5.882L

    6.250L

    6.667L

    7.143L

    7.692L

    8.333L

    Has a specific pattern ??

  • Saeed,

    Period = 1/frequency

    For example: f=200 MHz

        Period = 1/(200 MHz) = 5E-9 seconds = 5.00 nanoseconds.

    Regards,

    David

  • Thankful
    Just a question of CPU frequency by default 500k Is it possible to change it too ??

    As in the example below

    // SPI CLK freq = 500 kHz
    // LSPCLK freq  = CPU freq / 4  (by default)
    // BRR          = (LSPCLK freq / SPI CLK freq) - 1


    #if CPU_FRQ_200MHZ
    #define SPI_BRR        ((200E6 / 4) / 500E3) - 1
    #endif

  • Saeed,

    I'm not exactly sure what is being asked, the comments in the code examples are based on setting up the device to the 200MHz max clock rate.

    From there the LSPCLK will divide this down for the periperhals in that domain(likie the SPI) on page 115 in this document http://www.ti.com/lit/spruhm8 

    Best,
    Matthew