cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4

Dave_Long
New Contributor II

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

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

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