Author Topic: BRAM upgrade hack  (Read 5509 times)

wilykat

  • Hero Member
  • *****
  • Posts: 908
BRAM upgrade hack
« on: January 07, 2016, 08:19:49 PM »
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:
Code: [Select]
// 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.

« Last Edit: January 19, 2016, 10:54:09 AM by wilykat »

wilykat

  • Hero Member
  • *****
  • Posts: 908
Re: BRAM upgrade hack
« Reply #1 on: January 09, 2016, 08:10:53 PM »
I worked on this to finish up.  Originally I was going to use hexadecimal thumb wheel (0-9 and A-F) but I can't find it at the moment and they aren't typically carried in most electronics store.  So I had to use backup plan:



old 8 position DIP switch with SIP resistors.  I was originally going to use this to build an Atari 2600 256-in-1 EPROM game (just about all of 2k and 4k games, no extra chip) many, many years ago but then someone made Harmony that could play more.  The switch assembly got left in spare parts drawer for oh about 10 years.


Finished work.  I used the 5v and ground pins of the nearby vreg chip since it was most convenient.

The BRAM seems to be working but I think I missed a solder because some of the pages doesn't work right.  It does save on working page setting so I'll have to take the board out and flip it to find out where I went wrong.

Still need to replace the stock cap.

Vimtoman

  • Sr. Member
  • ****
  • Posts: 380
Re: BRAM upgrade hack
« Reply #2 on: January 10, 2016, 03:29:15 AM »
You need pull up resistors on all address pins and then pull down with the switch.

SegaSonic91

  • Jr. Member
  • **
  • Posts: 80
Re: BRAM upgrade hack
« Reply #3 on: January 11, 2016, 02:31:52 PM »
Now THAT is what I call a useful upgrade!  It's so stupid that NEC and/or Hudson did not come up with a better save system for the DUO.  Especially seeing as thete was no option for a save-straight-to-RAM-card option like the MEGA-CD and everything afterwards had.

wilykat

  • Hero Member
  • *****
  • Posts: 908
Re: BRAM upgrade hack
« Reply #4 on: January 11, 2016, 11:54:30 PM »
You need pull up resistors on all address pins and then pull down with the switch.

The black thing next to the DIP switch is the resistor packs, 10kx9 with common pin.  Currently it is wired as pull down with switch to 5v pull up.  I'll try reversing that to see if my mod behaves better.  I did find a loose wire on A11, it seemed to have come off when I put the board back in the bottom shell.

EDIT: it was 9, not 8 I forgot the extra unused pin.

SignOfZeta

  • Hero Member
  • *****
  • Posts: 8497
Re: BRAM upgrade hack
« Reply #5 on: January 12, 2016, 05:48:59 AM »
Now THAT is what I call a useful upgrade!  It's so stupid that NEC and/or Hudson did not come up with a better save system for the DUO.  Especially seeing as thete was no option for a save-straight-to-RAM-card option like the MEGA-CD and everything afterwards had.

Man, what's with the 21st century bitch fest?

Can you name another console from the same era with a better save system? No, you can't. I know you can't because it was the very first CD-ROM thing ever, and therefore the first system to allow you to save to the machine AT ALL.

Sorry it isn't perfect.

The PCE came out the same year as US Legend of Zelda, most Americans first experience with being to save on a console period. All of these carts have either had their batteries replaced or you can't save on them. But look, my PCE still saves, never replaced anything.

I agree there is a lot of room for improvement, but I've had way more issues with corrupted saves on Saturn and PlayStation because flash sucks, early flash is twice as bad.

I think many of the modern complaints come from people who want to hoard saves the way they hoard games, something that nobody at Hudson/NEC thought of when they designed the system 30 years ago. They didn't know people would acquire complete libraries and try to keep the same dumb Neutopia II save for 18 f*cking years. If the PCE (which is a SUPREMELY well designed system, btw) had a system that could keep unplayed saves for decades on end it would have outlasted every NES cart, most SNES carts, a lot of Laserdiscs, VHS tapes, audio cassettes, Zip Disks, Famicom Discs, and pretty much every single flash thing from its invention until at least the late 90s. It would be kinda weird for NEC to design a game machine than cost $600 in the 80s so that people could not use it for months. Why did they buy it then?

Please get real. These people weren't being "stupid" they were genius. And while I can see the use of a better memory manager or something, the system as it exists works pretty much perfectly for me. I play the game every couple of days until I'm either bored of it or I finished it. If I don't turn my PCE on for two months...well I guess I don't play all that much PCE do I? The save disappears after my interst in the game has disappeared. I have no use for a year old RPG save because I'll never be able to tell where the f*ck I am or what I was doing. Most early RPGs have very few reminders that say "this is what you were doing" so I'll just wander around in circles until I realize how much time I could save by just starting the game over.



wilykat

  • Hero Member
  • *****
  • Posts: 908
Re: BRAM upgrade hack
« Reply #6 on: January 12, 2016, 06:14:03 AM »
Sega CD had RAM cart. That one held 16 times the original save RAM.  NEC never released something of a pure memory card that could be used with Duo, or a System 3.x variant card with built in save memory for use on non-Duo CD system that don't have built in 3.0.

SNES never had CD system (2 different protos were planned then canned) and the next major popular CD system, Playstation was the first CD console with external save memory.

Necromancer

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 21366
Re: BRAM upgrade hack
« Reply #7 on: January 12, 2016, 07:19:16 AM »
And the Sega CD never had a peripheral that allowed for 64 times as much save storage or increased its system RAM, but who gives a f*ck?  I'm with Zeta: you gotta be daft to think the PCE's save system is poorly designed and unusable.  So you had to swap saves onto a Tennokoe Bank card....  oh, the humanity!
U.S. Collection: 97% complete    155/159 titles

SignOfZeta

  • Hero Member
  • *****
  • Posts: 8497
Re: BRAM upgrade hack
« Reply #8 on: January 12, 2016, 07:58:40 AM »
Sega CD had RAM cart. That one held 16 times the original save RAM.  NEC never released something of a pure memory card that could be used with Duo, or a System 3.x variant card with built in save memory for use on non-Duo CD system that don't have built in 3.0.

SNES never had CD system (2 different protos were planned then canned) and the next major popular CD system, Playstation was the first CD console with external save memory.


Maybe they didn't release a RAM cart because THERE IS NOWHERE TO PUT ONE.

wilykat

  • Hero Member
  • *****
  • Posts: 908
Re: BRAM upgrade hack
« Reply #9 on: January 12, 2016, 08:04:44 AM »
Solved, the upgrade hack works now.  On a hunch, I took the first SRAM chip out and put in another one (glad I ordered 3 in case of this) and it now works 100%.  The first chip was faulty somehow.

Now I need to clean up, get a proper switch, install it in the case, and close it.  I see a couple possibilities for the final switch design:
1: thumbswitch like this one:

2: wire up something like ATMega with 2 push button, LED display, and have it control address.  Like this memory card:


Advantage of one: smaller, neater, quicker, easier. Also cheap like this one: http://www.allspectrum.com/store/bcd-switch-hex-15-pushwheel-pen-push-type-plaimae-corporation-p-1320.html    Disadvantage, octal switch limited to 3 address (16k) and hexadecimal switch to 4 (32k). 

Advantage of two: can control single address up to however the size of ATMega I use (20 available pins on AT328p for example, -2 for button and -7 for LED = 11 controlled address pins to a multi-mega SRAM (if one beast exists)  Disadvantage: need to know how to program Arduino or other microcontroller or get someone to make code with specified number of address, need to cut out opening for LED readout and button.  More work, more bling, easier to read display.

SegaSonic91

  • Jr. Member
  • **
  • Posts: 80
Re: BRAM upgrade hack
« Reply #10 on: January 12, 2016, 09:56:13 AM »
Now THAT is what I call a useful upgrade!  It's so stupid that NEC and/or Hudson did not come up with a better save system for the DUO.  Especially seeing as thete was no option for a save-straight-to-RAM-card option like the MEGA-CD and everything afterwards had.

Man, what's with the 21st century bitch fest?

Can you name another console from the same era with a better save system? No, you can't. I know you can't because it was the very first CD-ROM thing ever, and therefore the first system to allow you to save to the machine AT ALL.

Sorry it isn't perfect.

The PCE came out the same year as US Legend of Zelda, most Americans first experience with being to save on a console period. All of these carts have either had their batteries replaced or you can't save on them. But look, my PCE still saves, never replaced anything.

I agree there is a lot of room for improvement, but I've had way more issues with corrupted saves on Saturn and PlayStation because flash sucks, early flash is twice as bad.

I think many of the modern complaints come from people who want to hoard saves the way they hoard games, something that nobody at Hudson/NEC thought of when they designed the system 30 years ago. They didn't know people would acquire complete libraries and try to keep the same dumb Neutopia II save for 18 f*cking years. If the PCE (which is a SUPREMELY well designed system, btw) had a system that could keep unplayed saves for decades on end it would have outlasted every NES cart, most SNES carts, a lot of Laserdiscs, VHS tapes, audio cassettes, Zip Disks, Famicom Discs, and pretty much every single flash thing from its invention until at least the late 90s. It would be kinda weird for NEC to design a game machine than cost $600 in the 80s so that people could not use it for months. Why did they buy it then?

Please get real. These people weren't being "stupid" they were genius. And while I can see the use of a better memory manager or something, the system as it exists works pretty much perfectly for me. I play the game every couple of days until I'm either bored of it or I finished it. If I don't turn my PCE on for two months...well I guess I don't play all that much PCE do I? The save disappears after my interst in the game has disappeared. I have no use for a year old RPG save because I'll never be able to tell where the f*ck I am or what I was doing. Most early RPGs have very few reminders that say "this is what you were doing" so I'll just wander around in circles until I realize how much time I could save by just starting the game over.

Jesus f*cking christ, calm the f*ck down, your fanboy panties are starting to show.  It WAS a stupid system and still is.  I am not complaining because an "18 year old save is no longer on the system", exactly when did I say that?  I lost many saves over the years simply because I didnt turn the system on for a fortnight or so.  THAT is a stupid f*cking system!  Yes, let's all hail the geniuses at NEC!!  I also could not give a damn about "Americans first experience saving to a console", FULL STOP.  What the hell does that have to do with anything?  If NEC were in "geniuses", explain the Super Grafx and PC-FX.  The geniuses were the ones that created games.  Suzuki Yu is a genius.  NEC were not.

And yes, the MEGA-CD's save system was superior in every way possible.  I already said that  onviously a RAM cart could not be used, which made it worse. I KNOW there was nowhere to put it! Duh!  As for the Ten no Koe, I have one but I did not get one until 2001.  I got my original PCE IFU system in 1995.  Where exactly was I supposed to buy a Ten no Koe from?   It was by complete chance I came across one of my game shops selling the PCE, there was nowhere to buy anything PCE related in my country.  I did not even get a SSC3 until 2001 when I got a computer and discovered eBay!   The thing was useless to me until that time. There was not even a similar device released in the US, correct? 

My original PAL MEGA-CD bought on 31 March, 1993 still has saves from back then.  It still has SNATCHER and both LUNARs so that makes it saves from at least 1994.  I never had/do not have a single corrupted PS1 or PS2 card.  Same goes for the Saturn.  The Saturn was the best save cart ever.  You bought one and you never had to worry about running out of memory.  Unlike the tiny PS1 cards.  SONY must have made a fortune from those things.

Vimtoman

  • Sr. Member
  • ****
  • Posts: 380
Re: BRAM upgrade hack
« Reply #11 on: January 12, 2016, 10:40:36 AM »

Well done WilyKat good work.

You got me browsing for another route and I found this IC.

Cypress FM18W08

It's a Fram with a similar pinout.

I think there is a possibility that we could disconnect and gnd the CE pin and use the WE pin in replacement.
The WE pin would need to be pulled high with resistor to prevent power up corruption.

No battery backup :)

What do you think?
« Last Edit: January 12, 2016, 10:42:21 AM by Vimtoman »

Necromancer

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 21366
Re: BRAM upgrade hack
« Reply #12 on: January 12, 2016, 11:19:19 AM »
Is this genius seriously blaming NEC because the system wasn't sold in his country and he wasn't savvy enough to import?!?  :lol:



Anyways, well done wilykat.  The mod ain't for me, but it's always neat to see guys tinkering around to make stuff work they way they want.
U.S. Collection: 97% complete    155/159 titles

toymachine78

  • Guest
Re: BRAM upgrade hack
« Reply #13 on: January 12, 2016, 11:21:14 AM »
Now THAT is what I call a useful upgrade!  It's so stupid that NEC and/or Hudson did not come up with a better save system for the DUO.  Especially seeing as thete was no option for a save-straight-to-RAM-card option like the MEGA-CD and everything afterwards had.

Man, what's with the 21st century bitch fest?

Can you name another console from the same era with a better save system? No, you can't. I know you can't because it was the very first CD-ROM thing ever, and therefore the first system to allow you to save to the machine AT ALL.

Sorry it isn't perfect.

The PCE came out the same year as US Legend of Zelda, most Americans first experience with being to save on a console period. All of these carts have either had their batteries replaced or you can't save on them. But look, my PCE still saves, never replaced anything.

I agree there is a lot of room for improvement, but I've had way more issues with corrupted saves on Saturn and PlayStation because flash sucks, early flash is twice as bad.

I think many of the modern complaints come from people who want to hoard saves the way they hoard games, something that nobody at Hudson/NEC thought of when they designed the system 30 years ago. They didn't know people would acquire complete libraries and try to keep the same dumb Neutopia II save for 18 f*cking years. If the PCE (which is a SUPREMELY well designed system, btw) had a system that could keep unplayed saves for decades on end it would have outlasted every NES cart, most SNES carts, a lot of Laserdiscs, VHS tapes, audio cassettes, Zip Disks, Famicom Discs, and pretty much every single flash thing from its invention until at least the late 90s. It would be kinda weird for NEC to design a game machine than cost $600 in the 80s so that people could not use it for months. Why did they buy it then?

Please get real. These people weren't being "stupid" they were genius. And while I can see the use of a better memory manager or something, the system as it exists works pretty much perfectly for me. I play the game every couple of days until I'm either bored of it or I finished it. If I don't turn my PCE on for two months...well I guess I don't play all that much PCE do I? The save disappears after my interst in the game has disappeared. I have no use for a year old RPG save because I'll never be able to tell where the f*ck I am or what I was doing. Most early RPGs have very few reminders that say "this is what you were doing" so I'll just wander around in circles until I realize how much time I could save by just starting the game over.
My Zelda cart still has my childhood saves from when the game was released. Now thats pretty damn amazing!

synbiosfan

  • Hero Member
  • *****
  • Posts: 716
Re: BRAM upgrade hack
« Reply #14 on: January 12, 2016, 11:45:46 AM »
Is this genius seriously blaming NEC because the system wasn't sold in his country and he wasn't savvy enough to import?!?  :lol:



Anyways, well done wilykat.  The mod ain't for me, but it's always neat to see guys tinkering around to make stuff work they way they want.

A couple decades of hindsight makes it easy to complain sadly.

Very nice work wilykat!