Author Topic: BRAM upgrade hack  (Read 5502 times)

wilykat

  • Hero Member
  • *****
  • Posts: 908
Re: BRAM upgrade hack
« Reply #15 on: January 12, 2016, 11:55:01 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?


Dang 151 years retention. Your great-great-great grandkids could appreciate that 100% fast run save on some of the games. :D

I would leave the /CE as it is, it's what makes the chip (the normal SRAM) go in low power mode, basically "turning it off".  If you tied it to GND, it would always remain on and I am not sure how the "always on" FRAM would affect the system.  You could experiment if you wished.

From the datasheet:
Quote
Note that if /CE is tied to ground, the user must be sure /WE is not
LOW at power-up or power-down events. If the chip is enabled
and /WE is LOW during power cycles, data will be corrupted.
Check if the /WE has a pullup resistor onboard, and add it if there isn't any to disable writing during power on/off

/WE is needed because it toggles data as input or output. And /OE is needed to tristate the data pins so it won't interfere with the data bus.  Just wire them all as normal, taking in account you will need to reroute /WE and VCC from the board to the 2 pins, and wire the uppermost 4 address lines to switches.
« Last Edit: January 12, 2016, 11:57:00 AM by wilykat »

SegaSonic91

  • Jr. Member
  • **
  • Posts: 80
Re: BRAM upgrade hack
« Reply #16 on: January 12, 2016, 09:57:29 PM »
Is this genius seriously blaming NEC because the system wasn't sold in his country and he wasn't savvy enough to import?!?  :lol:



And here I thought fanboys could never be as stupid, ignorant and blind as the nintendorks.  PC Engine fanf*cktards are just as bad it seems.  Importing was not an option, "genius".  See where I said I bought one "AS SOON AS I DISCOVERED EBAY"???  Not everywhere in the world had a thriving import scene!  If I could have bought one before that, I would have!  I'll say it again, the system SHOULD HAVE BEEN IMPROVED WITH THE DUO!  At the very least they could have increased the size!  It is the stupidest back up system I have ever seen.  Unlike the MEGA-CD, there is no indication of how much space you have or how much space each game takes up.  It is not until you boot a game that you discover you cannot save.  The Ten no Koe is rather shit as well.  You cannot transfer files back and forth, you can only transfer the entire block of data.

I bet you are one of those types that thinks PCE Popfulmail is superior to the MEGA-CD version (LMFAO!!!) while defending Strider Hiryu as being a good game.  You're a rude, ignorant  joke.

Vimtoman

  • Sr. Member
  • ****
  • Posts: 380
Re: BRAM upgrade hack
« Reply #17 on: January 12, 2016, 10:43:05 PM »
Wilykat what was the original Sram IC number?

I have ordered a Fram IC. Only a few in stock.

I think we need to add the pull up on WE.

Also I thought that as you were looking for an alternative to a switch a TTL counter like a 74HC393 would do with a de bounced push button. It could be enabled to switch only when the CE was high preventing corruption when switching.
« Last Edit: January 12, 2016, 11:31:51 PM by Vimtoman »

esteban

  • Hero Member
  • *****
  • Posts: 24063
BRAM upgrade hack
« Reply #18 on: January 12, 2016, 11:25:48 PM »
Note: this thread would be better if split into two distinct conversations (that is, two separate threads)...

(1) BRAM upgrade hack
(2) the virtues and/or flaws of PCE backup

ALSO NOTE:

It has come to my attention that agents of FEKA are in our midst. Be wary, comrades.

Be wary.
« Last Edit: January 12, 2016, 11:27:42 PM by esteban »
  |    | 

wilykat

  • Hero Member
  • *****
  • Posts: 908
Re: BRAM upgrade hack
« Reply #19 on: January 13, 2016, 01:31:24 AM »
Wilykat what was the original Sram IC number?

LC3517B

Quote
I have ordered a Fram IC. Only a few in stock.

I think we need to add the pull up on WE.


Check to see if there's already a resistor on the original /WE line

Quote
Also I thought that as you were looking for an alternative to a switch a TTL counter like a 74HC393 would do with a de bounced push button. It could be enabled to switch only when the CE was high preventing corruption when switching.


That one only counts up.  There's a CMOS chip that can do binary count up and down.

Here's a few images to help:
original chip

/WE and VCC on original pad did not line up with new SRAM chip


A11 and A13 on the new chip is where /WE and VCC was so that's why I lifted those pins and added wire from the pad to the 2 pins.  Also I lifted the 4 topmost pins so they weren't touching the PCB to prevent accidental contact with something on PCB.

The pin for address A11, A12, A13, and A14 are then wired to switch or something that can hold high and low to select the pages.

I also found hi-res image of black Duo and the SRAM location is easier to access with a lot more room:

Yellow arrows point the location of SRAM (exact same chip size and type as Duo-R) and the backup cap.

Necromancer

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 21366
Re: BRAM upgrade hack
« Reply #20 on: January 13, 2016, 01:46:12 AM »
And here I thought fanboys could never be as stupid, ignorant and blind as the nintendorks.  PC Engine fanf*cktards are just as bad it seems.  Importing was not an option, "genius".  See where I said I bought one "AS SOON AS I DISCOVERED EBAY"???  Not everywhere in the world had a thriving import scene!  If I could have bought one before that, I would have! 

Don't blame NEC (or me) because you were too dumb/lazy/ignorant to search out your import options.  You claim that importing wasn't a possibility, yet somehow you managed to buy an imported briefcase?  Obviously importing was an option for people with more brains than mouth, however difficult and expensive the process may have been.

I find it quite humorous that the sole poster going on and on about 'fanboys' and saying we should all 'calm down' is the only guy making sweeping generalizations, name calling, and cursing like a sailor.  Such delicious irony.



If you put in that FRAM stuff, does that mean the big cap is unneeded, maybe even necessarily removed?
U.S. Collection: 97% complete    155/159 titles

toymachine78

  • Guest
Re: BRAM upgrade hack
« Reply #21 on: January 13, 2016, 09:06:42 AM »
I find this one works the best for this application. It has 3X the memory capacity of the OEM Duo hardware


Vimtoman

  • Sr. Member
  • ****
  • Posts: 380
Re: BRAM upgrade hack
« Reply #22 on: January 13, 2016, 10:14:45 AM »
Thanks Wilykat.

I guess it would be helpful polling up and down.
4bits is 16 extra banks.
It may be cheaper and easier to source an appropriate switch.
I quite like a rotary.
It would also be easier for everyone else to mod themselves this way.

I should have the Fram soon. I will look for a switch solution first.

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: BRAM upgrade hack
« Reply #23 on: January 13, 2016, 10:19:24 AM »


And all wilykat was trying to do was upgrade his BRAM... Man... ;)

SignOfZeta

  • Hero Member
  • *****
  • Posts: 8497
Re: BRAM upgrade hack
« Reply #24 on: January 13, 2016, 02:10:35 PM »
You know what sucks? The Ford Model T. Two forward gears and only 20HP!? Trying to enter highway traffic is terrifying!

My VW Golf fixes all these issues, and it has an ashtray. Better luck next time, Ford, ya f*cking 'tards.

EDIT: My apologies to the Kat, who has done something really cool. I hope it leads to a kit of some sort. I overreacted to a small stupid thing and it exploded into a bigger stupid thing. I didn't honestly think he'd run so far with what is clearly a logically, historically, and technologically flawed stance. Most people just give up, but he doubled down. I did not expect that.
« Last Edit: January 13, 2016, 02:14:36 PM by SignOfZeta »

Black Tiger

  • Hero Member
  • *****
  • Posts: 11242
Re: BRAM upgrade hack
« Reply #25 on: January 13, 2016, 03:37:33 PM »
Is this genius seriously blaming NEC because the system wasn't sold in his country and he wasn't savvy enough to import?!?  :lol:



And here I thought fanboys could never be as stupid, ignorant and blind as the nintendorks.  PC Engine fanf*cktards are just as bad it seems.  Importing was not an option, "genius".  See where I said I bought one "AS SOON AS I DISCOVERED EBAY"???  Not everywhere in the world had a thriving import scene!  If I could have bought one before that, I would have!  I'll say it again, the system SHOULD HAVE BEEN IMPROVED WITH THE DUO!  At the very least they could have increased the size!  It is the stupidest back up system I have ever seen.  Unlike the MEGA-CD, there is no indication of how much space you have or how much space each game takes up.  It is not until you boot a game that you discover you cannot save.  The Ten no Koe is rather shit as well.  You cannot transfer files back and forth, you can only transfer the entire block of data.

I bet you are one of those types that thinks PCE Popfulmail is superior to the MEGA-CD version (LMFAO!!!) while defending Strider Hiryu as being a good game.  You're a rude, ignorant  joke.

You are dismissing entire console fan-bases except the one you prefer, yet are declaring those who disagree with you as being irrational. I take it you are somehow unfamiliar with Sonic fan-fiction, or are the type of Sega/Sonic fan who hates non Sonic sex stuff?

I started mail-ordering games, including Japanese games, in 1989 and have continued to till this day. I also bought European game mags through the 90's and also know from game forums how importing was much bigger in Europe than in North America. Your ignorance doesn't change history or reality.

I'm not going to bother describing the subtleties of PCE save management or point out the many flaws in other systems during the time period you describe (dying Saturn cart slots, slow PSX save/loading, etc), because you're obviously aren't open to discussion or learning. The fact that you are obliviously critical of "NEC hardware" while championing the PAL Mega-CD for keeping saves for a library of games looking, sounding and playing broken shows who the "rude, ignorant  joke" really is.

I take it that you judge games solely by the superficial aspects of their graphics and selective technical aspects? Did you really play all the way through PCE Popful Mail and one of the Sega versions?

I agree that Strider isn't a good game, I thought as much the first time I played through it when it was released for Genesis. That's why I don't care much about the unfinished PCE version.
http://www.superpcenginegrafx.net/forum

Active and drama free PC Engine forum

Vimtoman

  • Sr. Member
  • ****
  • Posts: 380
Re: BRAM upgrade hack
« Reply #26 on: January 13, 2016, 08:49:55 PM »
WilyKat Fram arrived today.
Just put it in and it works!!!! No Sram no Cap not loss of data for years and years and years....


Formated Ram OK.
Have just tried Soldier blade and save is in the bank.



Just ordered some switches which are Hartman PT65503 16way hex.

Just want to Thank you WilyKat starting all this.
I wouldnt have attempted it otherwise.

Will wire up the switch when it arrives and post to all.
« Last Edit: January 14, 2016, 05:27:57 AM by Vimtoman »

wilykat

  • Hero Member
  • *****
  • Posts: 908
Re: BRAM upgrade hack
« Reply #27 on: January 14, 2016, 06:14:53 AM »
Great!!  So the FRAM means no need to replace that tiny cap.  I mean 151 years is a f*cking long time, someone would have cooked up something better like optical crystal that is pin compatible with legacy SRAM and has data retention in million years.

I ordered the 7 segment LED display and worked on Arduino to come up with something that can use 2 buttons for up and down, display current page, and control address lines.  It has enough pins to control up to 64 pages (6 address lines, 128kx8 SRAM)

ATMega328p costs around the same as getting a few chips like binary counter with up/down and 7 segment display driver but should take less wiring in the end. Plus the binary counter is only 4 bits, you'd need to cascade to get more address, and you'd need a lot of work to make the display show decimal (0-9) rather than hexidecimal (0-9 and A-F)

I am very much tempted to get 2x this:


It may be "more work" than a simple DIP switch or hexadecimal rotary/thumb switch but it'd look more elegant than a bunch of switches, and also a bit friendly with people who can't read or understand switch binary. Not to mention no one makes DIP switch big enough for the visually impaired.

wilykat

  • Hero Member
  • *****
  • Posts: 908
Re: BRAM upgrade hack
« Reply #28 on: January 14, 2016, 07:13:45 AM »
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[] = {A5, A4}; // equals to number of digits used,
         byte segmentPins[] = {9, 10, 11, 12, A0, A1, A2, A3}; // 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(90); // 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();
}

I went ahead and did a quick prototype and with a ghetto -seg LED made from regular LED, I can tell it is working.  5 pins left means I can do 3 display for 128, 256, and 512 pages.  Still it'd be overkill.

Pic:


(could be better but best I can do in 10 minutes :P plus my keyboard tray is about 20 years old so it is beyond ugly but still working)

The blue LED represents the individual element of the 7 segment LED (plus 2 for second digit). It is set to start at page one and end at 16. I could set it to roll over instead of stopping but I liked this way better.
The red LED represents the binary output for the SRAM address.

Video of it in operation:

Vimtoman

  • Sr. Member
  • ****
  • Posts: 380
Re: BRAM upgrade hack
« Reply #29 on: January 14, 2016, 07:33:45 AM »
That looks really good.
Where you thinking of mounting this?

What about including a /CE check so that the memory is not changed when being accessed by the system.