I am trying to produce a small circuit, and I am looking to reduce the part count. I recently added an I²C EEPROM which is used once when the system boots up, along with this EEPROM I added two resistors for pullups.

I would like to do without these if possible and just rely on internal pull-up resistors.

This question seems to suggest it's possible, but just not recommended: What happens if I omit the pullup resistors on I2C lines?

I am using an ATmega328 and the EEPROM is located next to the device with trances of about 10 mm.

Has anyone worked on a project intentionally omitting the external pull-up resistors or is this a really bad idea?

  • \$\begingroup\$ Odds are very good that if you omit the pullups, you'll be reworking the board to add them. \$\endgroup\$ – markt Jul 17 '14 at 10:42
  • \$\begingroup\$ Check whether the EEPROM does clock stretching. When it doesn't, you can use a normal (push-pull) output for the clock. Alternatively, if you have pins to spare, switch to a SPI EEPROM. \$\endgroup\$ – Wouter van Ooijen Jul 17 '14 at 10:58
  • 2
    \$\begingroup\$ -1 : another "what will happen if I do something not supported by standard?" question, with obvious "you will get behaviour not supported by standard" answer coming to mind. It may work in some specific circumstances, while in most circumstances it will work poorly or not at all. The same goes with e.g. overclocking uC units - if you're 100% sure you want lousy, faulty and unpredictable behaviour - go ahead, nobody will actually stop you. Also - if somebody wants to save board space or engineering effort by e.g. leaving out two resistors, I'd actually say he has lots to learn. \$\endgroup\$ – user20088 Jul 17 '14 at 12:44
  • 1
    \$\begingroup\$ nb, "I am looking to reduce the part count" - doing so not by simplifying the functional idea or introducing integration but by leaving out necessary passive components is, IMO, the very essence of bad electrical engineering. \$\endgroup\$ – user20088 Jul 17 '14 at 12:50
  • \$\begingroup\$ I was hoping someone would get lucky and someone would say that its fine to do if your carefull. It looks like the resistors aren't going anywhere! \$\endgroup\$ – ArthurGuy Jul 17 '14 at 14:04

I²C requires pullups on the data and clock lines. How you provide those pullups is up to you.

Pullups should be in the region of 3.3KΩ, but the exact value isn't that important as long as it's somewhere around there.

You can use the internal pullups of the MCU if, and only if, you have a very few (one or two) items on the I²C bus, and the bus length is very short (a matter of a few inches).

You should also ensure, in that situation, that the bus is not going to be picking up too much interference, as the noise rejection of the weaker pullups will be worse. Ensure that any tracks that cross your bus do so at 90° to reduce noise induction. Provide a ground trace or pour between the clock and data lines to help reduce cross-talk between the clock and data lines.

That said, two resistors isn't really a big expense...! 0402 or 0603 resistors take almost no room. I'd stick to using proper pullups.

  • \$\begingroup\$ Its not so much the expense but the space they take up and extra time it takes to populate them. I am currently building the boards by hand so I want to reduce as much as possible. I will take a look at the traces and see what improvements can be made to the layout and spacing. \$\endgroup\$ – ArthurGuy Jul 17 '14 at 10:56
  • 10
    \$\begingroup\$ Might I suggest adding the footprints but not populating? That way you only lose a little space, and if it doesn't work you can still put them on. \$\endgroup\$ – ACD Jul 17 '14 at 13:18
  • 2
    \$\begingroup\$ If you'll be making enough boards that you notice the time difference, you'll have enough practice that there won't be much of a time difference! \$\endgroup\$ – Scott Seidman Jul 17 '14 at 16:24
  • \$\begingroup\$ I just hand built a board with 0402s and it only took me about 30 seconds / each for soldering the resistors and caps. You really can't spare 1 minute to ensure proper performance? You'll blow way more than a minute debugging why things aren't working as expected. \$\endgroup\$ – whatsisname Jul 17 '14 at 18:22
  • \$\begingroup\$ When using bit-bang I2C with devices that don't require handshaking, one may omit the pull-up on SCK if one has software actively drive the line high and low. I'm not sure why hardware I2C implementations don't provide an option to actively drive the clock high, since it improves speed and often has no downside if, as is often the case, none of the other devices in the system will ever pull SCK low for any reason. \$\endgroup\$ – supercat May 8 '15 at 16:45

First you have to understand why you need them. Then you may assess more clearly if you need them or not of if you can use the internal ones.

The I2C bus specification says that the things connected to that bus have to be be able to pull the lines low. But they should not be able to pull them high. This is the role of the pull-up resistor on that lines.

That way, if two things or more want to use the bus at the exact same time, there is no risk that one try to pull the line low when another try push it high. Which would create a bus contention, very high currents into the IO of the things and possible destruction of them.

Using pull up, if one try to pull low when another try to "release" the line. The line would go low and nothing serious happens.

The same principle apply with the ACK sent by a slave to the master. The master has to "release" the SDA line when an ACK has to be received. At that time the slave pull the SDA line low to signal the ACK.

Imagine a system without pull-ups. There should be a mean of having the lines at the high level. (a constant low level line does not have a very high throughput.... ;-) ) And we have already seen that using push-pull outputs are not working here without screwing the protocol.

About the internal pull-ups? Yes it could work. But assuming:

  1. You use a very low speed bus. The RC formed by the line capacitance and the pull-up define how long it takes for the line to transit from low to high. If the resistors are big. Which is usually the case in embedded pull-ups, then the time may be very big. Or, as explained by @Majenko, you ensure that the capacitance of your bus remains very low. (very short lines, don't use 10+ slaves, etc.)

  2. You check that the slaves and the master are OK to work with very slow bus. Some accept arbitrary bus speed as soon as it is below the maximum allowed. (same for rise time of the line)

  3. You are not using a very long bus in a noisy environment.

  4. You accept to be out of spec of the bus you are using. I mean it won't be a condition that was tested against by the I2C things that you use. You won't be able to guarantee for sure that it will work without testing by yourself on a prototype in all operating conditions.


From the ATmega328 datasheet:

The only external hardware needed to implement the bus is a single pull-up resistor for each of the TWI bus lines.

As is stated later in the same section on TWI with the 328:

both bus lines are connected to the positive supply voltage through pull-up resistors. The bus drivers of all TWI-compliant devices are open-drain or open-collector. This implements a wired-AND function which is essential to the operation of the interface. A low level on a TWI bus line is generated when one or more TWI devices output a zero. A high level is output when all TWI devices tri-state their outputs, allowing the pull-up resistors to pull the line high.

The pullup resistors are necessary to generate the necessary logic values to talk to the EEPROM device.

  • 1
    \$\begingroup\$ I realise this is what you're supposed to do, I am looking at what I can get away with! \$\endgroup\$ – ArthurGuy Jul 17 '14 at 11:29
  • \$\begingroup\$ Well, what the Atmel data sheet would be saying to me is that you can't get away with not using the pullup resistors and still have reliable communication. \$\endgroup\$ – craigkoiter Jul 17 '14 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.