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

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Messages - LennonNM

Pages: [1]
1
Understood.
I tried that and the result was the same, c_uint8(1) works fine, but c_uint8(2) returns FT_INVALID_PARAMETER.
I tried using LibFT4222 versions 1.4.3 and 1.4.4, both with ftd2xx 2.12.28.1, and the behavior is the same. If I change ftd2xx what I get is a status error 1000 -> FT4222_DEVICE_NOT_SUPPORTED
Is there some device configuration I may be missing prior to masterInit? In summary, these are the steps I'm following
- CreateDeviceInfoList
    These are the devices listed from a single ftd chip
    {'index': 0, 'flags': 2, 'type': 10, 'id': 67330076, 'location': 135969, 'serial': b'A', 'description': b'FT4222 A', 'handle': 0}
    {'index': 1, 'flags': 2, 'type': 10, 'id': 67330076, 'location': 135970, 'serial': b'B', 'description': b'FT4222 B', 'handle': 0}
- Open device with index 0 -> STATUS_OK
- MasterInit with ssoMap c_uint/c_uint8 (2) -> FT_INVALID_PARAMETER

----- UPDATE --------------
After writing this message I understood the problem, I was using the FT in chip mode 0 (single slave), after adjusting the JP2 and JP3 pins (in the dev kit), I managed to change to chip mode 2, this allows 4 slaves and now there are no issues if correct ssoMap value is sent to the right usb interface device.

2
Should have pointed out that I'm working in Python.
openStatus value returned is 0 (FT_OK)
initStatus value returned is 0 (FT_OK) when I send the value c_uint(1) for the ssoMap, it returns 6 (FT_INVALID_PARAMETER) when I send c_uint(2)

Here is the code:
    from ctypes import WinDLL, byref, c_void_p, c_uint
    ft4222lib = WinDLL('LibFT4222-64.dll')
    ftd2xxlib = WinDLL('ftd2xx.dll')
    ftHandler = c_void_p()
    openStatus = ftd2xxlib.FT_Open(c_uint(0), byref(ftHandler))
    initStatus = ft4222lib.FT4222_SPIMaster_Init(ftHandler, c_uint(1), c_uint(2), c_uint(0), c_uint(0), c_uint(2))


3
According to the documentation, if I understand correctly, these are the values I should send for slave selection SS0 -> 0b0001, SS1 -> 0b0010, SS2 -> 0b0100, SS3 -> 0b1000, but, only the option for SS0 is working, the others return an FT4222_INVALID_PARAMETER error, however, sending any combination with the lsb in 1 (0b0011, 0b0101, …) does not return any error, however, only SS0 works in those cases.
Following is my spiMaster_Init configuration:

ioLine : SPI_IO_SINGLE
clock_div : CLK_DIV_4
cpol : CLK_IDLE_LOW
cpha : CLK_LEADING
ssoMap : 2 (0b0010)

Can't see if I'm doing something wrong or what I'm missing.

4
Thanks for the answer, it was indeed a timing issue, it works well now, no problems with the data frame.

5
Discussion - Drivers / FT4222 more than 8 bit data frame / python drivers
« on: January 15, 2021, 02:15:34 PM »
Hi, I'm trying to make an interface in python, first of all, if someone knows of a package (other than python-ft4222) or an alternative library to Libft4222 from FTDI (they already answered me that this library does not have the functionality I require), please tell me.

For the frame data, I require to communicate with a ADS1118 temperature sensor, which requires minimum 16 bit data frame, as told by FTDI reps, Libft4222 (therefore, also python-ft4222) only operates at 8 bit data frame, so I'm getting a "gap" in between each byte. Does someone know a workaround to get at least 16 continuous bits?

Thanks in advance.

Pages: [1]