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

Pages: 1 2 [3] 4 5 ... 10
 21 
 on: February 22, 2021, 08:53:17 AM 
Started by earnie - Last Post by earnie
What you could do is use FT_PROG to change the Product Description of Serial Number.
Then you could create a simple D2XX program to open by serial number or description.
See the D2XX Programmer's Guide for more information.
Note that this Product Description name change won’t be shown in Device Manager but allows you to program a unique description which can be read through the D2XX APIs.
For example:

ftStatus = FT_OpenEx("Mike's 3 MBaud cable",FT_OPEN_BY_DESCRIPTION,&ftHandle);

Note that there is a limit of the number of characters used in the serial number, description, etc.
See section 4 EEPROM Programming Interface Functions in the D2XX Programmer's Guide.
With this approach I can't use the VCP driver during normal cable use (not during writing to the EEPROM), correct?

 22 
 on: February 19, 2021, 04:18:21 PM 
Started by earnie - Last Post by FTDI Community
Hello,

The name "USB Serial Port" in Device Manager comes from the default driver INF files. See 2.12.28 driver files.

If you wanted to change the name in Device Manager that would be a complex process:

-Obtaining a PID to use with our VID
-Editing the default driver which breaks signing
-Resigning the driver which incurs costs
-Managing distribution of your driver

So this might not be the best option for you.

What you could do is use FT_PROG to change the Product Description of Serial Number.
Then you could create a simple D2XX program to open by serial number or description.
See the D2XX Programmer's Guide for more information.
Note that this Product Description name change won’t be shown in Device Manager but allows you to program a unique description which can be read through the D2XX APIs.
For example:

ftStatus = FT_OpenEx("Mike's 3 MBaud cable",FT_OPEN_BY_DESCRIPTION,&ftHandle);

Note that there is a limit of the number of characters used in the serial number, description, etc.
See section 4 EEPROM Programming Interface Functions in the D2XX Programmer's Guide.

TN_153 Instructions on Including the D2XX Driver in a Visual Studio Express 2013 Project should help you to get started with D2XX API usage.

You can also check out our C# examples here:

https://ftdichip.com/software-examples/code-examples/csharp-examples/

Best Regards,
FTDI Community

 23 
 on: February 19, 2021, 04:17:15 PM 
Started by Petar - Last Post by FTDI Community
Hello,

At USB level, the transfers are at 1024 bytes (USB3.0 – SuperSpeed) and after 4 such messages the FIFO will be full, and the USB host controller will be holding rest of the data until the FIFO is free again.
Please refer to USB Bulk transfer protocol to understand how this works in more detail.

Please try 1K aligned data in your transfer model.

If you take a look at the demo application provided with the D3xx Linux driver, it should help you.
It's contained within the driver download.

Best Regards,
FTDI Community

 24 
 on: February 19, 2021, 04:04:48 PM 
Started by earnie - Last Post by earnie
I guess a workaround would be to use the serial number (see code below) and then have a lookup table for the text description in a file, but if someone has a suggestion for a solution without the need for a lookup table then I'm still very interested.

Code: [Select]
public class ComPortEnumerator
{
    [DllImport("Setupapi", CharSet = CharSet.Auto, SetLastError = true)]
    private static extern IntPtr SetupDiOpenDevRegKey(IntPtr hDeviceInfoSet, ref SP_DEVINFO_DATA deviceInfoData, uint scope,
        uint hwProfile, uint parameterRegistryValueKind, uint samDesired);

    [DllImport("setupapi.dll")]
    private static extern bool SetupDiEnumDeviceInfo(IntPtr DeviceInfoSet, Int32 MemberIndex, ref  SP_DEVINFO_DATA DeviceInterfaceData);

    [DllImport("setupapi.dll", SetLastError = true, CharSet = CharSet.Auto)]
    private static extern bool SetupDiGetDeviceInstanceId(IntPtr DeviceInfoSet, ref SP_DEVINFO_DATA DeviceInfoData, StringBuilder DeviceInstanceId, UInt32 DeviceInstanceIdSize, out UInt32 RequiredSize);

    [DllImport("setupapi.dll", SetLastError = true)]
    private static extern IntPtr SetupDiGetClassDevs(ref Guid gClass, UInt32 iEnumerator, IntPtr hParent, UInt32 nFlags);

    [DllImport("advapi32.dll", CharSet = CharSet.Unicode, EntryPoint = "RegQueryValueExW", SetLastError = true)]
    private static extern int RegQueryValueEx(IntPtr hKey, string lpValueName, int lpReserved, out uint lpType,
        StringBuilder lpData, ref uint lpcbData);

    [DllImport("advapi32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
    private static extern int RegCloseKey(IntPtr hKey);

    private const UInt32 DIGCF_PRESENT    = 0x00000002;
    private const UInt32 DICS_FLAG_GLOBAL = 0x00000001;
    private const UInt32 DIREG_DEV        = 0x00000001;
    private const UInt32 KEY_QUERY_VALUE  = 0x0001;
    private const string GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR = "4D36E978-E325-11CE-BFC1-08002BE10318";

    [StructLayout(LayoutKind.Sequential)]
    private struct SP_DEVINFO_DATA
    {
        public Int32 cbSize;
        public Guid ClassGuid;
        public Int32 DevInst;
        public UIntPtr Reserved;
    };

    public static void logAllUsbToSerialCablesSerialNo()
    {
        Guid guidComPorts = new Guid(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR);
        Int32 iMemberIndex = 0;
        while (true)
        {
            SP_DEVINFO_DATA deviceInfoData = new SP_DEVINFO_DATA();
            deviceInfoData.cbSize = Marshal.SizeOf(typeof(SP_DEVINFO_DATA));
            IntPtr hDeviceInfoSet = SetupDiGetClassDevs(ref guidComPorts, 0, IntPtr.Zero, DIGCF_PRESENT);
            if (hDeviceInfoSet == IntPtr.Zero)
            {
                // Failed to get device information set for the COM ports
                break;
            }
            bool success = SetupDiEnumDeviceInfo(hDeviceInfoSet, iMemberIndex, ref deviceInfoData);
            if (!success)
            {
                // No more devices in the device information set
                break;
            }
            string comPortName = GetDeviceName(hDeviceInfoSet, deviceInfoData);
            string deviceInstancePath = ComPortEnumerator.getDeviceInstancePath(hDeviceInfoSet, deviceInfoData);
            string serialNo = ComPortEnumerator.extractSerialNoFromDeviceInstancePath(deviceInstancePath);
            Debug.WriteLine(comPortName + " has serial number " + serialNo);
            iMemberIndex++;
        }
    }


    private static string getDeviceInstancePath(IntPtr hDeviceInfoSet, SP_DEVINFO_DATA deviceInfoData)
    {
        StringBuilder descriptionBuf = new StringBuilder(256);
        uint length = (uint)descriptionBuf.Capacity;
        bool success = SetupDiGetDeviceInstanceId(hDeviceInfoSet, ref deviceInfoData,
          descriptionBuf, length, out length);
        if (!success)
        {
            throw new Exception("Can not read the Device Instance Path for device " + deviceInfoData.ClassGuid);
        }
        return descriptionBuf.ToString();
    }

    public static string extractSerialNoFromDeviceInstancePath(string deviceInstancePath)
    {
        if ((deviceInstancePath.Contains("VID_0403")) && (deviceInstancePath.Contains("PID_6001")))
        { // 3 MBaud USB-to-serial cable
          // Example: FTDIBUS\VID_0403+PID_6001+FT9FPQAKA\0000
          // The serial number is               FT9FPQAK
            return deviceInstancePath.Substring(26, 8);
        }
        else if ((deviceInstancePath.Contains("VID_0403")) && (deviceInstancePath.Contains("PID_6014")))
        { // 12 MBaud USB-to-serial cable
          // Example: FTDIBUS\VID_0403+PID_6014+FT478YLWA\0000
          // The serial number is               FT478YLW
            return deviceInstancePath.Substring(26, 8);
        }
        return "";
    }


    private static string GetDeviceName(IntPtr pDevInfoSet, SP_DEVINFO_DATA deviceInfoData)
    {
        IntPtr hDeviceRegistryKey = SetupDiOpenDevRegKey(pDevInfoSet, ref deviceInfoData,
            DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_QUERY_VALUE);
        if (hDeviceRegistryKey == IntPtr.Zero)
        {
            throw new Exception("Failed to open a registry key for device-specific configuration information");
        }

        StringBuilder deviceNameBuf = new StringBuilder(256);
        try
        {
            uint lpRegKeyType;
            uint length = (uint)deviceNameBuf.Capacity;
            int result = RegQueryValueEx(hDeviceRegistryKey, "PortName", 0, out lpRegKeyType, deviceNameBuf, ref length);
            if (result != 0)
            {
                throw new Exception("Can not read registry value PortName for device " + deviceInfoData.ClassGuid);
            }
        }
        finally
        {
            RegCloseKey(hDeviceRegistryKey);
        }

        string deviceName = deviceNameBuf.ToString();
        return deviceName;
    }
}

 25 
 on: February 19, 2021, 02:53:28 PM 
Started by maxwell123 - Last Post by ft245vcpguy
Was there a solution for this problem?

 26 
 on: February 19, 2021, 10:44:34 AM 
Started by earnie - Last Post by earnie
I have several UART Serial Adapter Cables of the following types:

https://ftdichip.com/products/c232hd-ddhsp-0/
https://ftdichip.com/products/ttl-234x-3v3-we/

I would like to make it easier to identify all the different cables from within a home-made Windows application (it's written in C#, but it's capable of calling DLL-files). Is it somehow possible to assign the cables descriptive text strings such as "Mike's 3 MBaud cable", "John's 12 MBaud cable with power switch", "Kevin's UART cable with Tx/Rx tied together", etc in some non-volatile storage inside the cables? I read in the following manual https://ftdichip.com/wp-content/uploads/2020/08/D2XX_Programmers_GuideFT_000071.pdf that many settings can be modified, but I don't have enough USB knowledge to know which settings are safe to modify. It would be a bonus if the text descriptions also would show up in the Device Manager somewhere, either directly in the tree or if you'd go in and look under properties, but it's not a requirement. Typically, I use the standard VCP-drivers, but if there's a very specific reason to do so, I guess I could switch to a different driver and make my home-made Windows application install that driver automatically if it's not present on the computer (I don't like having to supply driver separately).

 27 
 on: February 18, 2021, 07:10:00 PM 
Started by kalle - Last Post by Kimball
It's been more than another month now... it seems clear that nobody is actually working on this. The new driver requirements are not *that* horrible - they are no longer .kext, but Apple is pretty transparent about how you need to set them up and sign them etc.

Any chance we'll get new drivers from FTDI this quarter?

 28 
 on: February 18, 2021, 06:26:01 PM 
Started by tinbert - Last Post by tinbert
Once these have been produced I will let you know.

Great to hear that! I'll be patient and looking forward hearing from you  :D

 29 
 on: February 18, 2021, 03:39:28 PM 
Started by tinbert - Last Post by FTDI Community
Hello,

Thank you for your post.
Currently we do not have an ARM build available for the macOS D2XX driver (glad to hear however you can use the x86 version with Rosetta). The driver team are concentrating on recompiling the VCP driver for macOS 11 and the M1 ARM macs at this moment, but there is an active bug related to compiling the .dylib and .a files for ARM. Once these have been produced I will let you know.

Best Regards,
FTDI Community

 30 
 on: February 18, 2021, 09:37:58 AM 
Started by StanleyChien - Last Post by StanleyChien
Hi, NorthGuy:

Thanks for your reply!   :)

I have the same opinion with you on the min value of input and output delay.

I think your SDC is correct unless we misunderstand the FT601's datasheet.

Pages: 1 2 [3] 4 5 ... 10