MemCARDuino - Arduino PlayStation 1 Memory Card reader

Start a work log and update it occasionally with your projects progress
User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

MemCARDuino - Arduino PlayStation 1 Memory Card reader

Post by Shendo » June 22nd, 2013, 11:29 am

MemCARDuino v0.6

Image

MemCARDuino repository | MemcardRex repository

Note: Always use the latest version of both applications from the releases in the repository.

Supported platforms:
  • Arduino Uno, Duemilanove, Diecimila, Nano, Mini, Fio (ATmega168/P or ATmega328/P)
  • Arduino Leonardo, Micro (ATmega32U4)
  • Arduino Mega 2560
  • Espressif ESP8266, ESP32 (requires additional board URL)
  • Raspberry Pi Pico (requires additional board URL)
Various other boards can be supported if they have Arduino core available with SPI library with minimal or no editing to the sketch.

Warning:
Some Arduino boards use 5V logic and are not recommended. Connecting it straight may shorten lifespan of your MemoryCard or damage it permanently as it is a 3.6V device. Use a lever shifter for data lines and power the memory card with 3.6 power supply.

Image
Images provided by Temper999.
Last edited by Shendo on January 12th, 2023, 12:05 pm, edited 4 times in total.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » June 23rd, 2013, 1:02 am

Update:
I can read as many frames as I want from the card. Currently I'm trying to make a pass-through interface similar to DexDrive (but not that overcomplicated) and hopefully I'll implement the interface to MemcardRex.

Image
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

User avatar
yogi
Interested PSXDEV User
Interested PSXDEV User
Posts: 9
Joined: Jun 24, 2013

Post by yogi » June 24th, 2013, 5:14 am

Cool project! I was looking at the parallel port designs thinking the same thing, needs to be updated to a uC!

"
Shendo wrote: The thing is PS1 has all SPI lines connected to the same wires, the only difference is ATT wire which is
different for port 1 and 2 but same for devices on that ports (MC and Controller).
The ATT line is in effect a CS for the devices on the SPI bus. IIC uses a address byte at the start of transactions, but SPI uses hardwired CS' to avoid bus collisions. MISO, SIMO and CLK are common to all devices on the bus, with a unique CS from the master to each slave. Can you point me to a pinout of the MC connector?

Hoping you will post your Arduino sketch, I DO plan on building a card reader soon!
Life's short, eat dessert first

Gradius
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 220
Joined: Sep 09, 2012
I am a: IT Consultant, Systems Integrator
PlayStation Model: 7501
Location: Chile

Post by Gradius » June 24th, 2013, 5:16 am

FYI, DexDrive uses RS232, but here I use it by USB just fine.

What speed are you getting?

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » June 24th, 2013, 8:33 am

Oh man, I hit a major roadblock yesterday.
In the PSX library I linked, the SPI communication is done using software (via digitalWrite() and DigitalRead())
for bit pushing which is ok for controllers but way too slow for Memory Cards as clock needs to be 250 kHz.
To read whole 128 kB of data one would have to wait for 10 minutes...
So I scrapped that approach and started looking for alternatives.

Atmel AVR chips (microcontroller on Arduino) have native SPI interface which is pretty flexible and
can be configured to give the required 250 kHz clock.
So after pulling an all-nighter (couldn't sleep when there is work to be done :) ) I implemented a DexDrive-like
command driven "firmware" which gave me speed up to par with DexDrive.

After I completely finish it I will post schematic and a GPLed source so people can burn it to their Arduinos.
Software side will be provided by standalone application and MemcardRex v1.8 later.

@Yogi: ATT (SS) for Memory Card and Controller are shared. When the line is low both devices are active.
The only difference that determines which peripheral will answer is the initial command (0x01 - Controller, 0x81 - Memory Card).

Schematic:

Code: Select all

    Looking at the Memory Card:
    _________________
    |_ _|_ _ _|_ _ _|
     1 2 3 4 5 6 7 8
     
     1 DATA - Pin 12 on Arduino (MISO)
     2 CMND - Pin 11 on Arduino (MOSI)
     3 7.6V - 5V Pin on Arduino
     4 GND - GND Pin on Arduino
     5 3.6V - 5V Pin on Arduino
     6 ATT - Pin 10 on Arduino (SS)
     7 CLK - Pin 13 on Arduino (SCK)
     8 ACK - N/C
Currenly I set the bitrate to 38400 bps (copied DexDrive) but each frame (128 bytes) takes about 70ms (pretty much like DexDrive).
Also, I know about using RS232 adapters for DexDrive but I was referring to the fact that DexDrives are out of production and getting harder to obtain.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

rsoft
Rookie Programmer
Rookie Programmer
Posts: 19
Joined: Jun 22, 2013
Location: /home/rsoft

Post by rsoft » June 25th, 2013, 2:08 am

Certainly a really nice project!
There's just one thing that's bothering me a bit.
How does the memory card feel when you power it with 5V instead of the usual 3.3V/3.5V and also use 5V logic levels?
I'm not too sure if this would do any harm in the long run but I'm cautiously optimistic. ;)

Gradius
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 220
Joined: Sep 09, 2012
I am a: IT Consultant, Systems Integrator
PlayStation Model: 7501
Location: Chile

Post by Gradius » June 25th, 2013, 4:21 am

Hard to get?

No way! I got them here (BRAND NEW):
http://www.ebay.com/itm/NEW-Playstation ... 564653f47f

User avatar
yogi
Interested PSXDEV User
Interested PSXDEV User
Posts: 9
Joined: Jun 24, 2013

Post by yogi » June 25th, 2013, 4:46 am

Wow! Thank you for your work, very cool. Looking forward.
Looks like your using a Teensy1, do you think there would be a prob with using a Mega328, aka DIY boarduino UNO?
Shendo wrote: @Yogi: ATT (SS) for Memory Card and Controller are shared. When the line is low both devices are active.
The only difference that determines which peripheral will answer is the initial command (0x01 - Controller, 0x81 - Memory Card).
OK, that makes more sense. Sony has obviously extended the SPI protocol, THX for clarifying. I had read Charles MacDonald's page on the PSX Memory cards. His notes explored the issues with third party cards, but briefly described the hardware similarities to SPI. I had thought that the state of the ATT line signaled the choice between the MC or the pad, I.E. ATT1- High for pad1 and Low for MC1. But in hindsight this would diff cause a problem, both pads responding. More of a channel select. Though, the design at NTPad.com uses pin 4 on the pad ports, as a pad select (but no MC ports used there). Is pin 4 on the pad also on the MC port? Considering that the MC port has 8 pins and the pad has 9 pins, will be researching more.
EDIT- just realised that pin 4 of the pad is the GND: WTF is NTPad doing? Yet another site, http://www.angelfire.com/games4/jamiewe ... llers.html, is using Pins 1 and 9 for multi pad support. Sorry for all this OT pad discussion, just trying to understand Sony's tricks;)

I know that ATM, you're using 38k baud, but will you be considering raising the transfer speed? Last question, the interface could also be extended as a pad interface, DirectPadPro-ish ?
Last edited by yogi on June 25th, 2013, 5:37 am, edited 1 time in total.
Life's short, eat dessert first

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » June 25th, 2013, 5:01 am

@Gradius:
Heh, you just don't quit do you? :D
I got mine from the same place, but i paid for shipping more then the actual device itself (20 $).
If it wasn't for the "oooh, I've always wanted a DexDrive" I've would have never get one.
Notice that I wrote getting harder to get (over the years), not hard to get (currently).
Also, that's a stock and who knows how many they got left...

@rsoft :
Thanks.
At first I connected Memory Cards to the 3.3 V Arduino provides but I was getting read errors so I switched 3.6
line to 5 V and that gave me good results.
One 3rd party card died on me but I don't know if that's connected as I had many 3rd party cards fail even with normal usage.
1st party card on the other hand seems to be very durable and it's working fine after PS1, PS2, LPT readers, DexDrive and now Arduino usage.

But I can use resistors which should lower the voltage to required levels for logic lines.

@Yogi:
Actually I'm using Arduino Nano v3.0 (looking similar to Teensy board).
Speed can't be pushed further I'm afraid as you get transfer errors (not for the RS232 but the card itself).
Controller has 9 pins but one is not connected to anything.
Libraries for interfacing a controller already exist (supporting GH guitars too ;) ) so I'm not interested in that.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

User avatar
yogi
Interested PSXDEV User
Interested PSXDEV User
Posts: 9
Joined: Jun 24, 2013

Post by yogi » June 25th, 2013, 5:17 am

Gradius wrote:Hard to get?

No way! I got them here (BRAND NEW):
http://www.ebay.com/itm/NEW-Playstation ... 564653f47f
I had a quality issue with one of their products, a "GearMaster" (SMS cart-2-GameGear converter). Brand new, factory sealed but didn't work, took me weeks to figure out what the issue was (casing too thick), in the end I just got a second, used "MasterGear" converter off ebay. Didn't try sending it back; didn't know if it was the GG mods or the converter or the cart; so can't speak to their cust service. But, if you have had success, well... 'buyer beware'.
Life's short, eat dessert first

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » June 25th, 2013, 11:05 am

I'm pretty much finished, I just need to write an application for it and draw proper schematic.
Also I've discovered that 3rd party cards can operate at 500 kHz, so the whole card
can be read/written in half the time. 1st party cards can't do that unfortunately
(the card talks but there are too many errors).

Not a good idea after all, cards will be using 250 kHz.

Also, the project is now known as "MemCARDuino".

Edit: And it's done. Read first post for information.
If someone decides to build it post the results :D
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

User avatar
yogi
Interested PSXDEV User
Interested PSXDEV User
Posts: 9
Joined: Jun 24, 2013

Post by yogi » June 27th, 2013, 5:57 am

Thank you very much! Already started, will post back :)
Life's short, eat dessert first

User avatar
t0rxe
C Programming Expert
C Programming Expert
Posts: 139
Joined: Dec 19, 2012
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Post by t0rxe » June 27th, 2013, 5:25 pm

Nice job! Works perfectly fine :)
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » June 27th, 2013, 11:28 pm

Thanks, I'm glad it's working.
Out of curiosity, do you have 1st party card or 3rd party (what brand)?
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

User avatar
t0rxe
C Programming Expert
C Programming Expert
Posts: 139
Joined: Dec 19, 2012
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Post by t0rxe » June 28th, 2013, 1:43 am

I have an official Sony Memory Card (SCPH-1020) that is full (15/15 blocks).
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

tlrmcknz
Curious PSXDEV User
Curious PSXDEV User
Posts: 28
Joined: Feb 18, 2014

Post by tlrmcknz » August 23rd, 2014, 4:04 pm

Can this be adapted to replace a memory card for the playstation? Like when a game saves, write to the arduino (and then perhaps sd card through network/sd shield) instead of a present mem card?

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » August 28th, 2014, 3:55 am

Adapted? No. Because this simulates a PS1 side of thing and acts as a SPI host.

However if written from the scratch it should be doable. The first problem with this I see is that
you need a device that acts both as a SPI slave (for Memory Card) and SPI master (for SD card).
So, maybe some other microcontroller or simulate SPI with GPIOs for the PS1 communication.


I have been doing some tests with Arduino board I have, so I may come up with something...
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

Bodzio_2
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: Aug 06, 2015

Post by Bodzio_2 » August 13th, 2015, 8:11 am

I don't know why but my reader doesn't work. I tried to conntact Shendo on his blog but so far he didn't answer do maybe you can help me. I copy my reply from his blog. I think that I did everything according to his guides. I even bought this platic Arduino board but still it doesn't read saves. Did I forget about something?

1. I downloaded and installed this driver http://www.ftdichip.com/Drivers/VCP.htm

2. I bought a clon of Arduino Nano http://allegro.pl/arduino-nano-v3-0-atm ... 41763.html

3. I soldered it to the PS1 memory card port

4. I used a special adapter to connect cables to Arduino

5. I installed Arduino and set up like this Then, I chose Verify/Compile and then upload.

6. The Arduino looks like this

7. I ran MemCard 1.8 - Options/Preferences and set like this

8. Finally I chose Hardware, read, Memcarduino but I have only this

I have Windows 8.1 nad used original PS1 memory card.

User avatar
CodeAsm
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 69
Joined: Jan 13, 2012
I am a: Programmer, Student
Location: The Netherlands
Contact:

Post by CodeAsm » August 21st, 2015, 2:25 am

(im back, jeej)
Gonna try this tonight I hope,
Windows 10, some clone atmega nano thing.
@Bodzio_2 did you check if you can program the arduino normaly? (blinky led project)
if so, double check your wires (as schematic, but also continuity ;) )
Then check if the card works (in a playstation, or other reader)
try with another card if you have one :D
Development Console: SCPH-102, unkown clone Modchip, PAL , FTDI board build into the case (microUSB) for Serial I/O.
Development Computer: GNU/Linux, Arch x86_64 Linux 4.20.3, i7-3632QM [8x3.2GHz], 11,8GiB, 1366x768 GeForce GT 630M (Optimus tech), lots of gig of storage

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » August 25th, 2015, 11:15 pm

Bodzio_2, try to run this modified version for debugging.
Upload it to your Arduino, open serial monitor at 38400 bps and post results.

It should look like the attached image.
Image
You do not have the required permissions to view the files attached to this post.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests