dsaver icon indicating copy to clipboard operation
dsaver copied to clipboard

FF's for output

Open HighMans opened this issue 2 years ago • 3 comments

Hello,

I'm not sure if this is the right place to reach out but I need a bit of help trying to dump save files.

I have a ds cartridge hooked up with all the pins (I've also swapped MISO and MOSI around just in case), and using both your dsaver app and a simple SPI app I wrote (code below) all the output I'm getting is FF from the cartridge.

I've verified that the cartridge does indeed have data in it, and I've also checked with a signal analyzer to verify that the communications are all correct and they seem to be.

Do you've any idea where I could start or what else I could check?

Code:

#include <SPI.h>
void setup() {
  Serial.begin(9600);
  pinMode(SS, OUTPUT);
  digitalWrite(SS, HIGH);
  SPI.begin();
  SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));
  digitalWrite(SS, LOW);
  SPI.transfer(0x03);
  SPI.transfer(0x00);
  SPI.transfer(0x00);
  SPI.transfer(0x00);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);
  SPI.transfer(0xFF);

  digitalWrite(SS, HIGH);
  SPI.endTransaction();
}

void loop() {
}

2023-02-16 15_11_04-Window LogicCapture.zip

HighMans avatar Feb 16 '23 20:02 HighMans

Hi @HighMans Always happy to help anyone trying to learn :)

What game cartridge are you trying to use? Have you checked the EEPROM's part number? If you have reviewed your electrical setup, and tried with the logic analyzer (which looks good) my only guess is that the eeprom of the cartridge you are using might work with one of the other possible SPI configurations, rather than SPI_MODE0.

Mode 0 (the default) - clock is normally low (CPOL = 0), and the data is sampled on the transition from low to high (leading edge) (CPHA = 0)
  Mode 1 - clock is normally low (CPOL = 0), and the data is sampled on the transition from high to low (trailing edge) (CPHA = 1)
  Mode 2 - clock is normally high (CPOL = 1), and the data is sampled on the transition from high to low (leading edge) (CPHA = 0)
  Mode 3 - clock is normally high (CPOL = 1), and the data is sampled on the transition from low to high (trailing edge) (CPHA = 1)

Let me know if you've already tried this

pedro-javierf avatar Feb 16 '23 21:02 pedro-javierf

Also, you are sending a 24 bits (3 bytes) address to the EEPROM. I assume your game's EEPROM is bigger than 64Kb? That's why I was using 16bit addresses (2^16 is 65536 bytes exactly 64Kb). If your EEPROM does not use 24bit addresses, it might be getting confused when it receives the extra 0x00 of the address

pedro-javierf avatar Feb 16 '23 21:02 pedro-javierf

I think I might've figured out what the issue is, I think it's a combination of my crappy breadboard and the loose connections on top of swapping MISO and MOSI around.

I did try your suggestions, and tried swapping MISO and MOSI again but in testing them out I noticed I was getting random data at times which didn't make sense. I did more testing, and I realized that the loose connections might've been the culprit and causing all the problems.

I'll update once I get a genuine/higher quality breadboard in. Ty!!!

HighMans avatar Feb 17 '23 13:02 HighMans