Upgrading Duo's memory saves

Discussion in 'Modding and Hacking - Consoles and Electronics' started by wilykat, Jan 8, 2016.

  1. wilykat

    wilykat Site Supporter 2013

    Joined:
    Mar 25, 2012
    Messages:
    991
    Likes Received:
    45
    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
    [​IMG]
    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
    [​IMG]
    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
    [​IMG]
    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:
    // unused pin: 0 and 1, 4, A4, and by removing DP pin, A5
    // 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
    150ns or faster
    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.

    First: desoldering the chip.

    [​IMG]

    The chip was a pain to remove, it used some strong glue (red blobs on picture above) to hold it down. Fortunately no damaged trace or lifted pad.

    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 this Duo-R. Plus it was past 4 AM here when I stopped and I am expected up before 9 AM. [​IMG] Time flies when you're high on solder fume. (and still can't sleep at almost 8 am)
     
    Last edited: Jan 19, 2016
    skyway1985 likes this.
  2. GoodTofuFriday

    GoodTofuFriday Site Supporter 2015,2016,2017

    Joined:
    Sep 1, 2013
    Messages:
    498
    Likes Received:
    194
    if this works I want to do it on my turbgrafx. interesting stuff!
     
  3. skyway1985

    skyway1985 Enthusiastic Member

    Joined:
    Jan 23, 2014
    Messages:
    543
    Likes Received:
    130
    good thing is turbo is DIP so its 10X easier lol
     
  4. CkRtech

    CkRtech Spirited Member

    Joined:
    Sep 10, 2014
    Messages:
    135
    Likes Received:
    34
    It was literally just last night that I started region modding my Duo-R. I thought that it would be the last mod I perform on the Duo-R after having done a recap, new laser, RGB, new super capacitor, and (today) viletim's jailbar cure...but no. Wilycat shows up with something awesome.
     
    skyway1985 likes this.
  5. lolifoxgirl

    lolifoxgirl Member

    Joined:
    Jan 7, 2016
    Messages:
    21
    Likes Received:
    13
    Tennokoe bank wasn't enough? This is a cool mod though.
     
  6. wilykat

    wilykat Site Supporter 2013

    Joined:
    Mar 25, 2012
    Messages:
    991
    Likes Received:
    45
    Tennokoe bank card averages $15, adds only 4 pages, and one would probably want to replace the original battery before using it. Also Tennokoe bank card can't be used on any USA consoles without adapters. My mod has no region restriction and the size is only limited to the size of SRAM being installed and switches wired up. 5v SRAM goes to 128K (64 pages), maybe more. If you're willing to handle the 3.3v difference, there are SRAM up to 4Mbit (512KB or 256 pages or more than all PCE games would ever need.

    So far I figure my 32KB mod is about $10 total including shipping, that is like 4 bank cards in one.That potentially leaves me an extra $50 for something else.
     
  7. lolifoxgirl

    lolifoxgirl Member

    Joined:
    Jan 7, 2016
    Messages:
    21
    Likes Received:
    13
    Somehow I thought you were modding a duo-r. Looking forward to seeing how it turns out but wow is that some tricky soldering you did to lift that thing up.
     
  8. wilykat

    wilykat Site Supporter 2013

    Joined:
    Mar 25, 2012
    Messages:
    991
    Likes Received:
    45
    Yeah it was tricky since it was glued on pretty firm. I ended up having to use dentist pick to heat and lift one pin at a time. Cutting the pins would have worked as well but I didn't want to risk slipping and cutting something else.

    Anyway I found this one: http://www.digikey.com/product-detail/en/IS61C5128AS-25QLI/706-1060-5-ND/1790126
    512KB SRAM. That would make 256 pages and I could see a problem with it. I can imagine someone going "Where the fuck did I store that ultimate save?" and going through the entire memory one page at a time.

    I forgot to warn if you're planning to do similar mod, most SRAM bigger than 32KB may come in larger package size and would require adapters or lots of wiring to make it work.

    I was looking to see how much would be needed to have every single save-able game on one system and found this one: http://www.blackfalcongames.net/?p=190 not quite complete but it looks like 256 pages save is overkill.
     
  9. lolifoxgirl

    lolifoxgirl Member

    Joined:
    Jan 7, 2016
    Messages:
    21
    Likes Received:
    13
    Ill be honest, if this works for you i might do mine. Might and magic 3 eats the entire data space on my duor.
     
  10. wilykat

    wilykat Site Supporter 2013

    Joined:
    Mar 25, 2012
    Messages:
    991
    Likes Received:
    45
    M&M3 does eat a lot. One of the page that has save game listing mentioned M&M3 uses 1969 blocks out of 2000. I think that's byte per block and a few more blocks (48?) reserved for management. That would fit in 2048 bytes or 2k the system uses.

    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:

    [​IMG]

    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.

    [​IMG]
    Finished work. I used the 5v and ground pins of the nearby vreg chip since it was most convenient. The location will vary in black Duo, CD system and no reg in Turbobooster Plus, Save Booster, and Tennokoe2.

    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.
     
  11. GoodTofuFriday

    GoodTofuFriday Site Supporter 2015,2016,2017

    Joined:
    Sep 1, 2013
    Messages:
    498
    Likes Received:
    194
    What does the dip switch do?
     
  12. CkRtech

    CkRtech Spirited Member

    Joined:
    Sep 10, 2014
    Messages:
    135
    Likes Received:
    34
    Bank/page selection, I assume.
     
  13. lolifoxgirl

    lolifoxgirl Member

    Joined:
    Jan 7, 2016
    Messages:
    21
    Likes Received:
    13
    Yeah, bank switcher. Wow that came out nice, you have the fingers of an angel.
     
  14. Helder

    Helder Site Supporter 2014,2015

    Joined:
    Apr 6, 2013
    Messages:
    981
    Likes Received:
    54
    Do you have the data sheets or pinout of the old chip and new chip? Might be able to make a quick solder adapter for this mod, can you take a good photo of that area on the motherboard so I can get an idea of the space there.
     
  15. wilykat

    wilykat Site Supporter 2013

    Joined:
    Mar 25, 2012
    Messages:
    991
    Likes Received:
    45
    Big picture of from before I started the mod: http://i.imgur.com/Er6RUCM.jpg IC512 is the SRAM chip. The backup cap is the 2 solder spot to the left of the SRAM, above C511 and to the right of R543

    For location reference, the 3 solder spot above C304 on right side of the piture is one of the 2 7805 Vreg chip that Duo-R has.

    Old chip: LC3517B-15 which is 16kbit or 2kx8, 150ns
    New chip: 62256A-10 256kbit or 32kx8, 100ns

    I am still having some trouble and I did double check the spec, both chip seems to have the same basic stuff, just 4 extra address line added. I did check to be sure VCC and /WE is correctly wired, and no accidental bridge or short. Maybe I have a dud chip? Or maybe 100ns is too fast?
     
  16. wilykat

    wilykat Site Supporter 2013

    Joined:
    Mar 25, 2012
    Messages:
    991
    Likes Received:
    45
    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:
    [​IMG]
    2: wire up something like ATMega with 2 push button, LED display, and have it control address. Like this memory card:
    [​IMG]

    Advantage of one: smaller, neater, quicker, easier. Also cheap like this one: http://www.allspectrum.com/store/bc...pen-push-type-plaimae-corporation-p-1320.html Disadvantage, octal switch limited to 3 address (16k) and hexadecimal switch to 4 (32k). You would need a gang of 2 or 3 to handle larger SRAM and if you have unused pin on the switch, you will need to remember not to roll the thrumbwheel switch past the end or it may cause issue.

    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.
     
  17. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,566
    Likes Received:
    1,309
    Writing the code you need for the arduino is probably an easy introduction. It's pretty basic and shouldn't take you more than an hour to figure out.
     
  18. wilykat

    wilykat Site Supporter 2013

    Joined:
    Mar 25, 2012
    Messages:
    991
    Likes Received:
    45
    Waiting for 7 segment LED display to show up, I have the code done (a little debugging) and I should be able to put together something that can control address lines and show page number. The code I made has a few pins left and could do 64k and 128k (32 and 64 pages) easy. Beyond there there won't enough pin for 3rd digit display and more address without having to add shift registers but TBH who really needs 128 or more pages of saves? I doubt there are that many good games that warrants saving every single save slots. For me, 16 is enough and if I need to dump them for more space, I have Memory Base 128 and Private Eye Dol game that can transfer whole 2k pages, I could move all 16 (one at a time) to Memory Base 128.
     
  19. wilykat

    wilykat Site Supporter 2013

    Joined:
    Mar 25, 2012
    Messages:
    991
    Likes Received:
    45
    Code:
    go to first page for tweaked code
    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:
    [​IMG]

    (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 reporesents the binary output for the SRAM address.

    Video of it in operation:
     
    Last edited: Jan 19, 2016
  20. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,566
    Likes Received:
    1,309
    You could just use a 7447 seven segment driver and a binary counter to do the same with no code too.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page