Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Strange behaviour of FX3's I2C

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Strange behaviour of FX3's I2C
Moderator:
RSKV

Post Reply
Follow this topic



Strange behaviour of FX3's I2C

RobK posted on 05 Jan 2012 5:28 AM PST
Top Contributor
56 Forum Posts

Hi all,

while trying to use I2C-module of FX3 some strange behaviour occured:

1.) I can't get out a speed of 1MHz on I2C-bus! If I set the bitrate in struct CyU3PI2cConfig_t to 1000000 (1MHz) I see only the I2C-startcondition on oscilloscope and then the whole I2C-bus hangs up!
Setting the bitrate to:
100kHz => works fine
400kHz => works fine
900kHz => I2C-bus shows only ~700kHz ?!
1MHz => I2C hangs up!
VIO5 is 3.2V (measured).

2.) There might be a problem with the API CyU3PI2cTransmitBytes(). The API returns in any case CY_U3P_SUCCESS, even if there is no I2C-slave available on the bus. I called the API's CyU3PI2cTransmitBytes() and CyU3PI2cWaitForAck() subsequently (using the code below) without having a slave on the bus (so there is no ACK for sure! I checked it on oscilloscope) and the API:
CyU3PI2cTransmitBytes() returned CY_U3P_SUCCESS => I'd expect CY_U3P_ERROR_FAILURE (acc. FX3APIGuide)
CyU3PI2cWaitForAck() returned CY_U3P_ERROR_TIMEOUT as expected
This is the according code-snippet:
=> the variable dmaUsb2CpuBuffer.buffer holds a valid address (pointing to a character) and dmaUsb2CpuBuffer.count  = 1!

i2cPreamble.buffer[0] = 0xB0;
i2cPreamble.ctrlMask = 0;
i2cPreamble.length = 1;
apiRetStatus = CyU3PI2cWaitForAck (&i2cPreamble, 3);    // repeat it 3 times if didn't got ACK
if(apiRetStatus == CY_U3P_SUCCESS)
{
    CyU3PDebugPrint (4, "CyU3PI2cWaitForAck() succeeded!\r\n");
}
else
{
    CyU3PDebugPrint (4, "CyU3PI2cWaitForAck() failed: %s\r\n", appGetErrorString(apiRetStatus));
}

// write preamble and data received from USB to I2C
apiRetStatus = CyU3PI2cTransmitBytes(&i2cPreamble, dmaUsb2CpuBuffer.buffer,
                                     dmaUsb2CpuBuffer.count, 0);
if (apiRetStatus == CY_U3P_SUCCESS)
{
    CyU3PDebugPrint (4, "CyU3PI2cTransmitBytes() succeeded!\r\n");
}
else
{
    CyU3PDebugPrint (4, "CyU3PI2cTransmitBytes() failed: %s\r\n", appGetErrorString(apiRetStatus));
}

Could you pls help me to get rid of this!
I'm using SKD Beta3.1 and FX3's Dvlp-board.

Thanks a lot!
Regards,
Robert




Re: Strange behaviour of FX3's I2C

aasi posted on 05 Jan 2012 08:29 AM PST
Cypress Employee
1073 Forum Posts

Please create a tech support case (MyAccount -> MyCases) with this information so that one of our engineers can interact with you and addressed your concerns in the right way.

Regards,

Anand



Re: Strange behaviour of FX3's I2C

RobK posted on 12 Jan 2012 03:02 AM PST
Top Contributor
56 Forum Posts

Hi Anand,

in the FX3-ReleaseNotes of SDK V1.0 I found the following known issues about I2C:

" 4. When there is a failure in an I2C transaction, the I2C block needs to be reset. This can be
done by invoking CyU3PI2cDeInit(), followed by a CyU3PI2cInit() and a
CyU3PI2cSetConfig().
5. A delay of about 5 ms is required between an I2C write operation and the next I2C
operation. "

Do you plan do fix this issues in near future?

Regards,
Robert



Re: Strange behaviour of FX3's I2C

RobK posted on 20 Jan 2012 05:23 AM PST
Top Contributor
56 Forum Posts

Just wanna share the research-results of the Cypress support-team and me:

1.) the I2C-1MHz-mode seem to work only after setting explicitely the I2C-drivestrength to CY_U3P_DS_FULL_STRENGTH

2.) using CyU3PI2cTransmitBytes() to send only 1 byte always returns CY_U3P_SUCCESS => this is a bug






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.