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
I can't remember where I obtained it from, but there is a project out on the net, using the MEGA-2560, using higher digital pins instead of analog pins like everyone else has.. I'm going to try mixing the two, feeding the code from here , and hopefully, it'll work with the MEGA.
I've been pulling a LOT of 93C46's from various old network cards.. the problem with the project I found, it is writing immediately to the chip, which I don't want it to do.. I want to read the data contained on the EEPROM..
Hi. I know this is really old topic. But there was very limited information about this chip online, so i want to update it for future readers.
I got it to work. So excited.
I based my code on your's. However made shiftout and shiftin my in my own functions since I wanted to understand spi better. Also used string and chars to switch bits, because I'm more comfortable with them.
//defining pins for eeprom
int CLOCK =9;
int DATA_OUT =10;
int DATA_IN = 11;
int CHIP_SEL =8;
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 sendSer(String s){
digitalWrite(CHIP_SEL,HIGH);
int len = s.length();
for (int i=0;i<len;i++){
char c = s.charAt(i);
if (c=='0')
digitalWrite(DATA_OUT, LOW);
else
digitalWrite(DATA_OUT, HIGH);
digitalWrite(CLOCK,HIGH);
digitalWrite(CLOCK,LOW);
}
//needs little delay to work
delay(10);
}
void recvSer(String s){
digitalWrite(CHIP_SEL,HIGH);
int len = s.length();
for (int i=0;i<len;i++){
char c = digitalRead(DATA_IN);
Serial.print(c==LOW ? "0" : "1");
digitalWrite(CLOCK,HIGH);
digitalWrite(CLOCK,LOW);
}
}
void loop(){
digitalWrite(CHIP_SEL, HIGH);
sendSer("00000100"); //sending EWEN instruction
sendSer("1100000"); //
digitalWrite(CHIP_SEL,LOW);
digitalWrite(CHIP_SEL, HIGH);
sendSer("00000101"); //sending WRITE instruction
sendSer("0000001"); //sending Address
sendSer("10001101"); //sending data
digitalWrite(CHIP_SEL,LOW);
digitalWrite(CHIP_SEL, HIGH);
sendSer("00000110"); //sending READ instruction
sendSer("0000001"); //sending Address
//dummy zero that is sent at start of read
digitalWrite(CLOCK,HIGH);
digitalWrite(CLOCK,LOW);
//receiving data... zeros is just to specify count.
//no meaning in them... output is to serial
recvSer("00000000");
digitalWrite(CHIP_SEL,LOW);
while(1);
}