Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Is there any way for i2c debugging without oscilloscope?

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



Is there any way for i2c debugging without oscilloscope?
Moderator:
RSKV

Post Reply
Follow this topic



Is there any way for i2c debugging without oscilloscope?

dv2 posted on 03 Jan 2013 8:56 PM PST
Top Contributor
113 Forum Posts

 Hi

I want find ack signal in EZUSB_i2c function. 

But i have not oscilloscope so i need to find way without oscilloscope to find ack status . 

And i want find status ack signal in read or write in i2c. 

So, is there any way how to find ack signal ?

 




Re: Is there any way for i2c debugging without oscilloscope?

Bob Marlowe posted on 04 Jan 2013 10:07 PM PST
Top Contributor
1768 Forum Posts

I found me a logic analizer to check my I²C connection and it worked like a charm, not only showing ACK/NAK but the address and data transferred as well. Depending on where you are located, you'll use a different manufacturer, I bought mine from here : http://www.ikalogic.com/

 

Bob



Re: Is there any way for i2c debugging without oscilloscope?

dv2 posted on 04 Jan 2013 05:32 AM PST
Top Contributor
113 Forum Posts

 Thanks. But it is not what i want answer. 



Re: Is there any way for i2c debugging without oscilloscope?

NIKL posted on 26 Feb 2013 05:01 AM PST
Cypress Employee
148 Forum Posts

 Hi

You can check the ACK flag  after writing the I2C data and report 1 or 0 on EP0 endpoint and check what value you are receiving on the EP0.

For Eg check the following code:

BYTE y;

y=0;

while (I2CS & bmSTOP);

// set the START bit and write the address

I2CS = bmSTART;

I2DAT = SETUPDAT[5];

while (!(I2CS & bmDONE));

while (!(I2CS & bmACK));

// write at requested address

I2DAT = SETUPDAT[3];

while (!(I2CS & bmDONE));

while (!(I2CS & bmACK));

I2DAT = SETUPDAT[2];

while (!(I2CS & bmDONE));

while (!(I2CS & bmACK));

// write at requested byte

I2DAT = SETUPDAT[4];

while (!(I2CS & bmDONE));

while (!(I2CS & bmACK));

I2CS = bmSTOP;

y=1;

EP0BUF[0]=0xFF;

EP0BCH=0;

EP0BCL=1;

 

In the above code snippet, for IN transfer you will receive 0xFF on EP0 if all the I2C tranfers complete otherwise the program will get stuck in loop:  while (!(I2CS & bmACK));

and the IN transfer would fail.

I hope this post answers your question.

 

Thanks

Nikhil

 






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.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20