SPI Master communication with SPI Slave

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
soumajit
Posts: 12
Joined: Thu Feb 03, 2011 3:26 am

SPI Master communication with SPI Slave

Post by soumajit »

Hello,

I have two SUB-20 devices, and two different programs controlling them. One configured as SPI Master with the following configuration

"sub_spi_config(fd, SPI_ENABLE|SPI_CPOL_RISE|SPI_SMPL_SETUP|SPI_MSB_FIRST|SPI_CLK_4MHZ,0)"

and the other SUB-20 device as SPI Slave FIFO configured as

"rc = sub_spi_config(fd, SPI_ENABLE|SPI_SLAVE|SPI_CPOL_RISE|SPI_SETUP_SMPL|SPI_LSB_FIRST|SPI_CLK_4MHZ, 0 )"

"sub_fifo_config(fd, FIFO_SELECT_SPI)"
.

The SPI Master writes 1 byte data using sub_spi_transfer function and the SPI Slave must read the data using the sub_fifo_read function. But the SPI slave fails reading any data and shows BULK READ FAILED.

Can anyone say how to make this communication happen between the two devices successfully. I am using Ubuntu 10.10 and libusb-1.0.
It's urgent. :)

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: SPI Master communication with SPI Slave

Post by xol »

What parameters do you provide to sub_fifo_read and what is the failure code?

Post Reply