Memory card backup 

Posted on: Feb 15, 2019 3:41 PM UTC

Contents

I recently found my old PS1 memory cards and wondered how to retrieve the data on a computer so that I can use the saves in emulators.

Memory card hardware

A memory card has 8 connections, all of them are linked to the corresponding ones of the controller in the same port.
Data = grey, Command = purple, etc.
There is the power supply: VCC, GND, +7V (rumble).
The Acknowledge (/ACK) port is for the device to send an acknowledgement command after having received a byte.
Then Data (MISO), Command (MOSI), Attention (CS) and Clock (SCK) are standard SPI.

Software

The communication protocol described in https://problemkaputt.de/psx-spx.htm#controllerandmemorycardioports is pretty trivial.
Shendo even created a program to flash to an AVR that talks to memory cards and a Python script that talks to this program.
I had to adapt the .ino (C file to used with the Arduino software) program for the ATmega8535 I used for this task and I also changed the Python script to better take errors into account.
I'll publish these in my PS1 software repo but in the mean time the Shendo's files works perfectly.

Making it

I removed the controller/memcard block from the PS1 and soldered wires as in the first image of this article.
MISO, MOSI, CS and SCK were connected to the ATmega8535 as expected, /ATT is optional and was left alone.
Also it looks like the +7V port can be connected to a 3.3V source (both with Sony memcards and third party memcards).
I used a Raspberry Pi to control the AVR chip (through RX/TX) but any UART-capable computer would work.
And finally it's quite easy to make it work using the serial port to the chip.
$ python memcarduino.py -p /dev/serial0 -r memcard.mcr                  
running mcduino check                                                   
passed mcduino check                                                    
Running mcr header check MCDINO                                         
Sending... \xa20001                                                     
Reading 129bytes...                                                     
passed header check                                                     
reading data from memory card...                                        
                                                                        
OK at frame 1/1024  Address:00 00 TimeTaken:0:00:00.225765              
OK at frame 2/1024  Address:00 01 TimeTaken:0:00:00.225847              
OK at frame 3/1024  Address:00 02 TimeTaken:0:00:00.225859              
[...]                                                                   
OK at frame 1024/1024  Address: 03 FF TimeTaken:0:00:00.225482          
SUCCESS                                                                 
Then you can use your *.mcr files as virtual memory cards in emulators and use them as you want.

References




Comments (0)
No comments yet