- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
I'm using WICED_SPI_2 in cyw54907 but got unexpected issues that:
my external SPI slave transfer 8 byte
{0x01, 0x02, 0x03...,0x08}
but cyw54907 received 8 byte:
{0x81, 0x02, 0x03, 0x04, 0xFF, 0xFF, 0xFF, 0xFF}
And in the external SPI slave side i got event that only transfer 4 byte data
This is my setup in cyw54907:
init
spi_device.bits = 8;
spi_device.port = WICED_SPI_2;
spi_device.speed = 1000000; //1Mhz
spi_device.mode = (SPI_CLOCK_RISING_EDGE | SPI_CLOCK_IDLE_LOW| SPI_MSB_FIRST);
auto result = wiced_spi_init(&spi_device);
received data
wiced_spi_message_segment_t message;
memset(&message, 0, sizeof message);
message.rx_buffer = data;
message.tx_buffer = 0;
message.length = len;
if (wiced_spi_transfer(&spi_device, &message, 1) != WICED_SUCCESS) {
return 1;
}
Solved! Go to Solution.
- Labels:
-
WICED Studio Wi-Fi Combo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
spi_device.bits = 8;
spi_device.port = WICED_SPI_2;
spi_device.speed = 1000000; //1Mhz
spi_device.chip_select = WICED_GPIO_NONE;
spi_device.mode = (SPI_CLOCK_RISING_EDGE | SPI_CLOCK_IDLE_LOW| SPI_MSB_FIRST);
auto result = wiced_spi_init(&spi_device);
This WICED_GPIO_NONE save my day 😄
spi_device.chip_select = WICED_GPIO_NONE;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I change my set up to WICED_SPI_1 and received full data from external SPI slave
spi_device.bits = 8;
spi_device.port = WICED_SPI_1;
spi_device.speed = 1000000; //1Mhz
spi_device.chip_select = WICED_GPIO_22;
spi_device.mode = (SPI_CLOCK_RISING_EDGE | SPI_CLOCK_IDLE_LOW| SPI_MSB_FIRST);
auto result = wiced_spi_init(&spi_device);
So it's mean that my external SPI slave is not wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Do you mean, by using WICED_GPIO_1 you are able to receive the entire data (0x01, 0x02...0x08) correctly?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reply sir,
I change my setup from WICED_SPI_2 to WICED_SPI_1 and received the entire data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
That sounds good!
But I don't see you have used spi_device.chip_select = WICED_GPIO_41 for WICED_SPI_2.
Can you please try that and confirm once?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change SPI port from WICED_SPI_2 to WICED_SPI_1 is just a way to test my external SPI,
i want to resolve the problem with the WICED_SPI_2 because my schematic using this SPI port.
Btw, if i set spi_device.chip_select = WICED_GPIO_41
wiced_spi_init will return error. So i think that the WICED_SPI_2 use some default configs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
spi_device.bits = 8;
spi_device.port = WICED_SPI_2;
spi_device.speed = 1000000; //1Mhz
spi_device.chip_select = WICED_GPIO_NONE;
spi_device.mode = (SPI_CLOCK_RISING_EDGE | SPI_CLOCK_IDLE_LOW| SPI_MSB_FIRST);
auto result = wiced_spi_init(&spi_device);
This WICED_GPIO_NONE save my day 😄
spi_device.chip_select = WICED_GPIO_NONE;