The SCB SPI mode CLK signal sometimes a clock is lost

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Dave_Long
Level 3
Level 3
10 replies posted 10 questions asked 10 sign-ins

Hi:

     I use the SCB SPI mode ,however the CLK signal sometimes a clock is lost.Shoe as the follow picture:

     pastedImage_0.png

       I used the follow fuction to sent the data:

pastedImage_1.png

   Is anyone can help me ?

0 Likes
1 Solution
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

Does the PSoC act as master? If yes, why don't you use the API we offers to do the test.

1: Start transfer:

  SPIM_SpiUartPutArray(mTxBuffer, PACKET_SIZE);

2:

    /* Wait for the end of the transfer. The number of transmitted data

    * elements has to be equal to the number of received data elements.

    */

   while(PACKET_SIZE != SPIM_SpiUartGetRxBufferSize())

    {

    }

3:

    /* Clear dummy bytes from RX buffer */

    SPIM_SpiUartClearRxBuffer();

If we act as the slave, please check the master, because the clock is offered by the master.

View solution in original post

0 Likes
1 Reply
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

Does the PSoC act as master? If yes, why don't you use the API we offers to do the test.

1: Start transfer:

  SPIM_SpiUartPutArray(mTxBuffer, PACKET_SIZE);

2:

    /* Wait for the end of the transfer. The number of transmitted data

    * elements has to be equal to the number of received data elements.

    */

   while(PACKET_SIZE != SPIM_SpiUartGetRxBufferSize())

    {

    }

3:

    /* Clear dummy bytes from RX buffer */

    SPIM_SpiUartClearRxBuffer();

If we act as the slave, please check the master, because the clock is offered by the master.

0 Likes