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

Author Topic: FT4222 CLK Settings CPOL/CPHA wrong in user manual?  (Read 7784 times)

emmanuel

  • Newbie
  • *
  • Posts: 3
    • View Profile
FT4222 CLK Settings CPOL/CPHA wrong in user manual?
« on: September 09, 2019, 11:53:04 PM »

I have an issue where the SPI Master locks up if the FT4222 is configured in the following way:
Code: [Select]
    ftStatus = FT_OpenEx("FT4222",FT_OPEN_BY_DESCRIPTION, &ftHandle);
    ftStatus = FT4222_SetClock(ftHandle, SYS_CLK_80);
    ftStatus = FT4222_GetVersion(ftHandle, &ft4222Version);
    ftStatus = FT4222_SPISlave_InitEx(ftHandle, SPI_SLAVE_NO_PROTOCOL);
    ftStatus = FT4222_SPISlave_SetMode(ftHandle, CLK_IDLE_HIGH, CLK_LEADING);

The SPI Master in my case is an HC16 Motorola MCU.   
I can confirm its SPI Master configuration is:
Code: [Select]
CPOL=1, CPHA=1

When I use the CLK_IDLE_HIGH/CLK_LEADING on the FT4222, the first write from the FT4222 will halt the Master.
If using CLK_IDLE_HIGH/CLK_TRAILING, the Master does not halt.

Looking at the definition for CLK_TRAILING, the bit seems to be swapped with _LEADING.
In my experience, *leading is typically '1' and *trailing is '0';  This is the case for most of my MCU experience.

Have I made a mistake someplace else or is the values set for CLK_LEADING / CLK_TRAILING backwards?
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: FT4222 CLK Settings CPOL/CPHA wrong in user manual?
« Reply #1 on: September 11, 2019, 01:28:38 PM »

Hello,

Please contact email support on support1@ftdichip.com and we will look into your issues further and where appropriate post the outcome here.

Regards,
FTDI Community
Logged