CYW943907A invert bit order SPI

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

cross mob
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

Hello.

I want to send byte stream on SPI.

I have to use SPI in a way where LSB (less significan bit) is transmitted before MSB (most significant bit).

 

I set SPI_LSB_FIRST but no results ... 

 

spi_config_fpga.port = WICED_SPI_2;
spi_config_fpga.chip_select = WICED_GPIO_NONE; /* CS gestiti via SW */
spi_config_fpga.speed = 1e6; /* Massimo 40MHz, 25ns Hold Time */
spi_config_fpga.mode = SPI_CLOCK_RISING_EDGE | SPI_CLOCK_IDLE_HIGH | SPI_NO_DMA | SPI_LSB_FIRST | SPI_CS_ACTIVE_LOW; /* see Document Number 002-14829 Rev. *K page 22 */
spi_config_fpga.bits = 8;

/* init 'spi_config_fpga' spi */

status = wiced_spi_init ( &spi_config_fpga );

0 Likes
2 Replies
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

Can you share your complete application code with us? Is data transfer happening at all? Can you share the terminal logs that you get when the application runs? I am not sure what do you mean by this -- I set SPI_LSB_FIRST but no results ...., is data transfer not happening at all or LSB bit isn't getting transmitted first?

Thanks

Aditi

0 Likes
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

Data is transferred but,

for example,

if  I want to transfer byte 0xBA that is 10111010 in binary

I want that SPI put out bits in this way 01011101 ( = LSBit first) and not 10111010 (MSBit first)

 

 

0 Likes