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.

TMS320C28346 SPI Clock

Other Parts Discussed in Thread: TMS320C28346, ADS1278

Hi there!

I am using a Delfino TMS320C28346 on the C28346 Control Card including the DIMM 168 docking station. I need to configure the SPIA on the microcontroller and I am having some troubles.

Since there is an external oscillator attached to the EVM with a 20MHz clock i am using the PLL to get a SYSCLK of 300MHz:

PLLCR = 0x001D for multiplication of 20Mhz by 30 with get's me a OSCCLK of 600MHz

PLLSTS = 0x0101 for dividing OSCCLK by 2 to get a 300MHz SYSCLK

Since the SPICLK uses the LSPCLK the register LOSPCP is set to 0x0002 (default) to divide by 4. This get's a LSPCLK of 75MHz.

The SPIBRR (which in fact get's me the wanted SPICLK) is set to 0x007F, dividing the LSPCLK by 128. This should result in a SPICLK of 585937.5 Hz (almost 600kHz).

The osciloscope however shows a frequency of around 80-84kHz.

Am I missing something in the calculation? What do i need to set to get a SPICLK of 50MHz?

Thank you very much in advance!

-Johannes

  • Hi!

    I am still facing that problem - is there anybody who can help me, please?

    Thank you very much!

    -Johannes

  • Johannes,

    Your assumptions on the EVM, PLL settings, LSPCLK, and SPIBRR seem accurate.  I don't believe anything is missing.

    Two things I would check on:
    1) Make sure that the registers are what you think they are by using the CCS watch window.
    2) Check XCLKOUT.  According to the 168-pin C28346 cCARD schematics this signal should go down to the baseboard.  By default it should show SYSCLK divided by eight.  This may help us determine if the issue is with the SPI/LSPCLK or with SYSCLK.


    Thank you,
    Brett

  • Hey Brett!

    Thank you very much for your response! I figured out what went wrong. Since this is pretty new for me, I forgot to initalize the peripheral clocks. Now it's working just fine!

    Another question that came up:

    The system I am working with also includes the ADS1278-EVM. I am using the board without the MMB0 - the communication should be done between the Delfino and the ADS1278. I am trying to synchronize both SPIs, the Delfino is working as master.

    To synchronize both I am trying to read the DRDY of the ADS by a GPIO of my DSP. Is it possible to use (for instance) GPIO53 or do I need to choose one of the XINT channels?

    If so, what would a routine look like?

    Thank you very much in advance!

    Johannes

  • Johannes,

    I took a quick look at this, but didn't dig too deep into the details.

    Based on my understanding, I would use an XINT or TZ input to service your DRDY signal.  This input would then fire an interrupt where you'll have the C2834x start transmitting clks via SPI.


    Thank you,
    Brett

  • Brett,

    Thank's a lot! Probably I am going with the XINT4 to start a service routine!

    Thank you,

    Johannes