Go Down

Topic: Programming the PH29EE010 EEPROM. Im Confused! (Read 98 times) previous topic - next topic

aLagger

Hi Guys, For a few days now I've been trying to program the PH29EE010 EEPROM that I found in a closet; I've found the datasheet (very easy to find) and I'm trying to program it but I don't know how to read the timing diagram properly and I just get confused, I can't figure out how to program it with my Arduino Mega.



So Far I have come up with this:


Code: [Select]

const int DQ0 = 22;
const int DQ1 = 23;
const int DQ2 = 24;
const int DQ3 = 25;
const int DQ4 = 26;
const int DQ5 = 27;
const int DQ6 = 28;
const int DQ7 = 29;

const int A16 = 53;

const int OE = 4;
const int CE = 3;
const int WE = 2;

void setup() {
  pinMode(CE, OUTPUT);
  pinMode(WE,OUTPUT);
  pinMode(OE,OUTPUT);
  pinMode(A0,OUTPUT);
  pinMode(A1,OUTPUT);
  pinMode(A2,OUTPUT);
  pinMode(A3,OUTPUT);
  pinMode(A4,OUTPUT);
  pinMode(A5,OUTPUT);
  pinMode(A6,OUTPUT);
  pinMode(A7,OUTPUT);
  pinMode(A8,OUTPUT);
  pinMode(A9,OUTPUT);
  pinMode(A10,OUTPUT);
  pinMode(A11,OUTPUT);
  pinMode(A12,OUTPUT);
  pinMode(A13,OUTPUT);
  pinMode(A14,OUTPUT);
  pinMode(A15,OUTPUT);
  pinMode(A16,OUTPUT);
  pinMode(DQ0,OUTPUT);
  pinMode(DQ1,OUTPUT);
  pinMode(DQ2,OUTPUT);
  pinMode(DQ3,OUTPUT);
  pinMode(DQ4,OUTPUT);
  pinMode(DQ5,OUTPUT);
  pinMode(DQ6,OUTPUT);
  pinMode(DQ7,OUTPUT);
  PgWriteCycle(1,0,0,0,0,0,0,1,0,1,0,1,0,1,0);
  StBY();
  delay(100);
  PgWriteCycle(0,1,0,0,0,0,0,1,0,1,0,1,0,1,0);
  StBY();

}

void loop() {
  // put your main code here, to run repeatedly:
  READ(1,0,0,0,0,0,0);
  delay(1000);
  READ(0,1,0,0,0,0,0);
  delay(1000);

}
void StBY() {
    delay(1);
    digitalWrite(CE, HIGH);
    digitalWrite(WE, LOW);
    digitalWrite(OE, LOW);
    digitalWrite(A0, LOW);
    digitalWrite(A1, LOW);
    digitalWrite(A2, LOW);
    digitalWrite(A3, LOW);
    digitalWrite(A4, LOW);
    digitalWrite(A5, LOW);
    digitalWrite(A6, LOW);
    digitalWrite(A7, LOW);
    digitalWrite(A8, LOW);
    digitalWrite(A9, LOW);
    digitalWrite(A10, LOW);
    digitalWrite(A11, LOW);
    digitalWrite(A12, LOW);
    digitalWrite(A13, LOW);
    digitalWrite(A14, LOW);
    digitalWrite(A15, LOW);
    digitalWrite(A16, LOW);
    digitalWrite(DQ0, LOW);
    digitalWrite(DQ1, LOW);
    digitalWrite(DQ2, LOW);
    digitalWrite(DQ3, LOW);
    digitalWrite(DQ4, LOW);
    digitalWrite(DQ5, LOW);
    digitalWrite(DQ6, LOW);
    digitalWrite(DQ7, LOW);
}
void PgWriteCycle (int Ad0, int Ad1,int Ad2, int Ad3, int Ad4, int Ad5, int Ad6, int D0, int D1, int D2, int D3, int D4, int D5, int D6, int D7) {
  digitalWrite(CE, HIGH);
  digitalWrite(A0, 1);
  digitalWrite(A1, 0);
  digitalWrite(A2, 1);
  digitalWrite(A3, 0);
  digitalWrite(A4, 1);
  digitalWrite(A5, 0);
  digitalWrite(A6, 1);
  digitalWrite(A7, 0);
  digitalWrite(A8, 1);
  digitalWrite(A9, 0);
  digitalWrite(A10, 1);
  digitalWrite(A11, 0);
  digitalWrite(A12, 1);
  digitalWrite(A13, 0);
  digitalWrite(A14, 1);
  digitalWrite(A15, 0);
  digitalWrite(A16, 0);
  digitalWrite(DQ0, 1);
  digitalWrite(DQ1, 0);
  digitalWrite(DQ2, 1);
  digitalWrite(DQ3, 0);
  digitalWrite(DQ4, 1);
  digitalWrite(DQ5, 0);
  digitalWrite(DQ6, 1);
  digitalWrite(DQ7, 0);
  digitalWrite(CE, LOW);
  delay(1);
  digitalWrite(CE, HIGH);
  delay(1);
  digitalWrite(A0, 0);
  digitalWrite(A1, 0);
  digitalWrite(A2, 1);
  digitalWrite(A3, 0);
  digitalWrite(A4, 1);
  digitalWrite(A5, 0);
  digitalWrite(A6, 1);
  digitalWrite(A7, 0);
  digitalWrite(A8, 1);
  digitalWrite(A9, 0);
  digitalWrite(A10, 1);
  digitalWrite(A11, 0);
  digitalWrite(A12, 1);
  digitalWrite(A13, 0);
  digitalWrite(A14, 1);
  digitalWrite(A15, 0);
  digitalWrite(A16, 0);
 
  digitalWrite(DQ0, 0);
  digitalWrite(DQ1, 1);
  digitalWrite(DQ2, 0);
  digitalWrite(DQ3, 1);
  digitalWrite(DQ4, 0);
  digitalWrite(DQ5, 1);
  digitalWrite(DQ6, 0);
  digitalWrite(DQ7, 1);
  digitalWrite(CE, LOW);
  delay(1);
  digitalWrite(CE, HIGH);
  delay(1);
  digitalWrite(A0, 1);
  digitalWrite(A1, 0);
  digitalWrite(A2, 1);
  digitalWrite(A3, 0);
  digitalWrite(A4, 1);
  digitalWrite(A5, 0);
  digitalWrite(A6, 1);
  digitalWrite(A7, 0);
  digitalWrite(A8, 1);
  digitalWrite(A9, 0);
  digitalWrite(A10, 1);
  digitalWrite(A11, 0);
  digitalWrite(A12, 1);
  digitalWrite(A13, 0);
  digitalWrite(A14, 1);
  digitalWrite(A15, 0);
  digitalWrite(A16, 0);
 
  digitalWrite(DQ0, 1);
  digitalWrite(DQ1, 0);
  digitalWrite(DQ2, 1);
  digitalWrite(DQ3, 0);
  digitalWrite(DQ4, 0);
  digitalWrite(DQ5, 0);
  digitalWrite(DQ6, 0);
  digitalWrite(DQ7, 0);
  digitalWrite(CE, LOW);
  delay(1);
  digitalWrite(CE, HIGH);
  delay(1); 
  digitalWrite(A0, Ad0);
  digitalWrite(A1, Ad1);
  digitalWrite(A2, Ad2);
  digitalWrite(A3, Ad3);
  digitalWrite(A4, Ad4);
  digitalWrite(A5, Ad5);
  digitalWrite(A6, Ad6);
  digitalWrite(A7, 0);
  digitalWrite(A8, 0);
  digitalWrite(A9, 0);
  digitalWrite(A10, 0);
  digitalWrite(A11, 0);
  digitalWrite(A12, 0);
  digitalWrite(A13, 0);
  digitalWrite(A14, 0);
  digitalWrite(A15, 0);
  digitalWrite(A16, 0);
  delay(1);
  digitalWrite(DQ0, D0);
  digitalWrite(DQ1, D1);
  digitalWrite(DQ2, D2);
  digitalWrite(DQ3, D3);
  digitalWrite(DQ4, D4);
  digitalWrite(DQ5, D5);
  digitalWrite(DQ6, D6);
  digitalWrite(DQ7, D7);
}

void READ(int Ad0, int Ad1,int Ad2, int Ad3, int Ad4, int Ad5, int Ad6) {
    digitalWrite(CE, HIGH);
    digitalWrite(WE, LOW);
    digitalWrite(OE, LOW);
    digitalWrite(A0, Ad0);
    digitalWrite(A1, Ad1);
    digitalWrite(A2, Ad2);
    digitalWrite(A3, Ad3);
    digitalWrite(A4, Ad4);
    digitalWrite(A5, Ad5);
    digitalWrite(A6, Ad6);
    digitalWrite(CE, LOW);
    digitalWrite(WE, HIGH);
    digitalWrite(OE, LOW);
}


But it doesn't seem to work. Any help is appreciated. (btw I have attached the datasheet I'm getting my info from).

Also for my address bits, I have used the analog ports (A0 - A15) on the Arduino Mega just to save time in defining pins

Go Up