PDA

View Full Version : I2C SDA not going to zero! 3.3V --> 1.14V !



jimbostlawrence
- 22nd March 2013, 13:24
Hi,

I have a strange one... I have had some boards made up. Some work but one in particular fails to talk to some I2C sensors. The clock line is correctly jumping between 3.3V and 0V but the data (SDA) line is bouncing between 3.3V and 1.15V !

I changed the code to something simple that simply set data line high for a second and then low but it's just not having it. I can't find any shorts anywhere between this line and anything else! Could the PIC port be damaged?

Cheers

Mark

Demon
- 22nd March 2013, 21:04
Are you sure you didn't forget a resistor? (I have pull-down in mind).

PICs are pretty resilient as some have tested here. If you have identical boards and one is acting up, I'd check for missing parts, polarity, etc.

Robert

Edit: I'm assuming the boards, PICs and program are all identical.

jimbostlawrence
- 23rd March 2013, 00:19
Yup, all components accounted for. I still need to have another good look at it but I've followed the track from PIC to all sensors on that data line through each Via, looking for possible shorts and nothing. All boards and firmware identical yes.

I have a pull-up on the line for I2C; it just seems like the PIC can't pull the line down, even when I stick on a simple program to pull it down for a second or more.

If I find out what it is/was, I'll let you know. I'd prefer to not have to resort to air gunning off the PIC...

Jumper
- 23rd March 2013, 02:34
Hi,

What PIC do you use? Are you sure that pin does not have any other functions that you might have forgotten to set (comparators, AD and similar).

What if you remove the I2C device? Will the data line go low?

Charlie
- 23rd March 2013, 08:43
Check the tracks with a meter. I've seen vias with internal cracks cause invisible opens, especially when there is solder resist over them.

rsocor01
- 23rd March 2013, 11:41
Start replacing components. Start with the pull-ups resistors, then the sensors and the PIC. If the problem persists then trash the board :D.

jimbostlawrence
- 23rd March 2013, 11:59
Hi,

What PIC do you use? Are you sure that pin does not have any other functions that you might have forgotten to set (comparators, AD and similar).

What if you remove the I2C device? Will the data line go low?

Many thanks for your reply. It's an 18F26J53. It's set for output so should automatically be digital. The firmware works on other board (identical). I may have to start removing components but they're all QFN types, including the PIC.

jimbostlawrence
- 23rd March 2013, 12:00
Check the tracks with a meter. I've seen vias with internal cracks cause invisible opens, especially when there is solder resist over them.

Many thanks for your reply. I'll try some more continuity tests. Not given up on this one yet.

jimbostlawrence
- 23rd March 2013, 12:03
Start replacing components. Start with the pull-ups resistors, then the sensors and the PIC. If the problem persists then trash the board :D.

Many thanks for your reply. I'll try replacing the pull up res' but the sensors/PIC will be tricky. I don't think it's the res as the line is going high to 3.3V. As you rightly point out, there's only so long one should spend on something like this before trashing it. I just like to know the root cause of the issue. Because everything is surface mount, there's always the danger of trashing the board when heat gunning components. All part of the fun I guess...

Jumper
- 23rd March 2013, 12:08
Should? maybe

Will? Only a deep dive into the datasheet can be sure of that.

PIC18F26J53 har PPS (periphial pin select or how it is spelled, menaing you can re-route HW functions to different pins)

So what PIN on the device and what PORT-id do you use?

I would not bet that all pics always gets all registers set up exactly the same everytime.. so there might be a conflict that is because of a register setting.

Before I start pulling components I would advise you to give us more details about the device setup and configuration...and PPS register settings

HenrikOlsson
- 23rd March 2013, 12:35
Hi,
Have you verified the value of the pullup resistor? Perhaps it's 10ohms instead of 10k or whatever it's supposed to be. The PIC can only pull so hard on the pin, if the pullup is too stiff it won't be able to get it all the way to Vss.
I was going to suggest to lift the pin in question and measure directly on the pin but with a QFN that won't be easy. Make sure you measure from the pin in quesion to adjacent pins, perhaps there's a solder bridge under the chip.

/Henrik.

pedja089
- 23rd March 2013, 23:58
Put your pin to input, then measure current between ground and pin.
IF current is few mA THEN pic is problem
IF current is much bigger THEN
Remove pull up
Measure again
ENDIF
IF any current exist THEN
Problem is in sensor or pcb
Remove sensor
measure current.
IF any current exist THEN
pcb have short
ELSE
Problem is in sensor
END IF