cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

AlSt_4777661
New Contributor

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
YatheeshD_36
Moderator
Moderator

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

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
YatheeshD_36
Moderator
Moderator

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

AlSt_4777661
New Contributor

Dear YatheeshK_36 ,

You are awesome thankyou so much!

Have a great day!

Alessandro

0 Likes
YatheeshD_36
Moderator
Moderator

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