PSOC4 UDB SPI Slave Continuous Transfer

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

cross mob
lock attach
Attachments are accessible only for community members.
WaSI_2022226
Level 1
Level 1

Hi All,

I'm using Cy8CKIT-049 with CY8C4245-AXI.

I'm trying to do continuous transfers with a UDB SPI 16bit Slave clocked from an external 4MHz clock. The TX buffer is 6 words wide. The transfer should be (0xAABBCCAABBCC.............AABBCC),but the I'm getting only AABBCC  and the orther bytes  are junk. I'm really can't guess what is going wrong on my code.

Please help me.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

In your application, you please add the following line also before filling the buffers for the second time:

/* We need to know the moment when SPI communication is complete

    * to display received data. SPIS_SPI_DONE status should be polled.

    */

    while(!(SPIS_ReadTxStatus() & SPIS_STS_SPI_DONE));

Also, in the SPI component select the clock selection tab as "External".

Please find the attached code examples for UDB based SPI slave. The attached code examples are basically for PSoC 5LP device but the UDB SPI component will be same in both PSoC 5 and PSoC 4 devices. You can compare your configuration with the attached code examples and check once.

If still you are getting the issue, please update.

Thanks

Ganesh

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

In your application, you please add the following line also before filling the buffers for the second time:

/* We need to know the moment when SPI communication is complete

    * to display received data. SPIS_SPI_DONE status should be polled.

    */

    while(!(SPIS_ReadTxStatus() & SPIS_STS_SPI_DONE));

Also, in the SPI component select the clock selection tab as "External".

Please find the attached code examples for UDB based SPI slave. The attached code examples are basically for PSoC 5LP device but the UDB SPI component will be same in both PSoC 5 and PSoC 4 devices. You can compare your configuration with the attached code examples and check once.

If still you are getting the issue, please update.

Thanks

Ganesh

0 Likes