two ft245am

Oct 16, 2004 8 Replies

Buongiorno,



I am working with _TWO_ devices FT245AM based, EEProm, FTD2XX.DLL V.1.06.06, WinMe or WinXP. SerialNumber is made different for the two devices. One device at time works fine, and is correctly listed with function FT_ListDevices(). Two devices together do not work. FT_ListDevices() count two devices, correctly list one of them, and return FT_INVALID_HANDLE for the other one.



The problem is only with FT245AM, with FT245BM the _TWO_ devices seem to work together fine.



Is that a known behavior? What my be wrong? What can I do?



Thanks.



lucky


Why don't you ask this to the support engineer(s) at FTDI? They are always very helpful.

Meindert

Are you sure that the error is FT_INVALID_HANDLE?

pinco_pallo

Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

I have posted the question to the FTDI support. But my previous experience is of no answer from the FTDI support.

Thanks.

lucky

Buongiorno.

Or in other way, does anybody have used _TWO_ devices FT245AM based, EEProm, FTD2XX.DLL, with success? Please a little of details. Thanks.

lucky

Yes. FT_ListDevices returns FT_INVALID_HANDLE for DevId=0, FT_OK for DevId=1, FT_DEVICE_NOT_FOUND for others DevId. Note that is the first device that become wrong connecting the second one. Before the connection of second device, the first one was OK.

lucky

Have you programmed the EEPROMs so that the two devices have different serial numbers? I have used several FT245AMs with a hub without problems after they have been individually programmed with different serial numbers so that the hub and host can distinguish between the two. I also programmed the devices with different product IDs---but retained the FTDI manufacturer ID. (You can contact FTDI and they will issue you a range of Product IDs that you can use with your own products.)

Mark Borgerson

Yes. And I can see the different device SerialNumber, with FT_ListDevices(), when I connect one device at time.

With FTD2XX.dll or as VirtualCom? I am using FTD2XX.dll.

PID=0403h, VID=6001h for both devices. Or you are saying that VID _MUST_ be different?

Thanks.

lucky

Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

I am using the direct FTD2XXX.dll drivers.

Are you sure that you don't have those backwards? My unit use VID 0403, which is the FTDI vendor ID.

I use PID FED9, where FTDI allocated me FED8 to FEDF (I think).

Here's the code I use to enumerate the connected devices:

***************** Borland C++ Builder code *******************

void __fastcall TFormLink::BTFindClick(TObject *Sender) { char devstring[30]; DWORD numdevs, devindex = 0; FT_STATUS fts; // if we have an open device, close it before listing devices if(FTH != 0) { // FTH is a global device handle FT_Close(FTH); FTH = 0; } fts = FT_ListDevices( &numdevs, NULL, FT_LIST_NUMBER_ONLY); CBUSB->Items->Clear(); // clear the list in the GUI fts = FT_OK; if(numdevs > 0){ for(devindex = 0; devindex < numdevs; devindex++){ fts = FT_ListDevices( (PVOID)devindex, devstring, FT_LIST_BY_INDEX |FT_OPEN_BY_SERIAL_NUMBER ); //if the result is good, add device in GUI if(fts == FT_OK) CBUSB->Items->Add((const char *)devstring); } } else{ strcpy(devstring, "No USB-1 Found" ); CBUSB->Items->Strings[0] = (const char *)devstring; } CBUSB->ItemIndex = 0; }

Here's the code I use to open the device----picked from a list by serial number:

void __fastcall TFormLink::BTOpenClick(TObject *Sender) { // try to find and open a CF-1 interface

char devstring[30]; long numdevs; long devindex = 0; if(FTH != 0) { FT_Close(FTH); FTH = 0; } fts = FT_ListDevices( &numdevs, NULL, FT_LIST_NUMBER_ONLY);

if(numdevs >0) { devindex = CBUSB->ItemIndex; // get item selector from GUI // get the serial number from the GUI string if(devindex >=0)strcpy(devstring, CBUSB->Items->Strings[CBUSB-> ItemIndex].c_str()); fts = FT_OpenEx((PVOID)devstring, (DWORD)FT_OPEN_BY_SERIAL_NUMBER, &FTH);

}

if(fts == FT_OK){ FT_ResetDevice(FTH); FT_SetTimeouts(FTH, 300,300); }

}

Mark Borgerson

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required