Go Down

Topic: Unable to read from eeprom M35080 (Read 241 times) previous topic - next topic

Kaijudo

Dec 08, 2018, 06:16 pm Last Edit: Dec 08, 2018, 11:29 pm by Kaijudo Reason: mixed up VSS and VCC
Hello,

I am trying to read from an ST M35080 eeprom. I connected the eeprom according to the datasheet to my Arduino Uno. (VSS=Gnd; S=Pin10/SS; Q=Pin12/MISO; VCC=5V; D=Pin11/MOSI; C=Pin13/SCK)
Then I try to read it always returns "0" even tho it should return "FF". I already confirmed that the eeprom works with another programmer. Maybe someone has an idea.

Thanks in advance.

Code: [Select]

#include <SPI.h>

byte WREN = 0b00000110; //Set Write Enable Latch
byte WRDI = 0b00000100; //Reset Write Enable Latch
byte RDSR = 0b00000101; //Read Status Register
byte WRSR = 0b00000001; //Write Status Register
byte READ = 0b00000011; //Read Data from Memory Array
byte WRITE = 0b00000010; //Write Data to Memory Array
byte WRINC = 0b00000111; //Write Data to Secure Array

void setup() {
  Serial.begin(9600);
  Serial.flush();
  digitalWrite(SS, HIGH);
  pinMode(SS, OUTPUT);
  SPI.begin();
}

void loop() {
  Serial.println("Press any key to start");
  while (Serial.available() <= 0) {}
  Serial.println("Go!");
  SPI.beginTransaction(SPISettings (5000000, MSBFIRST, SPI_MODE0));
  //Read
  digitalWrite(SS, LOW);
  SPI.transfer(READ);
  SPI.transfer16(755);
  byte received = SPI.transfer(0);
  Serial.println(received);
  digitalWrite(SS, HIGH);
  SPI.endTransaction();
  Serial.println("Finish!");
  while (1) {}
}

Buleste

Shouldn't VSS be connected to the ground and VCC be connected to the Voltage?

Kaijudo

Yep, thats right. I wired it up that way but mixed it up in my post.

Go Up