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

cross mob

SPI example for CYW20706

lock attach
Attachments are accessible only for community members.

SPI example for CYW20706

AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

This application demonstrates how to use SPI driver interface on CYW20706 to send and receive bytes or a stream of bytes over the SPI.

Hardware connections on CYW20706 EVAL:

For SPI Slave use the below pins :

  •   CS   - P26
  • MOSI - P27
  • MISO - P25
  • CLK  - P36

For SPI Master use the below pins :

  •   CS   - P26
  • MOSI - P0
  • MISO - P25
  • CLK  - P36

Test Procedure:

  • Program 1 kit with the spi_master app and another kit with spi_slave app (attached the project).
  • Connect the SPI lines and ground on the 2 kits.
  • Power on the kits. You can see the logs through PUART
  • Reset the SPI master first and then SPI slave.
Attachments
1596 Views
Comments
guta_2945091
Level 2
Level 2
10 replies posted 5 replies posted 5 questions asked

有几个问题请教一下:

1.您使用的WICED是什么版本?我有很多API与您的不相同

2.您SPI Master Demo中#define MASTER1_P36_CLK_P00_MOSI_P25_MISO  0x00240019  

“0x00240019 ”是如何得到的?

3..您SPI Master Demo中使用的GPIO为P36\P00\P25\P26吗??与您Blog中介绍的不符??请问实际使用的GPIO为哪个?

AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi,

1. I am using WICED SDK 6.2

2. available pin combinations are in spiffydriver.h

   The value can be find out as below

MASTER -  0x[00][hex of clock pin (eg: 24(hex of 36) for P36 )][hex of mosi pin][hex of miso pin]

SLAVE1_P36_CS_P24_CLK_P27_MOSI_P25_MISO 0x[hex of CS pin number][hex of clock pin ][hex of mosi pin][hex of miso pin]

3. Couldn't able to understand your query.

Thanks,
Anjana

Leo_liu1
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Hi Anjana,

I am using WICED SDK 6.2,copy your code and config pins follow you。

But logs through PUART  always are [Rx]Sent start byte。

Follow code,it can't pass if(ACK_ID == rec_byte[0]),do you have some suggestion to check it?

Thanks,

Leo

AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Can you please try by P33 switch position in OFF on PUART SELECT SW5 ?

Please try reset both devices (first master and then slave) and try.

guta_2945091
Level 2
Level 2
10 replies posted 5 replies posted 5 questions asked

3.The Hal_spi_master.c is    #define MASTER1_P36_CLK_P00_MOSI_P25_MISO  0x00240019.but Your introduction

For SPI Master use the below pins :

  •   CS   - P26
  • MOSI - P27
  • MISO - P25
  • CLK  - P36
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi,

Sorry , it was a mistake from my side. Modified the intro.

Sorry for the inconvenience.

Regards,
Anjana

guta_2945091
Level 2
Level 2
10 replies posted 5 replies posted 5 questions asked

Thank you for your support.

Laku_4525401
Level 0
Level 0

HI,

     Am a new to cypress micro controller, and working with ADXL345 accelerometer sensor need to integrate  with MCU that is CY8C4147AZI-445S. Can anyone please help me interface?