Wiring of an DS3231 AT24C32 IIC

Hello.
Recently i purchased an DS3231 AT24C32 IIC after reading some Information about the Module, i downloaded several libraries, including theAT24C1024 library. After i run the Memtest, i came to the conclusion, that i wired up the module incorrectly. Can someone help me to find the correct wiring of the Module.
PS:The RTC part of the module works just fine.

The Module:

My wiring so far:
Arduino Nano: The Module:
GND GND
5V VCC
A5 SCL
A4 SDA
None SQW
None 32K

The code i ran:

/*
  AT24C1024_EEPROM_Benchmark.ino
  AT24C1024 EEPROM Benchmark Sketch 
  http://playground.arduino.cc/Code/I2CEEPROM24C1024
*/

#include <Wire.h>
#include <AT24C1024.h>

unsigned long time;
unsigned long finishTime;
unsigned long errors = 0;
unsigned long address = 0;
byte loop_size;

// Set to a higher number if you want to start at a higher address. 
#define MIN_ADDRESS 0

// Upper boundary of the address space.  Choose one.
#define MAX_ADDRESS 131072 // 1 device
//#define MAX_ADDRESS 262144 // 2 devices
//#define MAX_ADDRESS 393216 // 3 devices
//#define MAX_ADDRESS 524288 // 4 devices

void setup()
{
  // Make sure we aren't reading old data
  randomSeed(analogRead(0));
  loop_size = random(1, 100);
  Serial.begin(9600);
  Serial.println();
  Serial.println("AT24C1024 EEPROM Library Benchmark Sketch");
  Serial.println();
  writeByByteTest();
  readByByteTest();
}

void loop()
{
}

void writeByByteTest()
{
  time = millis();
  errors = 0;
  Serial.println("--------------------------------");
  Serial.println("Write By Byte Test:");
  Serial.println();
  Serial.print("Writing data:");
  for (address = MIN_ADDRESS; address < MAX_ADDRESS; address++)
  {
    EEPROM1024.write(address, (uint8_t)(address % loop_size));
    if (!(address % 5000)) Serial.print(".");
  }
  finishTime = millis() - time;
  Serial.println("DONE");
  Serial.print("Total Time (seconds): "); 
  Serial.println((unsigned long)(finishTime / 1000));
  Serial.print("Write operations per second: "); 
  Serial.println((unsigned long)(MAX_ADDRESS / (finishTime / 1000))); 
  Serial.println("--------------------------------");   
  Serial.println();
}

void readByByteTest()
{
  time = millis();
  errors = 0;
  Serial.println("--------------------------------");
  Serial.println("Read By Byte Test:");
  Serial.println();
  Serial.print("Reading data:");
  for (address = MIN_ADDRESS; address < MAX_ADDRESS; address++)
  {
    uint8_t data;
    data = EEPROM1024.read(address);
    if (data != (uint8_t)(address % loop_size)) 
    {
      Serial.println();
      Serial.print("Address: ");
      Serial.print(address);
      Serial.print(" Should be: ");
      Serial.print((uint8_t)(address % loop_size), DEC);
      Serial.print(" Read val: ");
      Serial.println(data, DEC);
      errors++;
    }
    if (!(address % 5000)) Serial.print(".");
  }
  finishTime = millis() - time;
  Serial.println("DONE");
  Serial.println();
  Serial.print("Total Test Time (secs): "); 
  Serial.println((unsigned long)(finishTime / 1000));
  Serial.print("Read operations per second: "); 
  Serial.println((unsigned long)(MAX_ADDRESS / (finishTime / 1000))); 
  Serial.print("Total errors: "); 
  Serial.println(errors);   
  Serial.println("--------------------------------");
  Serial.println();
}

The outcome:

AT24C1024 EEPROM Library Benchmark Sketch

--------------------------------
Write By Byte Test:

Writing data:...........................DONE
Total Time (seconds): 684
Write operations per second: 191
--------------------------------

--------------------------------
Read By Byte Test:

Reading data:.
Address: 1 Should be: 1 Read val: 0

Address: 2 Should be: 2 Read val: 0

Address: 3 Should be: 3 Read val: 0

Address: 4 Should be: 4 Read val: 0

Address: 5 Should be: 5 Read val: 0

Address: 6 Should be: 6 Read val: 0

Address: 7 Should be: 7 Read val: 0

Address: 8 Should be: 8 Read val: 0

Address: 9 Should be: 9 Read val: 0

Address: 10 Should be: 10 Read val: 0

Address: 11 Should be: 11 Read val: 0

Address: 12 Should be: 12 Read val: 0

Address: 13 Should be: 13 Read val: 0

Address: 14 Should be: 14 Read val: 0

Address: 15 Should be: 15 Read val: 0

Address: 16 Should be: 16 Read val: 0

Address: 17 Should be: 17 Read val: 0

Address: 18 Should be: 18 Read val: 0

Address: 19 Should be: 19 Read val: 0

Address: 20 Should be: 20 Read val: 0

Address: 21 Should be: 21 Read val: 0

Address: 22 Should be: 22 Read val: 0

Address: 23 Should be: 23 Read val: 0

Address: 24 Should be: 24 Read val: 0

Address: 25 Should be: 25 Read val: 0

Address: 26 Should be: 26 Read val: 0

Address: 27 Should be: 27 Read val: 0

Address: 28 Should be: 28 Read val: 0

Address: 29 Should be: 29 Read val: 0

Address: 30 Should be: 30 Read val: 0

Address: 31 Should be: 31 Read val: 0

Address: 32 Should be: 32 Read val: 0

Address: 33 Should be: 33 Read val: 0

Address: 34 Should be: 34 Read val: 0

Address: 35 Should be: 35 Read val: 0

Address: 36 Should be: 36 Read val: 0

Address: 37 Should be: 37 Read val: 0

(It goes on like this forever.)

First thing is to run the i2c scanner program and see if the eeprom is seen at address 0x57 (or possibly 0x50).

// 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() {}

If the eeprom is not seen on the bus, but the rtc part of the module is working correctly, then there is likely something wrong with the eeprom on the module --possibly an open connection to SDA or SCL at the chip or a broken trace.

If the eeprom is indeed seen on the bus, then I question the use of the library for an AT24C1024. That library uses address 0x50 and if the device is at 0x57 then it won't find it. You can try changing the default address in the library, but the device on the ZS 042 is a 32K device, and the register addressing and page size may be different.

I'd start simple. Find the correct eeprom address, then use simple Wire library commands to read and write a byte. The issue where libraries are useful with the external eeproms is in handling page boundaries and block writes crossing page boundaries. I would recommend Jack Christensen's library extEEPROM.h at GitHub - JChristensen/extEEPROM: Arduino library to support external I2C EEPROMs.

PantherPlayz:
Hello.
Recently i purchased an DS3231 AT24C32 IIC after reading some Information about the Module, i downloaded several libraries, including theAT24C1024 library. After i run the Memtest, i came to the conclusion, that i wired up the module incorrectly. Can someone help me to find the correct wiring of the Module.
PS:The RTC part of the module works just fine.

The Module:

My wiring so far:
Arduino Nano: The Module:
GND GND
5V VCC
A5 SCL
A4 SDA
None SQW
None 32K

The code i ran:

/*

AT24C1024_EEPROM_Benchmark.ino
AT24C1024 EEPROM Benchmark Sketch
Arduino Playground - HomePage
*/

#include <Wire.h>
#include <AT24C1024.h>

unsigned long time;
unsigned long finishTime;
unsigned long errors = 0;
unsigned long address = 0;
byte loop_size;

// Set to a higher number if you want to start at a higher address.
#define MIN_ADDRESS 0

// Upper boundary of the address space. Choose one.
#define MAX_ADDRESS 131072 // 1 device
//#define MAX_ADDRESS 262144 // 2 devices
//#define MAX_ADDRESS 393216 // 3 devices
//#define MAX_ADDRESS 524288 // 4 devices

void setup()
{
// Make sure we aren't reading old data
randomSeed(analogRead(0));
loop_size = random(1, 100);
Serial.begin(9600);
Serial.println();
Serial.println("AT24C1024 EEPROM Library Benchmark Sketch");
Serial.println();
writeByByteTest();
readByByteTest();
}

void loop()
{
}

void writeByByteTest()
{
time = millis();
errors = 0;
Serial.println("--------------------------------");
Serial.println("Write By Byte Test:");
Serial.println();
Serial.print("Writing data:");
for (address = MIN_ADDRESS; address < MAX_ADDRESS; address++)
{
EEPROM1024.write(address, (uint8_t)(address % loop_size));
if (!(address % 5000)) Serial.print(".");
}
finishTime = millis() - time;
Serial.println("DONE");
Serial.print("Total Time (seconds): ");
Serial.println((unsigned long)(finishTime / 1000));
Serial.print("Write operations per second: ");
Serial.println((unsigned long)(MAX_ADDRESS / (finishTime / 1000)));
Serial.println("--------------------------------");
Serial.println();
}

void readByByteTest()
{
time = millis();
errors = 0;
Serial.println("--------------------------------");
Serial.println("Read By Byte Test:");
Serial.println();
Serial.print("Reading data:");
for (address = MIN_ADDRESS; address < MAX_ADDRESS; address++)
{
uint8_t data;
data = EEPROM1024.read(address);
if (data != (uint8_t)(address % loop_size))
{
Serial.println();
Serial.print("Address: ");
Serial.print(address);
Serial.print(" Should be: ");
Serial.print((uint8_t)(address % loop_size), DEC);
Serial.print(" Read val: ");
Serial.println(data, DEC);
errors++;
}
if (!(address % 5000)) Serial.print(".");
}
finishTime = millis() - time;
Serial.println("DONE");
Serial.println();
Serial.print("Total Test Time (secs): ");
Serial.println((unsigned long)(finishTime / 1000));
Serial.print("Read operations per second: ");
Serial.println((unsigned long)(MAX_ADDRESS / (finishTime / 1000)));
Serial.print("Total errors: ");
Serial.println(errors);
Serial.println("--------------------------------");
Serial.println();
}




The outcome:


AT24C1024 EEPROM Library Benchmark Sketch


Write By Byte Test:

Writing data:...........................DONE
Total Time (seconds): 684
Write operations per second: 191


Read By Byte Test:

Reading data:.
Address: 1 Should be: 1 Read val: 0

Address: 2 Should be: 2 Read val: 0

Address: 3 Should be: 3 Read val: 0

Address: 4 Should be: 4 Read val: 0

Address: 5 Should be: 5 Read val: 0

Address: 6 Should be: 6 Read val: 0

Address: 7 Should be: 7 Read val: 0

Address: 8 Should be: 8 Read val: 0

Address: 9 Should be: 9 Read val: 0

Address: 10 Should be: 10 Read val: 0

Address: 11 Should be: 11 Read val: 0

Address: 12 Should be: 12 Read val: 0

Address: 13 Should be: 13 Read val: 0

Address: 14 Should be: 14 Read val: 0

Address: 15 Should be: 15 Read val: 0

Address: 16 Should be: 16 Read val: 0

Address: 17 Should be: 17 Read val: 0

Address: 18 Should be: 18 Read val: 0

Address: 19 Should be: 19 Read val: 0

Address: 20 Should be: 20 Read val: 0

Address: 21 Should be: 21 Read val: 0

Address: 22 Should be: 22 Read val: 0

Address: 23 Should be: 23 Read val: 0

Address: 24 Should be: 24 Read val: 0

Address: 25 Should be: 25 Read val: 0

Address: 26 Should be: 26 Read val: 0

Address: 27 Should be: 27 Read val: 0

Address: 28 Should be: 28 Read val: 0

Address: 29 Should be: 29 Read val: 0

Address: 30 Should be: 30 Read val: 0

Address: 31 Should be: 31 Read val: 0

Address: 32 Should be: 32 Read val: 0

Address: 33 Should be: 33 Read val: 0

Address: 34 Should be: 34 Read val: 0

Address: 35 Should be: 35 Read val: 0

Address: 36 Should be: 36 Read val: 0

Address: 37 Should be: 37 Read val: 0



(It goes on like this forever.)

The 24LC32 is only a 4k byte EEPROM So, the max address is on 4095.

This library assumes the EEPROM's I2C bus address starts at 0x50.

It calculates this address by: i2cAddress=(address / 65536)+0x50.

You module looks to me to be addressed at 0x57 and it is only 4096 bytes long.

If you want to use that library try reading and writing an address within that range:

458752 to 462847

Chuck.