FTDI Community

General Category => Discussion - Software => Topic started by: snarkysparky on November 05, 2021, 01:48:35 PM

Title: FT4222 cannot set speed. Exception raised
Post by: snarkysparky on November 05, 2021, 01:48:35 PM
Using the FT4222 to communicate with MCU over SPI.

Same hardware and software has worked flawlessly in many instances.

However we are trying out a touchscreen integrated with PC.  Touchwu TD101E.
When FT4222_SetClock is executed it throws exception.

Code: [Select]
            ftStatus = FT_OpenEx(devInfo.LocId, FT_OPEN_BY_LOCATION, ref ftHandle);

            if (ftStatus != FTDI.FT_STATUS.FT_OK)               //  not true.   Status is OK
            {
                SetState(MessageList.MessageSystemError);
                StringAppendRTB("Open NG: {0}" + ftStatus);
                return;
            }



            // Set FT4222 clock
            FT4222_ClockRate ft4222_Clock = FT4222_ClockRate.SYS_CLK_24;



            if (ftHandle == null) MessageBox.Show("NULL");

            Thread.Sleep(200);

            try
            {
                ft42Status = FT4222_SetClock(ftHandle, ft4222_Clock);   // here throws exception


            }
            catch
            {

                MessageBox.Show(" cannot set USB clock " + ft42Status.ToString());    // status here is OK
                SetState(MessageList.MessageSystemError);



I am sure this is related to the new touchscreen PC but I don't know where to look in the specs to prove it.

We have updated all the chip drivers per the manufactures supported drivers.

Why would set clock throw an exception?

Thanks



Title: Re: FT4222 cannot set speed. Exception raised
Post by: FTDI Community on November 05, 2021, 04:01:20 PM
Hi,

You should try running our FT4222H code examples to see if it really is the PC. LibFT4222 Windows Library (v1.4.4) and Examples (http://url).

Also, i will need to know more about the exception. feel free to email with the details: support1@ftdichip.com

Best Regards

FTDI community