• Resolved

66AK2H14: Problems with SPI Clock

Genius 5115 points

Replies: 5

Views: 134

Part Number: 66AK2H14

Hello, I'm trying to develop a simple, baremetal SPI example program using the 66AKH14 processor. The trouble I am seeing is the data is not correct and the clock has non-uniform pulse widths.

The SPI clock should be 6Mhz and for 16-bit data the total time should be about 2.7us and it but the pulse widths are not the same. I'm expecting the same pulse width, am I correct? Also, the first word I am sending out is 0xA but I don't see that on the MOSI pin.

Any ideas what I may be doing wrong?

Here is my code:

SPI_Example.zip

I'm running the code on DSP Core 0 and using SPI Channel 0.

Thank you very much,

Joe

  • I decreased the frequency of the SPI clock to 1Mhz and the clock is looking much better. Now I need to figure out why the data is not looking correct.

    Here is what I'm transmitting:

    Here is what the SPI signals look:

    I'm doing 5 SPI writes and that is what the scope shows. The data on the MOSI does not look like what is in the TXBUF. So I'm looking into that problem.

  • In reply to joe306:

    Hi,

    From the memory browser of CCS, could you dump the SPI register values and share them?

    Thanks,
    Yordan

     


     Please make sure you read the forum guidelines first.

  • In reply to Yordan Kovachev:

    Hello, thanks for helping me solve this SPI data problem. Here is a screen shot of the SPI registers:

    Here is the Memory Save text file starting at the 0x0082BD80.

    SPI.dat

    Thank you very much,

    Joe

  • In reply to joe306:

    Hello, I changed the SPI Data width to 8 instead of 16 and I also modified my SPI_SendReceiver() to send the data in the txBuff array. I was sending over a count. Also my Salea Logic analyzer was not setup right. With those changes I got things working.

    Here is my txBuf data:

    Here is my code:

    SPI_Example_Baremetal_CH0.zip

    Thank you everyone for helping me along the way.

    I'm interfacing with a Cypress PSOC5 microcontroller to the 66AK2H14 processor. Now I need to get the PSOC to send back the correct data.

    Respectfully,

    Joe

  • In reply to joe306:

    Thanks for updating the thread.

    Best Regards,
    Yordan

     


     Please make sure you read the forum guidelines first.