Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why PULL UP resistor required

Mtech1

Junior Member level 1
Joined
Mar 18, 2023
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
164
When we can make any pin of microcontroller high or low so I don't understand Why do we need pull-up resistors when connecting an I2C device to a microcontroller?

Could someone explain necessity of pull-up resistors.
 
It's because the lines on I2C are never driven high, to do so would stop several devices on the bus working together. The lines can only be pulled low and the pull-up resistor limits the current that devices can sink to a safe level. As in post #2, the value is to some degree a compromise, at low speeds the value can be higher so less current is drawn but the tradeoff is the capacitance of the wiring and devices take longer to charge to logic high level.

By using pull-ups there is never any risk of one device driving high and another on the same wire driving low, doing so would place a short across the supply and possibly damage one or both devices. Don't forget that on I2C bus, there can be many devices wired in parallel although the addressing protocol should ensure only one device can pull the lines low at a time.

Brian.
 
Hi,

most ports may have these states:
* HIGH (driven, low impedance)
* LOW (driven, low impedance)
* OPEN (not driven at all, high impedance)
* PULL-UP (weakly driven HIGH)
(maybe even PULL_DOWN (weakly driven LO)

If OPEN/floating: the state is unknown. One needs to avoid this situation.

On a bus, when several devices control the same signal line you have one bad condition: One device drives LOW, while another device drives HIGH, then you have a short circuit condition --> high current, maybe destroying a device. One needs to avoid this situation.

***
I2C:
* generally drives LOW or OPEN only. It never drives HIGH.
Thus one never can get a short circuit condition.
But in OPEN mode - when no device drives LOW the level should be recognized as HIGH. This is made by installing an external pull up resistor that limits the current.
The resistor value needs to be
* high enough not to cause too high current for the pin drivers
* low enough to ensure fast enough timing (in combination with the bus capacitance)

so there basically are just two states:
* when ALL devices are OPEN, then the level is pulled HIGH by the external resistor
* in any other case the signal level is LOW.

Klaus

added:
oops, Brian was faster ;-)
 
Open collector / open drain outputs are the easy way
to make a "party line" bus to which one or N more can
be added, with no added components besides.
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top