Disabling internal pull-up resistors on Arduino board

 The TV’s I2C bus is operating on 3.3V while the internal pull-ups on Arduino boards are connected to 5V. Therefore you need to disable the internal pull-ups on the Arduino (since you will be using the TV’s voltage and A-board pull-up resistors once connected to the set). This can be achieved in software on Uno and Nano boards (probably other boards as well).

Arduino Mega2560 has hardwired 10k resistors for pull-ups which cannot be disabled in software, therefore I would not recommend this board for reading/writing to the TV’s EEPROM as you might damage the TV rendering it unusable.

Disabling internal pull-ups in Arduino IDE 1.0 and later can be realized by editing the file twi.c in the \libraries\Wire\utility\ directory. Close the IDE, open the twi.c file in a text editor (e.g. notepad) and search for the two lines starting with digitalWrite:

// activate internal pullups for twi.
 digitalWrite(SDA, 1);
 digitalWrite(SCL, 1);

To disable the internal pull-ups, simply comment out the two lines:

// activate internal pullups for twi.
// digitalWrite(SDA, 1);
// digitalWrite(SCL, 1);

Save the file close it (make sure the file is saved as twi.c, because notepad sometimes adds .txt extension and you will end up with twi.c.txt file and the original twi.c will not contain the changes, thus you will not have the pull-up resistors disabled). Open Arduino IDE, load the sketch, re-compile, and upload the code to the Arduino board. As verification that the pull-ups are really disabled, when you try to read from our test EEPROM, you won’t be able to read anything. To get the testbed working again, you’ll need to connect two pull-up resistors as described on next page.

Note however, that you won’t need those resistors when connecting directly to the TV, later. So if you don’t have suitable resistors at hand, you can skip the next section.

If you want to keep the usage of internal pull-ups globally and disable them just in our program through the code, follow this link where you’ll find all the details needed to do so and other insight information.

I’ve received a tip from one user, who proceeded straight to MLL reset without using testbed and test M24C64 chip, one of the ways to verify that the internal pull-ups are disabled is to measure voltage between A4/A5 and GND. There should be 0 volts on A4 and A5 when disabled and 5V when enabled.

Next: Altered testbed

2 thoughts on “Disabling internal pull-up resistors on Arduino board

  1. When I disable the pull-up resistors I get nothing in my serial monitor, however when I leave them enabled I get standard
    Reading EEPROM memory from address 0 to 9
    0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
    the board I am using is the Arduino Leonardo. Any idea why this is?

Leave a Reply

Your email address will not be published. Required fields are marked *