First the quick summary:
the original BRAM is only 2k which is not a lot. Sega CD also had similar limitation but they did have RAM cart that can be used. Us poor people in USA never got easy to use English version like Tennokoe Bank card or something (plus we need converter) so we need to rely on guide and modded system.
Or one could replace the original 2k with something bigger. Tennokoe2, TurboBooster Plus, CD system, and Duo all have standard SRAM which makes it easy to work with. No weird propriety shit.
However the systems were never designed to work with more than 2K of RAM so you need to manually control what "pages" the system is on to get around the 2k limit.
I have choosen 32k because: 16 pages is more than enough for many good games, because the DIP package used on Tennokoe2 and Turbobooster Plus is the narrow 300mill package, and SRAM over 32k is 600mil wide, which would require DIP adapter or a whole lot of wiring. Duo and CD system used SOIC package which can go up to 1 megabit in same physical width.
The pinout are different though. Just slightly different. For 32k, you would need to lift 2 pins and reroute /WE pin and /VCC pin from the pad to the new chip. You will also need a way to control each of the added address pins that are not on the original system pad.
There are 3 ways you can control memory banks, or pages:
The easy way:
Dip switch with pullup resistors
Pro: cheapest, quickest, 4 address switch can be controlled by a hexidecimal rotary switch
Con: need to read *tiny* switch, larger switch does not appear to exist.
Add more switches for more address (ie 5 switch for 64k SRAM, 6 switch for 128k, etc)
Medium way
DIP switch plus LED readout
added with the DIP switch diagram above.
Pro: easy to read current page
con: more wiring, displays in hexidecimal only (0-9, A-F)
Add second 7447 with more switch for 64k, 128k, 256k, and 512k SRAM
Medium-hard:
there is a binary counter with up and down count pin, use it along with 7447 above for 2 buttons counter with display. I did not look in this because it seems a lot more wiring than the Arduino method below.
Hard way:
2 push buttons and LED readout
Pro: display pages in decimal (starts at 1, 1 to 9, 10-19, etc)
Con: a LOT more work than above mods. Requires a mean to program ATMega328 (such as Arduino UNO board)
With 5 pins left, I can do 3 displays and up to 512k SRAM before I run out.
Source code for those of you doing the Arduino way:
// unused pin: 0 and 1, 4, 13, and by removing DP pin, A3
// digital pin 0 and 1 are not used, these are usually used for communication
// with host and can be repurposed if more pins are needed.
#include "SevSeg.h"
int buttonup = 2; // pin to connect the button
int buttondn = 3; // pin to connect the button
int presses = 0; // variable to store number of presses
long time = 0; // used for debounce
long debounce = 200; // how many ms to "debounce"
const byte numPins = 4; // how many address, 5 for 64k and 6 for 128k
int state; // used for HIGH or LOW
// pins to connect leds
byte pins[] = {5, 6, 7, 8};
int leddisplay = 1; // start LED display at 1
SevSeg sevseg; //Instantiate a seven segment controller object
void setup()
{
/* we setup all pins as OUTPUT and start at LOW */
for(int i = 0; i < numPins; i++) {
pinMode(pins[i], OUTPUT);
digitalWrite (pins[i], LOW);
}
pinMode(buttonup, INPUT);
pinMode(buttondn, INPUT);
/* use pin 2 and 3 which has interrupt 0 and 1 on Arduino UNO */
attachInterrupt(0, countup, FALLING);
attachInterrupt(1, countdn, FALLING);
// setting up LED display
byte numDigits = 2; // 2 digits for 16, 32, and 64 pages.
byte digitPins[] = {A1, 11}; // equals to number of digits used,
byte segmentPins[] = {10, 9, A0, A2, A3, 12, 13, A5}; // pin a, b, c, d, e, f, g, and DP
// can probably leave out A3 DP and free a pin for one more LED display
sevseg.begin(COMMON_ANODE, numDigits, digitPins, segmentPins); // change to cathode if used
sevseg.setBrightness(70); // change to be brighter or dimmer
}
void loop()
{
/* convert presses to binary and store it as a string */
String binNumber = String(presses, BIN);
if((0 <= presses)&&(presses <= 15)) { // change to 31 or 63 for 64k and 128k
digitalWrite(pins[0], (presses & B1));
digitalWrite(pins[1], (presses & B10));
digitalWrite(pins[2], (presses & B100));
digitalWrite(pins[3], (presses & B1000));
} else {
if (presses > 15) presses = 15;
if (presses < 0) presses = 0; // change both lines from 15 to 31 for 64K, 63 for 128k
}
// display current page
leddisplay = presses + 1 ;
sevseg.setNumber(leddisplay, 0);
sevseg.refreshDisplay(); // Must run repeatedly
}
/* function to count the presses */
void countup() {
// we debounce the button and increase the presses
if(millis() - time > debounce) presses++;
time = millis();
}
void countdn() {
// we debounce the button and decrease the presses
if(millis() - time > debounce) presses--;
time = millis();
}
You will need to add sevseg library to your Arduino IDE to make this work.
Lastly, replacing the backup RAM cap would help. On my Duo it's a tiny 0.047uF wich won't last long. I am getting 1 farad cap which should last me many months even with the larger SRAM chip.
Before jumping into this project, be aware that:
SOIC chip are small and can be hard to remove if you don't have a proper SMD work station. The chip in my Duo-R was glued on underneath so I had to use dentist pick to desolder and lift individual pins before I could pop it out.
If you are going to get DIP package for Turbobooster Plus or Tennokoe2 and going to get a 300mil to 600 mil adapter for larger SRAM, watch the clearance or you may have trouble reassembling the shells. Alternative is DIP to SOIC adapter as it'd be a few mm thinner.
What size SRAM you want depends on how much work you want, and don't go overboard. 1megabit SRAM (128kx8) exists but that would be 64 pages, a lot of flipping switches or pushing buttons. Also be aware that SRAM comes in even smaller TSOP package which will be hard to work with, and some SRAM are serial or 16 bits parallel, not 8 bits which is not useful for this mod, and some SRAM requires lower voltage rather than 5v the system puts out. Make sure the SRAM you get are:
5v normal
low power standby would be nice
has 8 bit data
and is not from disreputable source like eBay where you may end up with nonworking counterfeit.
Bonus: if you consider the pricey ferroelectric ram (FRAM for short), you won't need to bother with replacement cap. FRAM can retain data for 151 years!!!
And above all, work carefully! If you have limited soldering experience, it is best to ask someone to do the work for you. Same thing with case modding for the switch or display.
Original work log below:
Been itching to do this for a few years but I finally got started.
The chip was a pain to remove, it used some strong glue to hold it down. I have on hand new chip to install. I need to double check the pinout, lift the extra pins, wire VCC from the pad spot 24 to the new chip 28, and 4 wires to switch for toggling address.
I had to take a break. A marathon soldering session 4 hours isn't good for anyone's health. Fixed Atari Lynx (no power), worked on C64 board (bad RAM) and then Duo-R. Plus it was past 4 AM here and I am expected up before 9 AM.
Time flies when you're high on solder fume.