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.

TMS320F28021: TMS320F28021

Part Number: TMS320F28021


Hi Experts,

I'd like to confirm that if the SPI speed of F28021 could be slowly down to 2KHz?

Wish for your support!

Thanks!

Best Regards/Rayna

  • Hi Rayna,

    This is a pretty simple math problem based on the configured SYSCLK. Please see the SPI section in the shiny new PiccoloA TRM - http://www.ti.com/lit/sprui09 See the Baud Rate Selection section for the formula.

    To reach 2 KHz SPICLK while keeping SYSCLK as fast as possible:

    • SYSCLK =  35.84MHz
    • LSPCLK = SYSCLK/14 = 2.56KHz
    • SPIBRR = 127

    If SYSCLK is lower, you would have more options, but I am not going to calculate all of that out here.

    -Mark

  • Hi Mark,

    SYSCLK =  35.84MHz

    LSPCLK = SYSCLK/14 = 2.56MHz

    SPIBRR = 127

    SPI speed should be 35.84MHz / 14 / 127 =  20.15 KHz?

    It's not 2 KHz, Am I right?

    If I want to obtain 2KHz SPI speed when SYSCLK is 40MHz, how to achieve that? Thanks.

  • Daniel,

    You are correct, I must have been in a hurry typing out my last post.
    LSPCLK would be 2.56MHz and as such the SPICLK would be 20KHz.

    If SYSCLK is 40MHz you CANNOT achieve 2KHz SPCLK. You must reduce SYSCLK. Based on the very simple calculation, The fastest SYSCLK possible to achieve 2KHz is actualy 3.556MHz. (2KHz*127*14). SYSCLK can be slower, but no faster.

    If you do need such low speed SPI, you are probably going to need to emulate SPI with GPIO, it will be more CPU cycles to do so, but at such low speeds it would allow you to run SYSCLK at 60MHz and oversample the GPIOs without much issue.

    Regards,
    Mark