pulling line high/low by software

Status
Not open for further replies.

prashant_408

Newbie level 1
Joined
Mar 29, 2005
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
Hi,

I've come across a strange behaviour of the board, where the SDA and SCL lines of I2C are controlled by a register. So when I write '1' into perticular bit for that register, the line should go high as per my expectations.

When I do that using debugger, it works, but when I do it from software it is failing.

Somewhere in earlier posts here I saw a reply regarding zero ohm's resistor use as:
" The 0 ohm resistors could be connected to different pins on for example a microcontoller, to pull pins high or low.
Diferent combinations of mounted and not mounted jumpers could tell the microcontroller wich version it is.
When it reads which pins are pulled high and low, it would set up different parameters in the software. "

Since I've removed the zero ohms resistor in between the device and the pins, can it be a cause for problem ??

thanks in advance !
-Prashant
 

Hi prashant_408,

I'm relatively new to I2C, but I do know that the lines require external pull-up reisistors (2-10K?), this is for both SCL and SDA. Every schematic I've seen that uses I2C has pull-ups.

When you talk about '0-ohm-resistors' I assume you mean resistors that have 0 resistance (well, at least very, very low resistance since nothing has 0 resistance).
These are litterally 'jumper' wires, and should not be thought of resistors at all. They are used simply as jumpers, or as 'test' links where they are installed to create a certain behavior, and can be removed later. I imagine these are used instead of a simple wire due to software constrints and mass soldering methods, the manufacturing machine needs to place a component, can't do a wire.

Anyway, back to your original problem....check the resistance between the SCL and VCC (with power removed) and do the same for the SDA line. If Its infinity, you should install some, and if its '0', you've got a short somewhere, or a jumper is in place that should be removed. As I said above, if a '0-ohm' resistor was installed on your board, it is simply connecting two things together, therefore it is probably needed for normal functioning.

The bit you said you read somewhere I think, is wrong. Using 0-ohm res' to pull something high or low, doesn't pull, it connects, so if you used them on your SCL and SDA (or any I/O) it would permantly connect it high/low, regardless of what you did in software. After all, the reason pull-up/down resistors have a fairly high resistance is to stop the input/output drifting above and below the logic threshold when there is nothing connected to it, without sinking/sourcing too much current. Basically to give the line a 'known' state when its not being used.

Hope this helps, buut without any more info, my advice can't be more specific.

BuriedCode.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…