hey
i wanted to work with all the microwire eeprom available,till now 93c56 and 93c66 is done,but
having trouble with 93c46.
//difining pins for eeprom
int CLOCK =4;
int DATA_OUT =3;
int DATA_IN = 2;
int CHIP_SEL =5;
int high = 0,low =0; //high and low address
byte dataword[]={"hello world!"}; //data to send in eeprom
byte READ = 0b1100; //read instruction
byte WRITE = 0b1010; //write instruction
byte EWEN = 0b10011; //erase write enable instruction
void setup(){
pinMode(CLOCK ,OUTPUT);
pinMode(DATA_OUT ,OUTPUT);
pinMode(DATA_IN ,INPUT);
pinMode(CHIP_SEL ,OUTPUT);
digitalWrite(CHIP_SEL ,LOW);
Serial.begin(9600);
}
void loop()
{
digitalWrite(CHIP_SEL ,HIGH);
shiftOut(DATA_OUT,CLOCK,MSBFIRST,EWEN); //sending EWEN instruction
digitalWrite(CHIP_SEL ,LOW);
delay(10);
for(int i=0;i<=13;i++)
{
digitalWrite(CHIP_SEL ,HIGH);
shiftOut(DATA_OUT,CLOCK,MSBFIRST,WRITE); //sending WRITE instruction
shiftOut(DATA_OUT,CLOCK,MSBFIRST,low); //sending low address
shiftOut(DATA_OUT,CLOCK,MSBFIRST,dataword[i]); //sendind data
digitalWrite(CHIP_SEL ,LOW);
delay(100);
low++; //incrementing low address
}
low=0;
for (int i=0;i<=13;i++)
{
digitalWrite(CHIP_SEL ,HIGH);
shiftOut(DATA_OUT,CLOCK,MSBFIRST,READ); //sending READ instruction
shiftOut(DATA_OUT,CLOCK,MSBFIRST,low); //sending low address
byte incoming = shiftIn(DATA_IN,CLOCK,MSBFIRST); //sendind data
digitalWrite(CHIP_SEL ,LOW);
low++; //incrementing low address
Serial.println(char(incoming));
}
while(1);
}
this code works for 93c56 and 93c66 ,but when i plug 93c46 it doesn't write and read properly.
so anyone can tell me what changes should i do in order to make this code work for 93c46.
have a great day all
thanks