Pages: [1]   Go Down
Author Topic: wire without enabling pull up resistors?  (Read 6729 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 140
Arduino for HiFi
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 594
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

0
Offline Offline
Full Member
***
Karma: 0
Posts: 140
Arduino for HiFi
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

UK
Offline Offline
Faraday Member
**
Karma: 17
Posts: 2884
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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.
« Last Edit: November 24, 2010, 05:04:15 am by GrooveFlotilla » Logged

Per Arduino ad Astra

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17253
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 12, 2011, 11:50:59 am by araasch » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 12, 2011, 11:40:18 am by araasch » Logged

0
Offline Offline
Shannon Member
****
Karma: 198
Posts: 11625
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: