Why SPI is giving wierd behavior?

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

Hello Every one,

   

I am trying to communicate my PSOC chip 5LP (LP035) with Raspberry Pi.

   

PSOC is acting as slave and Pi is a Master.

   

Between the communication I set up a mask that is responsible for giving back the required channel value to the master (Pi).

   

My code was working properly but now it start behaving different (I have not change any thing!) .

   

It only works correct when master send a mask value either 1 or 3.

   

I dont understand where the problem is laying.

   

I will be very thankful to you If any body can help me in it!

   

Looking forward to hearing from you!

   

Regards

0 Likes
2 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

 Can use "if(!(SPIS_ReadRxStatus() & SPIS_STS_RX_FIFO_NOT_EMPTY))" instead of  "if(SPIS_GetRxBufferSize())"

0 Likes
Anonymous
Not applicable

Thank you ANKS for your reply.

   

I tried that thing but i am still getting garbage values.

   

Do i need to slow down the clock?

0 Likes