Go Down

Topic: Reading ATMEL 93c66 w/ Sketch For 93c46 (Read 141 times) previous topic - next topic

OnlyKindaSlow

Apr 03, 2019, 02:10 am Last Edit: Apr 03, 2019, 02:13 am by OnlyKindaSlow
As the title says, I have a ATMEL 93c66 EEPROM desoldered/wired and am getting repeating data in big blocks which occupy 1/4 memory each (serial save from PuTTY).  The wiring and soldering are good physical connections, settings are right for the SPI, chip is grounded at ORG lead for 8bit use.

I'm attemping to read using a void copied out of a longer sketch written for the 93c46.  I'm assuming it is an addressing issue from one chip to the other.  The '46 is a 1kbit, uses 7 bit addresses and the '66 is 4Kbit with 9 bit addresses.

Apologies for anything wrong with this post, learning.  EEPROM datasheet attached


Code: [Select]

#include<SPI.h>
#define DATAOUT 11//MOSI
#define DATAIN  12//MISO
#define SPICLOCK  13//sck
#define SS 10//ss

void setup()
{
  pinMode(SS,OUTPUT);
  pinMode(DATAOUT, OUTPUT);
  pinMode(DATAIN, INPUT);
  pinMode(SPICLOCK,OUTPUT);
  digitalWrite(SS,LOW);
 
  Serial.begin(9600);

  SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));



  dump();
}

void loop()
{
 
}



void dump(){
  Serial.println("Dumping AT93C46D");
 
  byte data1;
  byte data2;
 
  for (int address = 0; address < 512; address++) {
    digitalWrite(SS,HIGH);
    SPI.transfer(0b110);
    SPI.transfer(address << 1);
    data1 = SPI.transfer(0);
    digitalWrite(SS,LOW);

    data1 = (data1 << 1) | (data2 != 0);
   
    printByte(data1);
  }
}

void printByte(byte data){ // print with all preceding 0's
  for (int i = 7; i >= 0 ; i--) {
    if (bitRead(data, i) == 1) {
      Serial.print(1);
    } else {
      Serial.print(0);
    }
  }
  Serial.print("\n");
}

 

Go Up