Using EEPROM chips?

I managed to salvage two EEPROM chips, Their part number is 93LC66 and its datasheet can be obtained here http://www.datasheetcatalog.org/datasheet2/c/0gw9hfx0jhchwffi4jzgi8elywky.pdf . It has a total of 8 pins and is a DIP shape type of chip. It was in a socket so it came out easily. I'm not quite sure how to interface it with an arduino... Are there any tutorials on a chip similar to mine? Any pointers on how I can get it working?

Thanks ~ReCreate

Looks pretty simply - a chip select, a clock line, data in and data out, plus full timing diagrams.

Maybe not quite simple as hooking it to I2C, but no more than a few dozen lines of code.
If I had one.

Any pointers on how I can get it working?

Pages 6, 7, 8, 9 and 10.

Oh god I hate it when people do this. Is there no tutorial anywhere? Or code samples?

Well, It's been bumped all the way down the page again...

Oh god i hate it when people do this…

Can you be more specific exactly what will satisfy you? You asked for pointers, you've been given some and yet you feel that this is not what you want. In order to not get confusing answers anymore, you can describe it 50-100 sentences your request, what you have done so far, what is your background in programming and electronics, books you have at hand on the topic etc. Then you may get THE answer from someone. So provide your 50+ sentences description and question and you might get an answer. Any further post lacking 50 sentences will be left without an answer. That is how we do things around here

I think he wants someone to draw him a schematic and write him a full sketch to use the eeprom so he can just cut and paste. :stuck_out_tongue:

Well, :-/ Probably not gonna happen…

As the good book says… he helps those that help themselves… :sunglasses:

I made a mistake and had made an assumption. Your chip does not communicate via I2C. The one I’m using is. The following probably won’t help you at all. Sorry.

Maybe this will be of some help. I recently got a DS1307 sample from Dallas Semiconductor. It has 56 bytes of memory. Once I was able to read and write the clock, I learned how to write and read back from its internal memory. Look at the attached code. I made a few changes to read and write to memory. In particular, look at the routines putMemDs1307 and getMemDs1307.

Does this help?

/*
 * RTC Control v.01
 * by <http://www.combustory.com> John Vaughters
 * Credit to:
 * Maurice Ribble - http://www.glacialwanderer.com/hobbyrobotics for RTC DS1307 code
 *
 * With this code you can set the date/time, retreive the date/time and use the extra memory of an RTC DS1307 chip.  
 * The program also sets all the extra memory space to 0xff.
 * Serial Communication method with the Arduino that utilizes a leading CHAR for each command described below. 
 *
 * Commands:
 * T(00-59)(00-59)(00-23)(1-7)(01-31)(01-12)(00-99) - T(sec)(min)(hour)(dayOfWeek)(dayOfMonth)(month)(year) - T Sets the date of the RTC DS1307 Chip. 
 * Example to set the time for 02-Feb-09 @ 19:57:11 for the 3 day of the week, use this command - T1157193020209
 * Q(1-2) - (Q1) Memory initialization  (Q2) RTC - Memory Dump
 *
 * If command = "C" RTC1307 Get Time and Date
 * If command = "P" RTC1307 Get Time and Date and put in memory
 * If command = "G" RTC1307 Get Time and Date from memory and display
 * Analog pin 4 - SDA (pin 5 on DS1307)
 * Analog pin 5 - SCL (pin 6 on DS1307)
 */   

#include <Wire.h>

int clockAddress = 0x68;  // This is the I2C address
int command = 0;  // This is the command char, in ascii form, sent from the serial port     
long previousMillis = 0;  // will store last time Temp was updated
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
byte test; 
byte trial;
// Convert normal decimal numbers to binary coded decimal
byte decToBcd(byte val)
{
  return ( (val/10*16) + (val%10) );
}

// Convert binary coded decimal to normal decimal numbers
byte bcdToDec(byte val)
{
  return ( (val/16*10) + (val%16) );
}

  // 1) Sets the date and time on the ds1307
  // 2) Starts the clock
  // 3) Sets hour mode to 24 hour clock
  // Assumes you're passing in valid numbers, 
  // Probably need to put in checks for valid numbers.

void setDateDs1307()                
{
                              // Use of (byte) type casting and ascii math to achieve result.  
  second = (byte) ((Serial.read() - 48) * 10 + (Serial.read() - 48)); 
  minute = (byte) ((Serial.read() - 48) *10 +  (Serial.read() - 48));
  hour  = (byte) ((Serial.read() - 48) *10 +  (Serial.read() - 48));
  dayOfWeek = (byte) (Serial.read() - 48);
  dayOfMonth = (byte) ((Serial.read() - 48) *10 +  (Serial.read() - 48));
  month = (byte) ((Serial.read() - 48) *10 +  (Serial.read() - 48));
  year= (byte) ((Serial.read() - 48) *10 +  (Serial.read() - 48));
  Wire.beginTransmission(clockAddress);
  Wire.send(0x00);
  Wire.send(decToBcd(second));  // 0 to bit 7 starts the clock
  Wire.send(decToBcd(minute));
  Wire.send(decToBcd(hour));    // If you want 12 hour am/pm you need to set
  // bit 6 (also need to change readDateDs1307)
  Wire.send(decToBcd(dayOfWeek));
  Wire.send(decToBcd(dayOfMonth));
  Wire.send(decToBcd(month));
  Wire.send(decToBcd(year));
  Wire.endTransmission();
}

                              // Gets the date and time from the ds1307 and prints result

void getDateDs1307() {        // Reset the register pointer
  Wire.beginTransmission(clockAddress);
  Wire.send(0x00);
  Wire.endTransmission();

  Wire.requestFrom(clockAddress, 7);

                              // A few of these need masks because certain bits are control bits

  second     = bcdToDec(Wire.receive() & 0x7f);
  minute     = bcdToDec(Wire.receive());
  
                              // Need to change this if 12 hour am/pm
  hour       = bcdToDec(Wire.receive() & 0x3f);  
  dayOfWeek  = bcdToDec(Wire.receive());
  dayOfMonth = bcdToDec(Wire.receive());
  month      = bcdToDec(Wire.receive());
  year       = bcdToDec(Wire.receive());

  Serial.print(hour, DEC);
  Serial.print(":");
  Serial.print(minute, DEC);
  Serial.print(":");
  Serial.print(second, DEC);
  Serial.print("  ");
  Serial.print(month, DEC);
  Serial.print("/");
  Serial.print(dayOfMonth, DEC);
  Serial.print("/");
  Serial.print(year, DEC);

}

void getTimeDs1307() {
  Wire.beginTransmission(clockAddress);
  Wire.send(0x00);                        // Reset the register pointer
  Wire.endTransmission();

  Wire.requestFrom(clockAddress, 7);

  second     = (Wire.receive() & 0x7f);
  minute     = (Wire.receive());
  hour       = (Wire.receive() & 0x3f);  
  dayOfWeek  = (Wire.receive());
  dayOfMonth = (Wire.receive());
  month      = (Wire.receive());
  year       = (Wire.receive());
}

void putMemDs1307() {
  //get the time from the clock and then put into memory address 0x08
  //this routine can be used for data logging purposes
  Wire.beginTransmission(clockAddress);
  Wire.send(0x08);
  Wire.send(second);
  Wire.send(minute);
  Wire.send(hour);
  Wire.send(dayOfWeek);
  Wire.send(dayOfMonth);
  Wire.send(month);
  Wire.send(year);
  
  Wire.endTransmission();
  
/*  The following is commented out.  It was originally used to see what was being put into memory
    and then compared to what I pulled from memory.  One I was comfortable with the results,
    I no longer used this code.
 
  Serial.print(hour, DEC);
  Serial.print(":");
  Serial.print(minute, DEC);
  Serial.print(":");
  Serial.print(second, DEC);
  Serial.print("  ");
  Serial.print(month, DEC);
  Serial.print("/");
  Serial.print(dayOfMonth, DEC);
  Serial.print("/");
  Serial.print(year, DEC);
*/
}

void getMemDs1307() {
  // Get the contents of memory location 0x08 and send to the PC for display
  Wire.beginTransmission(clockAddress);
  Wire.send(0x08);
  Wire.endTransmission();

  Wire.requestFrom(clockAddress, 7);  //request 7 bytes from the clock

                              // A few of these need masks because certain bits are control bits

  second     = bcdToDec(Wire.receive() & 0x7f);   //byte #1
  minute     = bcdToDec(Wire.receive());          //byte #2
  hour       = bcdToDec(Wire.receive() & 0x3f);   //byte #3...
  dayOfWeek  = bcdToDec(Wire.receive());
  dayOfMonth = bcdToDec(Wire.receive());
  month      = bcdToDec(Wire.receive());
  year       = bcdToDec(Wire.receive());
  
  Serial.print(hour, DEC);                   //print the values to the PC
  Serial.print(":");
  Serial.print(minute, DEC);
  Serial.print(":");
  Serial.print(second, DEC);
  Serial.print("  ");
  Serial.print(month, DEC);
  Serial.print("/");
  Serial.print(dayOfMonth, DEC);
  Serial.print("/");
  Serial.print(year, DEC);

}  

void setup() {
  Wire.begin();
  Serial.begin(57600);

}

void loop() {
  if (Serial.available()) {   // Look for char in serial que and process if found
    command = Serial.read();
    if (command == 84) {      //If command = "T" Set Date
      setDateDs1307();
      getDateDs1307();
      Serial.println(" ");
    }
    else if(command == 67){ //If command = "C" RTC1307 Get Time and Date
      getDateDs1307();
      Serial.println(" ");
    }
    else if(command == 80){ //If command = "P" RTC1307 Get Time and Date and put in memory
      getTimeDs1307();
      putMemDs1307();
      Serial.println(" ");
    }
    else if(command == 71){ //If command = "G" RTC1307 Get Time and Date from memory and display
      getMemDs1307();
      Serial.println(" ");
    }
    
    else if (command == 81) { //If command = "Q" RTC1307 Memory Functions
      delay(100);     
      if (Serial.available()) {
        command = Serial.read(); 
        
                              // If command = "1" RTC1307 Initialize Memory - All Data will be set to 255 (0xff).  
                              // Therefore 255 or 0 will be an invalid value.  
        if (command == 49) { 
          
                              // 255 will be the init value and 0 will be cosidered an error that 
                              // occurs when the RTC is in Battery mode. 
          Wire.beginTransmission(clockAddress);
          
                              // Set the register pointer to be just past the date/time registers.
          Wire.send(0x08);  
          for (int i = 1; i <= 27; i++) {
            Wire.send(0xff);
            delay(100);
          }   
          Wire.endTransmission();
          getDateDs1307();
          Serial.println(": RTC1307 Initialized Memory");
        }
        else if (command == 50) {      //If command = "2" RTC1307 Memory Dump
          getDateDs1307();
          Serial.println(": RTC 1307 Dump Begin");
          Wire.beginTransmission(clockAddress);
          Wire.send(0x00);
          Wire.endTransmission();
          Wire.requestFrom(clockAddress, 64);
          for (int i = 1; i <= 64; i++) {
            test = Wire.receive();
            Serial.print(i);
            Serial.print(":");
            Serial.println(test, DEC);
          }
          Serial.println(" RTC1307 Dump end");
        } 
      }  
    }
    Serial.print("Command: ");
    Serial.println(command);  // Echo command CHAR in ascii that was sent
  }

  command = 0;                // reset command                  
  delay(100);
}

Actually, the good book does not say that...

Can you be more specific exactly what will satisfy you?

A tutorial.

I made a mistake and had made an assumption. Your chip does not communicate via I2C. The one I’m using is. The following probably won’t help you at all. Sorry.

Maybe this will be of some help. I recently got a DS1307 sample from Dallas Semiconductor. It has 56 bytes of memory. Once I was able to read and write the clock, I learned how to write and read back from its internal memory. Look at the attached code. I made a few changes to read and write to memory. In particular, look at the routines putMemDs1307 and getMemDs1307.

Does this help?

Ummm, Didn’t you say it won’t help me at all?
Edit: No it won’t >_< Like you said it won’t help. I’m afraid…

Oh god I hate it when people do this. Is there no tutorial anywhere? Or code samples?

obviously not

Here's a radical idea, ReCreate - why not spend less time bumping your posts, and actually coding?

Actually, the good book does not say that...

depends on which good book you're reading.... :D

Sorry, I couldn't resist...

Here's a radical idea, ReCreate - why not spend less time bumping your posts, and actually coding?

I can't because something's stopping me. I don't know how to properly interface with these goddamn eeprom chips.

obviously not

Well then i give up, fuck these eeprom chips. fuck them all >_> edit: fail filter is fail

I can't because something's stopping me

And that "something" would be...? Impatience?

Look, the datasheet has all you need.

The clock has maximum specifications; working on a 16MHz processor in C, you're unlikely to break those specs.

Or, continue to spit out your dummy (pacifier) when you don't get your answers.

And that "something" would be...?

Look, the datasheet has all you need.

The clock has maximum specifications; working on a 16MHz processor in C, you're unlikely to break those specs.

Or, continue to spit out your dummy (pacifier) when you don't get your answers.

It does not, I need some explanation on how to do it. I don't even understand the diagrams.

I don't know how to properly interface with these goddarn eeprom chips

Page 2, DC characteristics. Page 3, Synchronous data timing

[edit]

I don't even understand the diagrams.

So, start simple and build up to it, so that you understand the principles. Like we did.[/edit]

Explain this $hit. In what scale are the numbers in? What do the numbers represent? and see next to were it says do, does that mean i need to have it high and low at the same time?

Explain this $hit. In what scale are the numbers in?

Moderate your language, please.

The "scale" is in the table immediately above the figure you posted.

do, does that mean i need to have it high and low at the same time?

? Do is "Data Out" - it's what the device gives to you - how do expect to have a digital line both high and low at the same time? Think.

Here's a library for a similar class of device. See if you can work through this one. http://www.arduino.cc/playground/Main/MAX6675Library

Oh sorry, Ive been having a bad day. Anyways, I just realized that. And in that link you gave me, What would be the equivalent of the CS,SO and SCK pins?

how do expect to have a digital line both high and low at the same time.

That is what i was complaining about.