76
Discussion - Hardware / Re: SPI Slave
« on: March 07, 2023, 04:33:07 PM »
Hello,
If you use FT4222_SPISlave_Write() to write SPI slave data it will append 0x00 in every time the API FT4222_SPISlave_Write() is called.
You can also try to replace FT4222_SPISlave_Write() with FT_Write() as it does not append 0x00 at the beginning.
There are only two USB FIFOs to store the data from PC Host and each FIFO is 512 bytes (but status bytes occupy 2 bytes).
When the API FT_Write() is called, it will send a bulk transfer.
If the transfer size is <512 , it will be treated a short packet transfer and occupy one USB buffer.
If the transfer size is >=512 and <=1024, it will be treated two packets transfer and occupy two USB buffers.
SPI Slave is a passive transfer.
Also make sure the SPI Master sends the clock and do not let the buffer overflow.
Best Regards,
FTDI Community
If you use FT4222_SPISlave_Write() to write SPI slave data it will append 0x00 in every time the API FT4222_SPISlave_Write() is called.
You can also try to replace FT4222_SPISlave_Write() with FT_Write() as it does not append 0x00 at the beginning.
There are only two USB FIFOs to store the data from PC Host and each FIFO is 512 bytes (but status bytes occupy 2 bytes).
When the API FT_Write() is called, it will send a bulk transfer.
If the transfer size is <512 , it will be treated a short packet transfer and occupy one USB buffer.
If the transfer size is >=512 and <=1024, it will be treated two packets transfer and occupy two USB buffers.
SPI Slave is a passive transfer.
Also make sure the SPI Master sends the clock and do not let the buffer overflow.
Best Regards,
FTDI Community