Emulating PSX Memory Card (or controller) using a Raspberry Pi Pico

PicoMemcard

PicoMemcard allows you to build your own supercharged PSX Memory Card that can be connected to your computer via USB in order to transfer saves directly to/from your PSX. You can use it to repurpose broken/counterfit Memory Cards creating a better one using only a Raspberry Pi Pico.

Features

  • Able to simulate faithfully PSX Memory Card
  • USB conection to import/export saves
  • Allows to copy saves to/from any other memory card (using original PSX file manager)
  • Allows to play burned CDs (thanks to FreePSXBoot)
  • Cheaper than an original memory card

Bills of materials

  • Raspberry Pi Pico (around ~5$)
  • One of:
    • Custom PicoMemcard PCB (currently work in progress)
    • Broken/Counterfit/Original PSX Memory Card (counterfit ones can be found on Aliexpress for less than 1$)
    • PSX/PS2 Controller Cable
    • Nothing, if you are a mad man and feel like soldering cables directly to your PSX (would not recommend).

Basically anything that will allow you to interface with the memory card slot pins will do. If you have a broken contoller you can cut of the cable and use that since controllers and memory cards share the same bus. Of course, plugging your memory card into the controller slot will prevent you from using 2 controllers at the same time.

In total building a PicoMemcard wil cost you less than buying an used original Memory Card!

Video

PicoMemcard

Wiring

The wiriting diagram below shows how to wire the Pico and a counterfit memory card from Aliexpress. For the other cases (wiring directly to the PSX or using a controller cable) the pins on the Pico are the same, the pinout of the PSX/controller can be found on psx-spx. The image shows the bottom side of the memory card with the cover removed.

Wiring Diagram

The dashed line on the PCB of the memory card is where you should cut a groove deep enough to disconnect the original controller from the traces. The yellow squares above the line indicate where you should scrape away the proctective film in order to expose the copper traces and solder the wires onto them.

Finally the area at the bottom of the memory card is where you can cut a hole to feed the wires through connecting them to the Pico.

Installation

  1. Download the latest release.
  2. While pressing the 'BOOTSEL' button on your Raspberry Pi Pico, plug it into your computer.
  3. Drag and drop the PicoMemcard release onto your Raspberry Pi Pico.
  4. PicoMemcard should appear on your PC as a USB drive.
  5. Upload a memory card image to your PicoMemcard.

Transfering Data

As of the current release, uploading data to PicoMemcard requires some precise steps:

  • The image of the memory card to upload must be called exactly MEMCARD.MCR. Uploading anything else will not result in any errors but PicoMemcard will not save the uploaded data to flash. After rebooting the device the old data will still be present.
  • The image must be 128KB (131072 bytes) in size which is precisely the size of an original Memory Card.
  • After the image has been uploaded, the device must be safely ejected in order for the data to be actually imported correctly. This is a limitation of the current implementation (see Design section).

Inside docs/images you can find a two memory card images. One has a couple of saves on it so you can test if everything works correctly, the other is completely empty.

ATTENTION: I would recommend to never plug PicoMemcard both into the PC (via USB) and the PSX at the same time! Otherwise the 5V provided by USB would end up on the 3.3V rail of the PSX. I'm not really sure if this could cause actual damage but I would avoid risking it.

If you really need to have the Pico plugged into both the USB and PSX (e.g. for debugging purposes), disconnect the 3.3V line from the VBUS pin. In this way you can power on the Pico using a simple USB phone charger or by plugging it into your PC.

Future Development

As of now PicoMemcard is still in very early development stages and only tested it on a PSOne Pal model (SCPH-102, bios version 4.4). It should work on any PSX model. If you want to try it on your PSX any feedback would be much appreciated.

I've tried to make the project as accessible as possible by using the least amount of hardware but this comes with a few limitations, in particular regarding the flash storage of the Pico. In the future I want to add the possibility to use a microSD card by adding a microSD SPI module, this would improve on the following:

  • The very limited storage preventing from having multiple memory card images at the same time and being able to switch them using a button on the Pico.
  • The complex codebase using multiple filesystems (see Design section).
  • The brief downtime periods PicoMemcard may have while writing new data to flash memory, appearing as if the Memory Card was briefly disconnected.
  • The need to perform save ejection as a way to signal the Pico to transfer the data from the virtual FAT disk to the flash filesystem (see Design section).

Design

For people interested in underestanding how PicoMemcard works I provide a more extensive explanation in this post.

Thanks To

  • psx-spx and Martin "NO$PSX" Korth - Playstation Specifications and documented Memory Card protocol and filesystem.
  • Andrew J. McCubbin - Additional information about Memory Card and Controller comunication with PSX.
  • littlefs - Filesystem designed to work on NOR flash used by many microcontrollers, including the Raspberry Pi Pico.
  • ChaN FatFS - FAT filesystem implementation for embeeded devices.
  • Scoppy - Use your Raspberry Pi Pico as an oscilloscope, very cheap and accurate. Without this I would have not been able to debug many issues.
  • PulseView - Used to import, visualize and manipulate the data from Scoppy on a PC.
Owner
Daniele Giuliani
Hi! I’m just a guy with a passion for computers, videogames and rock climbing.
Daniele Giuliani
Comments
  • With RP2040 zero,ps1 not detect

    With RP2040 zero,ps1 not detect

    With RP2040 zero, the .mcr file can be recognized through usb after writing the program. However, it cannot be detected by ps1 9002. It has been checked 3.3v power supply and the data line connection are not abnormal.

  • VBUS connected to 3.3v

    VBUS connected to 3.3v

    Hey,

    Just setting this up, and I've noticed you say to connect VBUS on the pico to 3.3v on the PS2, which creates the danger that when plugging in the pico to usb, you'd be connecting that to 5v.

    You can just connect the 3.3v memory card pin to 3.3v on the pico, and it'll power it just fine. That'll also allow you to safely have the board plugged into the PC for debugging at the same time.

  • FreePSXBoot autoboot, file API and executable launcher

    FreePSXBoot autoboot, file API and executable launcher

    I have been thinking about a few possible enhancements for this project, none of which would be particularly hard to implement.

    As controllers sit on the same shared SPI bus as memory cards, it should be possible for the RP2040 to emulate a controller for a few seconds after bootup and send the keypresses required to enter the memory card manager; this would fully automate the process of launching FreePSXBoot. It should also be possible to sniff communications between the console and the controllers (which are polled at 50-60 Hz by the kernel) and detect specific key combos to e.g. change the card image.

    Moreover, the RP2040 could implement a custom command set to allow homebrew apps to access files on the flash or SD card, potentially making it possible to write a launcher (booted through FreePSXBoot) for executables on the card. This wouldn't be useful for retail games as they are hardcoded to access the CD drive, however it would make debugging homebrew on real hardware easier (currently the most common way to test on a PS1 is to build a serial port adapter, which is far slower and requires cutting up hard-to-find link cables or soldering to the motherboard).

    I'm probably going to try adding these features in a few weeks once I have some free time, as the PS1 homebrew scene desperately needs a lower barrier to entry on the hardware side of things (and on the software side as well, but I'm already tackling that with my contributions to PSn00bSDK).

  • PS2 compatability changes - WIP

    PS2 compatability changes - WIP

    This fixes a few issues I've found:

    • Acknowledging fast SPI clocks on PS2 meant for other peripherals, due to the speed of the pico. The PIO programs run slower now.
    • Random ACKs. This was due to how the ACK signal was triggered. It now won't trigger unless it counts 8 clocks.
    • Transaction restarts. Fixed this by re-structuring the memory card simulator to work as a state machine.

    I do have one problem that I've yet to solve though, which is why this is still in draft. Occasionally both the PS1 and PS2 seem to think that the card has been disconnected.

  • Initial SD card support.

    Initial SD card support.

    This is very much still a work in progress.

    Reading is tested and works fine, syncing not tested yet.

    This will probably need to go into a separate branch. I'd like to re-add the ability to read/write via USB and also bank switching, but this is a start for now.

    Anyways hope this is somewhat helpful anyways!

    Edit: All works the same as before, just throw MEMCARD.MCR on an SD card formatted as FAT32 and connected to SPI0, and it'll serve that up to the PS1.

  • Not detected by Playstation 2 - SCPH-39003

    Not detected by Playstation 2 - SCPH-39003

    Hi,

    Tested this today with my original fat playstation 1, worked perfectly (using the breakout board I talked about on the Reddit thread that I'd made a while back).

    When trying it with my Playstation 2 (SCPH-39003), it wasn't detected at all. Not sure what the issue there is, but I'll try to debug it if I get time. I understand the primary purpose of this project is for use on the Playstation 1, but it'd be nice if it also worked in backwards compatibility mode on the PS2 also.

A FAT filesystem with SPI driver for SD card on Raspberry Pi Pico
A FAT filesystem with SPI driver for SD card on Raspberry Pi Pico

no-OS-FatFS-SD-SPI-RPi-Pico Simple library for SD Cards on the Pico At the heart of this library is ChaN's FatFs - Generic FAT Filesystem Module. It a

Jun 16, 2022
Tetris on a Raspberry Pi Pico mounted on a Pimoroni Pico Explorer

PicoTetris Classic Tetris game running on a Raspberry Pi Pico microcontroller. Pico C port by Richard Birkby Original JavaScript implementation - Jake

May 15, 2022
Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack
Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack

breakout_rpi_pico Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack Prebuilt binary (breakout.uf2) is here. To build your own binary

Jan 17, 2022
Pico-uart-bridge - Raspberry Pi Pico UART-USB bridge

Raspberry Pi Pico USB-UART Bridge This program bridges the Raspberry Pi Pico HW UARTs to two independent USB CDC serial devices in order to behave lik

Jun 21, 2022
Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display
Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display

pico-display-matrix Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display or how to actually use all Flash

Apr 3, 2022
Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5"

Raspberry-PI-PICO-display-RPI35 Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5" Con ayuda de la libreria https://github.com/khoih-pr

Nov 10, 2021
Windows kernel-mode driver emulating well-known USB game controllers.

Windows kernel-mode driver emulating well-known USB game controllers.

Jun 24, 2022
An in-progress matching decompilation of Final Fantasy VII For the PSX.

FFVII An in-progress decompilation of the original US release of Final Fantasy VII on the PSX. Building (Linux) Install build dependencies The build p

Jun 5, 2022
Macos-arm64-emulation - A guide for emulating macOS arm64e on an x86-based host.

macos-arm64-emulation Use the following guide to download and configure all of the necessary tools and files for emulating the macOS arm64e kernel. Th

Jun 23, 2022
A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Using Pro-micro control.
A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Using Pro-micro control.

N.A.G.E.K.I. A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Using Pro-micro control. 中文版

Jun 17, 2022
A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Using Pro-micro control.
A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Using Pro-micro control.

N.A.G.E.K.I. PLEASE CHECK Main Project A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Us

Dec 30, 2021
Web Server based on the Raspberry Pico using an ESP8266 with AT firmware for WiFi
Web Server based on the Raspberry Pico using an ESP8266 with AT firmware for WiFi

PicoWebServer This program runs on a Raspberry Pico RP2040 to provide a web server when connected to an Espressif ESP8266. This allows the Pico to be

Jun 10, 2022
Open source PCB for arcade sticks using Raspberry Pi Pico.
Open source PCB for arcade sticks using Raspberry Pi Pico.

Pico Fighting Board Open source PCB for arcade sticks using Raspberry Pi Pico. Introduction They say imitation is the highest form of flattery. If tha

Jun 16, 2022
USB host implementation using PIO of raspberry pi pico (RP2040).

Pico-PIO-USB USB host implementation using PIO of raspberry pi pico (RP2040). You can add additional USB port to RP2040. ?? This library is WIP. API m

Jun 17, 2022
This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip.

Pico SPI Utilities This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip. While th

Jan 20, 2022
A multi-bank MRAM based memory card for Roland instruments
A multi-bank MRAM based memory card for Roland instruments

Roland compatible multi-bank MRAM memory card (click to enlarge) This is a replacement memory card for old Roland instruments of the late 80s and earl

Jun 18, 2022
custom esp8266 controller for driving the pwm led controller

room8266 custom esp8266 controller for driving the pwm led controller designed to drive this: https://github.com/austinscreations/PWM-LED-Controller t

Nov 1, 2021
Raspberry Pi Pico (RP2040) and Micro-ROS (ROS 2) Integration

The Pico is an amazing microcontroller and I couldn't wait for ROS 2 support or Arduino Core, so here is my approach. Once the Arduino Core for RP2040 is out it will be easier to use micro_ros_arduino.

May 25, 2022
built-in CMSIS-DAP debugger tailored especially for the RP2040 “Raspberry Pi Pico”

RP2040 has two ARM Cortex-M0+ cores, and the second core normally remains dormant. pico-debug runs on one core in a RP2040 and provides a USB CMSIS-DAP interface to debug the other core. No hardware is added; it is as if there were a virtual debug pod built-in.

Jun 17, 2022