PSOC 5LP - SPI Slave Block Mis-Interpreting Data

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.
Anonymous
Not applicable

All,

   

 

   

I am having some trouble using the SPI Slave UDB in my latest project. We are using two PSoC 5LP devices to communicate with one another via SPI. Both of the SPI Blocks are on mode (2 I believe, CPHA =1 CPOL = 0). I have verified that the data that I am attempting to send is correct on my oscilloscope, but my SPI slave block is not reading/interpreting this data correctly. It will sometimes work correctly and the data is correct, but most if not always the data is shifted by bit and that disrupts my message formatting.

   

I have attached the screenshot from the oscilloscope to this forum post as well as a recent and working copy of the project.

   

1- SCLK

   

2- MISO

   

3- MOSI

   

4- SS

   

The messages that are intending to be sent are: 0xAA 'S' '3' 0x55 0x55 0x55 0x55 0x55 0x00

   

0xAA 'P' 'B' '?' 0x55 0x55 0x55 0x55 0x00 0x00

   

 

   

 

   

Please let me know if there is anything you recommend me to do.

 

0 Likes
2 Replies
Anonymous
Not applicable

Bump.

   

 

   

Anyone have any thoughts???? Pretty sure that the PSoC's SPI Block is the issue here....

0 Likes
Anonymous
Not applicable

Setting the SPI Mode to CPHA =1 CPOL = 1 seems to have fixed everything. The communication is sync'd and snappy once again.

0 Likes