Memory Module Fast – 1

This Memory module has a total of 64Kb capacity split into two chips each one of 32Kb. I am using SMD chips for this, IS62C256AL-45ULI for RAM and STK11C88 for ROM both at 45ns so i can use this up to 20Mhz system clock. Because the eeprom chip is smd and cannot be programmed off system i incorporated into this pcb the ability to be programmed by using an Arduino Mega. All you have to do is take the module off put it on the Arduino mega make some connections and use a software to program it.

There are two jumpers or switches on the top left corner (JP_ROM) to help you select which chip is on the upper 32KB and which on the lower. These jumpers should be opposite to each other. Next jumper VCC_SW selects the power should be on SYS when on the Mainboard and on PRG when on the Arduino. The WE_ROM_SW selects between system controlled (SYS) or arduino controlled (PRG) WE signal on EEprom. Next to this is the connector for the arduino for the WE,CE,RD signals.

Both jumper cables (yellow and white) provide support for the system to control if ROM is Writeable or not by issuing an OUT command. You can disable this by using the WE_ROM_SW (leave it on PRG).

The second JP_ROM switch that control the EPROM should be a jumper and not a switch otherwise you can not program the chip, beacuse this needs to be off when programming via Arduino.

Programmer

Memory Module on Arduino Mega for programming

Arduino Pins 23 to 53 (Odd ones) are used for address bus, Pins 38 to 52 (even ones) are used for data bus. You plug the board on the address pins and put an 8 bus cable for the data as seen on the picture. Pin 5 is RD, Pin 6 is CE, and Pin 7 is WE. Connect 5V to VCC on the module GND can be left disconnected. Both switches should be on PRG, JP_ROM should be removed. The following program is for the Arduino MEGA (firmware). You can download the windows application to program the EEPROM chip.



const byte AddrPins[] = {53,51,49,47,45,43,41,39,37,35,33,31,29,27,25,23 }; 
const byte DataPins[] = {38, 40, 42, 44, 46, 48, 50, 52}; 
const byte WR= 7;
const byte CE= 6;
const byte RD= 5;

void setDataInput(){
  for (int i=0;i<8;i++){
    pinMode(DataPins[i],INPUT);
  }
}

void setDataOutput(){
  for (int i=0;i<8;i++){
    pinMode(DataPins[i],OUTPUT);
  }  
}

void setAddr(unsigned int ad){
 unsigned int b;

  for (int i=0;i<16;i++){
   b=ad & (1 << i);
   if (b==0) digitalWrite(AddrPins[i],LOW);
    else digitalWrite(AddrPins[i],HIGH);    
  } 
}

void setData(byte dat){
 byte b;

  for (int i=0;i<8;i++){
   b=dat & (1 << i);
   if (b==0) digitalWrite(DataPins[i],LOW);
    else digitalWrite(DataPins[i],HIGH);    
  }  
}

byte getData(){
byte b;

  b=0;
  for (int i=0;i<8;i++){
    if (digitalRead(DataPins[i])==HIGH)
      b|= (1 << i);
  }
  return b;
}

byte readByte(unsigned int addr){
  byte b;

  setAddr(addr);
  digitalWrite(WR,HIGH);  
  setDataInput();
  digitalWrite(CE,LOW);        
  digitalWrite(RD,LOW);  
  b=getData();
  digitalWrite(RD,HIGH);
  return b;
}

void doMultiRead(unsigned int addr, unsigned int lensize){
byte b;
unsigned int i;

  //Serial.println(addr);    
  //Serial.println(lensize);    
  setAddr(addr);
  digitalWrite(WR,HIGH);   
  setDataInput();
  digitalWrite(CE,LOW);  
  for (i=0;i<lensize;i++){      
      digitalWrite(RD,LOW);
      b=getData();      
      digitalWrite(RD,HIGH);      
      Serial.write(b);
      addr++;
      setAddr(addr);
     }
}

void writeByte(unsigned int addr,byte b){
  digitalWrite(RD,HIGH);
  setDataOutput();
  setAddr(addr);
  setData(b);  
  digitalWrite(CE,LOW);
  digitalWrite(WR,LOW);
  digitalWrite(WR,HIGH);  
}

void doMultiWrite(unsigned int addr,unsigned int lensize){
byte b;
unsigned int i;
  
  digitalWrite(RD,HIGH);
  setDataOutput();
  digitalWrite(CE,LOW);  
  i=0;
  do {
     setAddr(addr);
     if (Serial.available() > 0) {
      b=Serial.read();
      setData(b);
      digitalWrite(WR,LOW);
      digitalWrite(WR,HIGH);      
      i++;addr++;
     }
  } while (i<lensize);
}

void doPermanent(){
const unsigned int Addresses[] = {0x0E38, 0x31C7, 0x03E0, 0x3C1F, 0x303F, 0x0FC0}; 

  setDataInput();
  digitalWrite(RD,LOW);
  digitalWrite(CE,HIGH);
  digitalWrite(WR,HIGH);
  for (int i=0;i<6;i++){
    setAddr(Addresses[i]);
    digitalWrite(CE,LOW);
    digitalWrite(CE,HIGH);
  }
  digitalWrite(RD,HIGH);
}

void doRecall(){
const unsigned int Addresses[] = {0x0E38, 0x31C7, 0x03E0, 0x3C1F, 0x303F, 0x0C63}; 

  setDataInput();
  digitalWrite(RD,LOW);
  digitalWrite(CE,HIGH);
  digitalWrite(WR,HIGH);
  for (int i=0;i<6;i++){
    setAddr(Addresses[i]);
    digitalWrite(CE,LOW);
    digitalWrite(CE,HIGH);
  }
  digitalWrite(RD,HIGH);
}


void showMenu(){
  Serial.println(" ");
  Serial.println("========================================");
  Serial.println("r:read byte (r addr)");
  Serial.println("w:write byte (w addr,byte)");
  Serial.println("br:binary read bytes (br addr,length)");
  Serial.println("bw:binary write bytes (bw addr,length)");
  Serial.println("q:permanent save bytes");
  Serial.println("z:recall bytes");
}


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

  for (int i=0;i<16;i++){
    pinMode(AddrPins[i],OUTPUT);
  }    
  pinMode(WR,OUTPUT);
  pinMode(CE,OUTPUT);
  pinMode(RD,OUTPUT);

  Serial.println("Intialisation complete");  
  showMenu();
}

void loop() {
char c;
unsigned int addr,nobytes;
byte b;
String s,s1,s2;

  // put your main code here, to run repeatedly:
  if (Serial.available() > 0) {
   c=Serial.read();
   switch (c){
    case 'w':
             s=Serial.readString();
             b=s.indexOf(',');
             s1=s.substring(0,b);
             s2=s.substring(b+1);
             addr=s1.toInt();
             b=s2.toInt();
             writeByte(addr,b);
             Serial.print(addr);Serial.print(" <-- ");Serial.println(b);
             break;
    case 'r':
             s=Serial.readString();
             addr=s.toInt();
             b=readByte(addr);
             Serial.print(addr);Serial.print(" --> ");Serial.println(b);
             break;
    case 'b':s=Serial.readString();
             c=s.charAt(0);
             s=s.substring(2);
             b=s.indexOf(',');
             s1=s.substring(0,b);
             s2=s.substring(b+1);
             addr=s1.toInt();
             nobytes=s2.toInt();         
             if (c=='w') 
              doMultiWrite(addr,nobytes);
             if (c=='r') 
              doMultiRead(addr,nobytes);              
             Serial.println("Multi Command Succesful"); 
             break;
    case 'p':doPermanent();
             Serial.println("EEprom Permanent Stored");
             break;
    case 'z':doRecall();
             Serial.println("EEprom Data Recalled");
             break;
    case 'm':showMenu();
             break;  
   }

  }
}

Schematics

Memory Module Schematics

PCB

Memory Module Fast Bottom Layer
Memory Module Fast Top Layer

Leave a Reply