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.

  • TI Thinks Resolved

TMS320C6748: TMS320C6748: SPI SOMI output has a negtive pulse on the last bit of one byte, which makes data error sometimes.

Part Number: TMS320C6748

In my system, I use a MCU to communicate with C6748 throught SPI bus. The MCU is SPI Master, and the C6748 is SPI Slave.

The SPI_CLK is 10MHz, POLARITY = 0 and PHASE = 1.

I use C6748 EDMA to drive the SPI SOMI output.

For test, I let the C6748 to output 0xF1F2F3F4F5F6F7

For SPI_CLK= 4MHz, the read data is always right, which is 0xF1F2F3F4F5F6F7.

For SPI_CLK=10MHz, the read data is sometimes right, but sometimes wrong.

The wrong data is:

Read: 0xF1727374757677

Read: 0xF17273F4757677

Read: 0xF1F273F475F677

Read: 0xF1727374F5F677

.......

At first, I thought maybe the POLARITY and PHASE maybe wrong at the two end. But I've checked that they are alright.

And if the POLARITY and PHASE is wrong, the result should be one bit shift.

But you  can see that, the wrong bit always happens to be the 1st bit of a whole byte!

The waveform tells the truth:

This is a waveform between 0xF3 and 0xF4, there is a negtive pulse between the two bytes.

I think this is why my readata is wrong.

Question: Why there is a negtive pulse between the two bytes?

  • Hi,

    Can you post the SPI registers values?

    Best Regards,
    Yordan

     


     Please make sure you read the forum guidelines first.

  • In reply to Yordan Kovachev:

    Hi Yordan,

           Thank you very much for reply.

           Here is the SPI0 registers:

  • In reply to FrankXu:

    These seem correct. What board are you using: a custom board or the LCDK?
    Also which SDK version?
    We can try to reproduce the issue on our side.

    Best Regards,
    Yordan

     


     Please make sure you read the forum guidelines first.

  • In reply to Yordan Kovachev:

    Can you try running the TI RTOS SPI example and see if the problem exist? If not, then you can compare the code against your application and see where your code breaks.

    Best Regards,
    Yordan

     


     Please make sure you read the forum guidelines first.

  • In reply to Yordan Kovachev:

    Thank you very much for reply.
    I used the stareware SPI example. Where is the TI RTOS SPI example? I didn't find the example in the \SYSBIOS\Application directory.
    And, by the way, the negtive pulse between the two bytes is only about 20ns. I don't think it is because of any code break.
    Anyway, I will try the TI RTOS SPI example first.
  • In reply to FrankXu:

    Here is the RTOS download link:
    www.ti.com/.../processor-sdk-c6748

    Best Regards,
    Yordan

     


     Please make sure you read the forum guidelines first.

  • In reply to Yordan Kovachev:

    I mean I had installed the RTOS, but I don't know which example I should take.
    I used the ti\C6748_StarterWare_1_20_04_01\examples\evmC6748\spi example.
    Which example do you suggest? In which directory do you mean is the TI RTOS SPI example?
  • In reply to FrankXu:

    ykovachev@lin-0373:~/ti/pdk_omapl138_1_0_3/packages$ gedit pdkProjectCreate.sh
    ykovachev@lin-0373:~/ti/pdk_omapl138_1_0_3/packages$ ./pdkProjectCreate.sh OMAPL138 all little spi all dsp

    The above commands create folder ~/ti/pdk_omapl138_1_0_3/packages/MyExampleProjects, which contains the spi example project, called
    SPI_LoopbackExample_lcdkOMAPL138_c674xExampleProject

    After you've created the project you can open CCS, import the project, build it and load & execute it on your LCDK.

    Best Regards,
    Yordan

     


     Please make sure you read the forum guidelines first.

  • In reply to Yordan Kovachev:

    Hi Yordan Kovachev,

    Thank you very much.
    I've tried the SPI_LoopbackExample_lcdkOMAPL138_c674xExampleProjec.
    If I comment the line "SPI_control(hwHandle,SPI_V0_CMD_LOOPBACK,(void *) &loop);" which means do not use the interl loop test mode,

    and change the "TEST_SPI_PORT" to "1", I can see the SPI_CLK waveform on the SPI1_CLK pin.
    But if the "TEST_SPI_PORT" is "0", the SPI_CLK waveform is always high on the SPI0_CLK pin.
    Nothing esle changed on the code.
    I've taken a lot time looking through the example code, but havn't find the cause of the problem.

    Why the code does not work for SPI0? Could you please help.

  • In reply to FrankXu:

    And I tried to modify the example to be a Slave example with DMA. But faced some new problems. The documents:
    API_Documentation.html
    ReleaseNotes_SPI_LLD.pdf
    SPI_LLD_SoftwareManifest.html
    are all the documents I have, but I find it difficult to use the APIs correctly.
    Is there any more examples for SPI Slave with DMA?

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.