spi receive

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

cross mob
chsh_4442971
Level 1
Level 1
First like received

Hi Friends,

I've CY8CKIT-042 Pioneer Kit, I tried to interface RFID Reader RC522 via SPI.

In this, I need to configure my PSoC 4 as an SPI Master Receiver, I tried by modifying the demo example code, SCB_SpiCommMaster, but I didn't succeed.

Can anyone help by giving me a way where I can get a video or demo example code for PSoC 4 as an SPI Master Receiver?

Chinmay

0 Likes
1 Solution
TaeY_56
Employee
Employee

Hi,

I think the code example is the proper one for you, but you need to find another SPI master code example, please follows the below steps.

1) Open your 'PSoC Creator' (I am using 4.2 version)

2) Click 'File' -> 'Code Example'

3) Search 'SPI' as shown in the attached below image.

Find Code Example window.PNG

Thank you,

Teddy.

View solution in original post

0 Likes
5 Replies
TaeY_56
Employee
Employee

Hi,

I think the code example is the proper one for you, but you need to find another SPI master code example, please follows the below steps.

1) Open your 'PSoC Creator' (I am using 4.2 version)

2) Click 'File' -> 'Code Example'

3) Search 'SPI' as shown in the attached below image.

Find Code Example window.PNG

Thank you,

Teddy.

0 Likes

Hi Teddyy,

Thanks! Your sugestion works

But, still I didn't get correct value of Slave data, always I got 0x000000FF or dummy byte sent to receive data from salve.

One more thing I surprised is that, if I connect SalveSel pin and map it appropriately, then I didn't receive any byte on MISO, but If I select Slave Device = 0, then only this works.

FYI: I've connected RC522 (RFID Reader) via SPI, as I move RFID tag close to reader, I either receive 0x000000FF or dummy byte I sent!

I used UART to display byte I received from slave.

Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi chsh_4442971

Please share the project and the pin connection details so that we can reproduce the issue that you are facing.

Also can you please explain this statement 'If I select Slave Device = 0, then only this works'.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes

Hi Rakshith,

If I configure Slave Device  = 00, then only I get the response byte (of course false byte!).

If I configure Slave Select pin  = 1 and then map it to the appropriate line, then nothing I received as a response byte.

But, I need to study the query-response cycle of RC522 that I need to interface with PSoC 4.

Let me give some time, I'll further update you if I shall face the issue again.

Thanks for the support!

-Chinmay

0 Likes

Hi chsh_4442971

Sure, let us know if you need any help. You can also refer to these threads on RC522 which might help you with your issue -

https://community.cypress.com/thread/34607

https://community.cypress.com/thread/29840

Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes