Sample Code for CYUSBS236 (CY7C65215) Master Slave Loopback

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

cross mob
AlSt_4777661
Level 1
Level 1
First like given

Dear all,

I'm currently working on CY7C65215 i would like to know how to perform an SPI loopback (pin/jumper set up)  and if there is any example code (c++, c, python) on how to set one spi to slave and the other to master and perform loopback communication (like the UART example but without using SPI EEprom).

Thanks in advance.

Have a nice day.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Hello,

I have made a SPI test application to send data from SCB0 (SPI master) of CY7C65215 and receive it in SCB1 (SPI slave) using the available spimaster example project as a base for both master and slave.

Please find the projects in the attached zip file.

password: cypress

Testing:

1. configure CY7C65215, SCB0 as master and SCB1 as slave.

2. make the appropriate connections between the two SCBs.

3. run the SPI slave application. It will wait to receive 260 bytes of data.

4. run the SPI master application, This will write 260 bytes of incremental data on the MOSI line and will be captured on the Slave application.

SPI Master:

pastedImage_0.png

SPI slave:

pastedImage_1.png

Thanks,

Yatheesh

View solution in original post

4 Replies
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

We do not have an existing example for USB-Serial SPI master and slave implementation.

I will try to make one.

You can use the existing spimaster example from the USB-Serial SDK and alter it to communicate between two SCBs, one as master and another as slave.

SPI master application can be easily made from the existing spimaster by removing the read part and the verify part.

For SPI slave application, the configuration should be changed to make it a slave device and

    cySPIConfig.isMaster = false;

and the write part can be removed from the existing example code while keeping the read part.

Thanks,

Yatheesh

0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

I have made a SPI test application to send data from SCB0 (SPI master) of CY7C65215 and receive it in SCB1 (SPI slave) using the available spimaster example project as a base for both master and slave.

Please find the projects in the attached zip file.

password: cypress

Testing:

1. configure CY7C65215, SCB0 as master and SCB1 as slave.

2. make the appropriate connections between the two SCBs.

3. run the SPI slave application. It will wait to receive 260 bytes of data.

4. run the SPI master application, This will write 260 bytes of incremental data on the MOSI line and will be captured on the Slave application.

SPI Master:

pastedImage_0.png

SPI slave:

pastedImage_1.png

Thanks,

Yatheesh

Dear YatheeshK_36 ,

You are awesome thankyou so much!

Have a great day!

Alessandro

0 Likes

Hello,

For the SCB connections, please refer to configuration tables (sheet 6) in CYUSBS236 DVK schematic: https://www.cypress.com/file/123486/download

On the DVK you can connect pin 2 of

J17-> J24

J19-> J26

J21-> J27

J20-> J25

Thanks,

Yatheesh

0 Likes