FTDI Community
General Category => Discussion - Software => Topic started by: TMa on August 16, 2022, 12:27:54 PM
-
Hi all,
I have a simple question regarding SPI slave operation of FT4222 chip. Is it possible to read non-byte sized data?
SPI master are sending 10-bit packet and libft4222 reporting that only one byte has been received (FT4222_SPISlave_GetRxStatus func). The last two bits are lost. Can I force on chip/driver to read next not-full byte?
thanks in advance
-
Hello,
All API functionality can be found in AN_329 User Guide for LibFT4222 (https://www.ftdichip.com/Support/Documents/AppNotes/AN_329_User_Guide_for_LibFT4222.pdf).
What happens if you just try to call another read without checking if there is any data available?
Best Regards,
FTDI Community
-
After sending 10-bit packet I'm executing following scenarios:
Scenario 1
Actions Result
FT4222_SPISlave_GetRxStatus rxSize = 1
FT4222_SPISlave_Read 1 byte First 8 data bit of packet
FT4222_SPISlave_GetRxStatus rxSize = 0
FT4222_SPISlave_Read 0 byte FT4222_INVALID_PARAMETER
Scenario 2
Actions Result
FT4222_SPISlave_GetRxStatus rxSize = 1
FT4222_SPISlave_Read 1 byte First 8 data bit of packet
FT4222_SPISlave_Read 1 byte FT4222_INVALID_PARAMETER
Scenario 3
Actions Result
FT4222_SPISlave_GetRxStatus rxSize = 1
FT4222_SPISlave_Read 2 byte Waiting forever until 2nd byte will be received
I'm also checking if the last 2 bits are accumulated during multi-10bits transmission. E.g. 4 packets (10bit each) could be received as 5 full bytes (5 * 8bits), but unfortunately are not.
-
Hello,
Here is some feedback from our R&D team:
FT4222H SPI Slave can only receive bytes.
It cannot accept bit transmission.
The workaround might be for the SPI master to send additional dummy bits.
Best Regards,
FTDI Community
-
Hi,
unfortunately I don't have possibility to change the number of bits sending by the SPI master.
I've figured out a workaround with tiny fpga board. It's waiting on the last pulse of SPI clock and adding extra six dummy pulses with the same properties as the previous ones.
Now everything works :) Thanks for support.
Best Regards