FTDI Community

General Category => Discussion - Drivers => Topic started by: allenhuffman on September 10, 2019, 03:41:40 PM

Title: Purpose of FT4222_SetClock()
Post by: allenhuffman on September 10, 2019, 03:41:40 PM
Could someone enlighten me on the purpose of the different clock speeds provided by:

Code: [Select]
FT4222_SetClock()
The manual explains:

Quote
Set the system clock rate. The FT4222H supports 4 clock rates: 80MHz, 60MHz, 48MHz, or 24MHz. By default, the FT4222H runs at 60MHz clock rate.

From the specs:

https://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222H.pdf (https://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222H.pdf)

It appears this may just be for SPI to get different speeds. Is it used at all for I2C?

We have had some interesting I2C challenges lately, and one of them may have been resolved by changing from the default 60MHz to 24MHz (it ran over a million packets overnight successfully, which we haven't been able to do previously).

NOTE: We also see that when we specify 1000 (kbps) our scope measures around 750mhz.

Thanks...
Title: Re: Purpose of FT4222_SetClock()
Post by: FTDI Community on September 12, 2019, 04:33:10 PM
Hello,

The FT4222H operates with a 12 MHz crystal (or oscillator) and generates a standard internal 480 MHz clock for the USB interface. The Clock Synthesizer takes the 480MHz clock from the embedded UTMI PHY and generates the 80MHz, 60MHz, 48MHz and 24MHz as reference clocks. The user can select one of these reference clocks via the API, FT4222_SetClock which is defined in LibFT4222, as the system operating clock. The system operating clock will be the base and used by the embedded functions to generate the required interface clock.

AN_329_User_Guide_for_LibFT4222 (https://www.ftdichip.com/Support/Documents/AppNotes/AN_329_User_Guide_for_LibFT4222.pdf) states the I2C master speed cat be between 60kbps and 3400kbps.

It ignores the calculation when i2c master frequency is not in this range.

Add 1K resistor on R18 and R19 for I2C external bus pull-up.

Best Regards,
FTDI Community