Go Down

Topic: wire without enabling pull up resistors? (Read 8178 times) previous topic - next topic

glt

It would be nice to have a flag to disable the internal pull up resistors in i2c and implement external pull ups to 3.3V

frank26080115

I have been forced to modify twi.c myself to accomplish what you want.

It might be hard to have a software flag enable pull-ups to another voltage though, you should either implement the resistors externally, or run the AVR at 3.3V at 8 MHz
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

glt

Agree. I guess I am proposing a flag to just disable the automatic pull ups.

Groove

#3
Nov 24, 2010, 10:52 am Last Edit: Nov 24, 2010, 11:04 am by GrooveFlotilla Reason: 1
@Frank:  why were you 'forced' to change the library?
Once you've called 'tw_init', you can do what you like with the pull-ups.
No need to modify the library.
Per Arduino ad Astra

NoWorries

I agree with the original post.  If one has a I2C device that is powered by 3.3V and is not 5V tolerant, using the current Wire library will cause 5V to be applied through the internal pullup resistors of the Atmel part to the I2C device.  If you correct this by just disabling the pullups after calling tw_init() the I2C device has already had 5V applied to it, which is out of its specifications.  It would be better to pass in a parameter to Wire::Begin() which never enables the internal pullups.  Then by using external pullups to 3.3V both the I2C device and the Atmel part will be happy.

Jose Francisco

Hello.

I'm using a DS1307 I2C RTC and external 2k2 pull-up resistors like shown in this page:

http://www.glacialwanderer.com/hobbyrobotics/?p=12

Are these external resistors required?
Is Arduino using internal pull-up resistors?

Thanks

retrolefty

Well keep in mind that the internal pull-up resistors are of a pretty high value, 40K or over as I recall, so even if wired to non-tolerant 3.3vdc input devices, I wouldn't expect any damage due to that high current limiting resistance, it may even work.

Lefty

NoWorries

#7
Jan 12, 2011, 04:29 pm Last Edit: Jan 12, 2011, 05:50 pm by araasch Reason: 1
Lefty:  When a semiconductor manufacturer publishes absolute maximum specs, they are indicating that they do not test nor guarantee the behavior of their products when used outside of the specs.  While I agree that many devices will probably not be permantely harmed by the small current the weak pullups will deliver, that is not to say that some may not suffer permanent damage.

It is better to adhere to the specs. in my opinion.

A simple change to the Wire class could add an additional Wire.enable_pullups() function which could be called in setup() after Wire.begin().

This would allow the end user to easily select the behavior they desire.

BTW, the minimum value for the pullup resistors on the ATMEGA328P part is shown as 20K.  This could cause a whopping 85 microamps of current to flow into a 3.3 volt part's pin.  While this is not exactly likely to cause a part to meltdown, it is also better to remain within the part's specs.

NoWorries

#8
Jan 12, 2011, 04:36 pm Last Edit: Jan 12, 2011, 05:40 pm by araasch Reason: 1
Jose:  The external resistors shown are probably not necessary.

The default Wire library enables the internal pullup resistors of the Arduino.

In fact, an update on the website you referred to notes this.

The only potential issue is that the internal pullup resistors are larger than that you are currently using, so it is possible that if your cable length going to the RTC is too long that the capacitance of the cable will cause the signals to be corrupted.

You probably do not have long signal wires going to RTC.

Just remove the external resistors and give it a try.

MarkT

Quote
It would be nice to have a flag to disable the internal pull up resistors in i2c and implement external pull ups to 3.3V


Just use external 4k7 pull-ups to 3V3, the internal pullups won't be able to compete and it'll just work without modification.
[ I won't respond to messages, use the forum please ]

Go Up