I2C Bus Problem

Electronics Computer Programming Q&A
Post Reply
User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

I2C Bus Problem

Post by Sambuchi » Mon Jul 10, 2006 6:17 am

I am having a problem where i have several devices on the I2C bus... While talking to one device ... it occaionally hangs up... the CLK on the I2C will remain high and the DATA will be pulled low.. by removing the power to the particular device, the Data line will jump back up and the I2C bus will work again.

Has anyone ever seen this problem... when this happens in Debug I cant find if it happens on a read or write...

Any pointers greatly appreciated

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Mon Jul 10, 2006 12:45 pm

got the right pullups on the lines? I know with multiple devices or longer bus you need to pay more attention to that.

are you keeping a log of the the I2C commands? at least the last command. that might give you a clue.

dyarker
Posts: 1752
Joined: Fri Aug 22, 2003 1:01 am
Location: Izmir, Turkiye; from Rochester, NY
Contact:

Post by dyarker » Mon Jul 10, 2006 11:35 pm

And you don't accidentally have two slave units with the same address?
Dale Y

User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

Post by Sambuchi » Tue Jul 11, 2006 2:05 am

i have 7-8 devices on the bus right now. I do have pull-ups on the lines 4.7K. Signals look pretty clean.

I am using a PIC micro.. MPLAB C18. philba when you say keeping a log of the commands.. do you mean checking the watch window with breakpoints or is there a way to make an actual "log" wtih MPLAB?

Yeah, i check the slaves over and over again and it looks like they are ok too.

My PIC acts as a master the entire time..

My problem lies "i think" with this part
http://www.linear.com/pc/downloadDocume ... 1768,D2543

He is a 10 bit DAC. That takes address->command-> LSB->MSB.

I have a way of removing a connector that will remove power to this devices.. doing so will regain access to the bus.

I did however find a temp fix to this problem.. I found out that each I2C device acts like a State Machine... so by toggleing the clk of the bus I can step thru the "hold" caused by the 10 bit DAC.

Not the fix i was looking for.. but will work for now.

It is odd that it works most of the time.

This is my first time using a pic and working on a I2Cbus. The code that I am using is mine... I might have a ACK problem but it looks like my flags are being set correctly :x :x :x

I will be working on this for a week or so.. any ideas or pointers are greatly appreciated. :grin:

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Tue Jul 11, 2006 11:31 am

what speed are you running the bus at? try dropping the speed to see what happens.

the offending device could be noisy - how are you looking at the signals? you might be missing the noise. have you checked the errata for it?

User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

Post by Sambuchi » Wed Jul 12, 2006 4:29 am

thanks philba for the tips.

I am in the frequency for all devices. Speed does not look like the problem..

I am sorry but I am not sure what you mean by "errata"?? my google search didnt help either.

JPKNHTP
Posts: 488
Joined: Wed Jun 29, 2005 1:01 am
Location: Missouri
Contact:

Post by JPKNHTP » Wed Jul 12, 2006 9:14 am

-JPKNHTP
-God Bless

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests