FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: FT4222H non-byte sized data transfer?  (Read 8949 times)

TMa

  • Newbie
  • *
  • Posts: 3
    • View Profile
FT4222H non-byte sized data transfer?
« 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
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: FT4222H non-byte sized data transfer?
« Reply #1 on: August 16, 2022, 04:32:46 PM »

Hello,

All API functionality can be found in AN_329 User Guide for LibFT4222.

What happens if you just try to call another read without checking if there is any data available?

Best Regards,
FTDI Community
Logged

TMa

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FT4222H non-byte sized data transfer?
« Reply #2 on: August 17, 2022, 08:28:58 AM »

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.


 
« Last Edit: August 17, 2022, 11:29:05 AM by TMa »
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: FT4222H non-byte sized data transfer?
« Reply #3 on: August 17, 2022, 04:43:53 PM »

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
Logged

TMa

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FT4222H non-byte sized data transfer?
« Reply #4 on: August 19, 2022, 07:45:52 AM »

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
Logged