DS1307 acting strange

Hi,

I have a DS1307 witch was working fine but i changed the I2C clock to fast mode (400KHz) but forgot that the DS1307 wasn't compatible.
I removed the line from my code

#include <Wire.h>

void setup()
{
  Wire.begin();
  Serial.begin(9600);
  Serial.println("\nI2C Scanner");
}

void loop()
{
  byte error, address;
  int nDevices;
  Serial.println("Scanning...");
  nDevices = 0;
  for(address = 1; address < 120; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");
      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknow error at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");
  delay(5000);           // wait 5 seconds for next scan
}

Now the DS1307 is sometimes seen and other times not seen by the arduino.

Someone an idea?
I will buy a new IC if I can find some time tomorrow

Kind regards

Koen

Having a too fast I2C signal, making the DS1307 not being recognized all the time when speed is back to normal ?
That doesn't make sense to me.

Do you use a bread board ? they make bad contact now and then.
Do you use pull-up resistors on the I2C bus ? 4k7 would be best.
Is the DS1307 at 5V and not at the 3.3V ?

Hi,

Ever item connected to the I2C is seen
I have
1 LCD backpack (0x20)
1 PCF8574 (0x22)
1 HYT-273 (0x28)
1 PCA9689 (0x40) + (0x70)
1 DS1307 (0x68)

Scanning...
I2C device found at address 0x20  !
I2C device found at address 0x22  !
I2C device found at address 0x28  !
I2C device found at address 0x40  !
I2C device found at address 0x70  !
done

I have connected the Vin to a 5V switching regulator and this regulator is providing 5V to all me I2C boards
Below you can see me setup

Kind regards

Koen

Thanks for explaining and the photo.

You have to carefully check every I2C module for pull-up resistors.
I think I see as many as 4 pull-up resistors on the various modules.
The goal is to have a single pull-up of 4k7 for both SDA and SCL.

If you have a mixture of 3.3V and 5V I2C devices, you should use a I2C level shifter.

The DS1307 could be too weak to handle the many pull-up resistors.

Hi Erdin,

Thx for your reply.
I will test this evening with only the RTC connected. If that works then i will check the schematics of every board for the pull-up resistors and remove them.

Most boards are smd ones :s

Kind regards

Koen

I tested today with only the DS1307 and the display connected but the DS1307 is not seen.

I will buy tommorom a new DS1307 an will test it with the new one.

kind regards

Koen

Hi,

Trouble shooting is again going on.
I installed a brand new DS1307. This one is a gain seen when it is connected to the bus.
I also removed pull-up except form the LCD backpack (2x4K7).
I added the PCF8575, everything OK
I added the HYT-271, everything OK
I added the PCA9685, DS1307 not seen anymore.

I installed a hardware bridge between the VCC and the +V on the servo connector.
I found in the schematic that there was a P MOSFET installed beween the +V input and the +V on the servo connectors.
I removed the bridge between the 2 pins.

Still no improvement.

Connected my TDS210 to the SDA and the SCL and the levels seems to be OK.

I connected only the DS1307 and PCA9685.
Only the PCA9685 is seen.

Now when I connect only the GND and the VCC on the PCA9685 the DS1307 is not seen.

I checked the output voltage of me switching regulator and i had only 3.6V
The input voltage off the switching regulator is taken from the arduino Vin.
This voltage is 4,5 Volt.

Now i found me problem...
I powered the arduino only with USB instead of using the external 12V power supply

Scanning...
I2C device found at address 0x20  !
I2C device found at address 0x22  !
I2C device found at address 0x28  !
I2C device found at address 0x40  !
I2C device found at address 0x68  !
I2C device found at address 0x70  !
done

Erdin thanks a lot for the support

Kind regards

I'm glad you found the problem.
So the DS1307 was the first chip to fail with low voltage.
And the old DS1307 is still working ?