Is there any way for i2c debugging without oscilloscope?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 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 ?

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

0 Likes
Anonymous
Not applicable

 Thanks. But it is not what i want answer. 

0 Likes
Anonymous
Not applicable

 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

0 Likes