I2C on Arduino Duemilanove

Good afternoon,

I have an Arduino Duemilanove but I can not put the i2c to work, my doubt is whether it is supposed between SCL and the ground is supposed to have 100Ohms and between the SDA and the ground is supposed to have 400Ohms.

Best Regards.

Hi, welcome to the forum.

You don't need resistors to GND. For a 5V sensor a 4k7 from SDA to 5V and 4k7 from SCL to 5V can be used, but it will probably work without. Which I2C device do you have ? is it a module ? can you give a link to the module you have ?

Thanks for the quick response.

I'm trying to use a lcd with byvac 4218 but I can not use a scanner i2c because the Arduino hangs in wire.endtransmission.

Already tried using 2 resistances (10K AND 5K) on SDA and SCL.

I asked about the values of the SCL and SDA to the ground to see if he had no short circuit. The resistance values were read with everything disconnected of the board and no power on.

If you disconnect all devices from the Arduino and run the I2C scanner does it hang, or does it show zero devices. If it hangs with nothing connected, it is possibly a defective library install, or a defective Arduino. If the scanner runs as expected with nothing connected, then there is some issue with the I2C device.

Use of the Wire library enables the internal pullups to 5v on SDA/SCL and is often adequate.

// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup() {
  Serial.begin (115200);

  // Leonardo: wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

Yes my arduino hangs with everything disconnected i was using exactly that i2c scanner.

Thats why i suspect the board.

Any ideia whats the problem or way to solve it?

Using Google on this problem in the past, I have seen two possible causes. A corrupted version of the Wire library, or an internal short on SDA/SDL.

my doubt is whether it is supposed between SCL and the ground is supposed to have 100Ohms and between the SDA and the ground is supposed to have 400Ohms.

I'm not quite sure what you are saying, but if these are measured resistances and not a question about pullups, it doesn't seem correct. On my Duemilanova I measure 10-12 Megohm between both SDA and SCL to ground with everything turned off and disconnected. I think you would have some sort of internal short to see your values.

If you are not measuring the low resistance values on the pins, I would first try to reinstall the wire library. I don't know if there is any way to download it separately. It is bundled with the IDE and you may have to reinstall that.

I have already tried to reinstall IDE several times with no result. The problem is mainly on twi communication and not on wire library.

It seemed me strange to have 100Ω and 400Ω to the ground.

Board problem or atmega 328 problem?

Disconnect all the wires and resistors, and run the i2c_scanner. If that hangs at Wire.endTransmission() then the board or the ATmega chip is broken.

You could check with a magnifier if there is a shortcut, or bad soldering on the pcb.

The problem is mainly on twi communication and not on wire library.

You are correct of course, but the twi library comes bundled within Wire in the IDE and I was speaking broadly.

If you have the socketed version of the 328, you can pull it and test the board without the processor.

There are other functions on the SDA/SCL pins (PCINT 12 and 13) as well as the analog functions. Can you do an analog read on A4/A45? They probably are not working as well, but if there is an internal chip short on only the SDA/SDL they might.

Yes i have a socketed version. How do i test the board without the 328?

I can't do an analog read on A4/A5.

Without the 328 in place i get no values of resistance on SDA and SCL to the ground.

Without the 328 in place i get no values of resistance on SDA and SCL to the ground.

If this is high resistance on the SDA/SCL pins on the board to board ground then it sounds like the problem is on the chip and not the board. Do you have a data sheet for the 328. I suppose you could read from the pins on the chip (28 and 27) to the ground on the chip (8,22) and see what you get.

The read on the chip was the 100Ω ( pin 28 to ground pin 22 ) and 800Ω ( pin 27 to ground pin 22)

Sounds like the chip is bad and the board is good.

Edit [AFmMz -- Dou you know the history of this board? I wonder if this is what happens if an analog input on A4/A5 sees more than 5V or negative voltage?]

Sounds like the chip is bad and the board is good.

I agree with you.

Yes the board was bought new and was with me for 4 years. I don't remember any problems with it