Page 1 of 1

Genesis SRAM Access Issue

Posted: Mon Sep 07, 2020 8:00 am
by poorstudenthobbyist
Hi all, I had a problem earlier in the week with my Genesis boards. I've solved the problem, but I'm not exactly sure why the solution works. So this could serve at least as a cautionary tale for other developers.

On my Genesis save circuit, I use a transistor set up that I also use for my SNES 256K SRAM save circuit. The Genesis /VRES line connects to the base of the transistor through a resistor, and /VRES is also directly connected to the 74HC74 necessary for the Genesis save circuit logic. I find that if I use a 1k ohm resistor for the base resistance (RB) on the transistor, the SRAM doesn't seem to be activated. It gets pulled low for a split second then goes high and stays there, and stops trying to activate. If I use a 10k or 100k ohm resistor, though, it works fine, and you can see the multiple pulses of the SRAM's /CE.

I came across this problem because I was testing a new design, and I didn't feel like fishing out a 10k resistor when I had plenty of 1k ones nearby. I tried a bunch of different things and finally tried changing the base resistance, to find that that was the solution. I don't have this problem on SNES, for example, I can use any resistor value 100k or less (including just shorting the base resistor) and it'll work fine. So I'm not sure exactly what's going on. My only guess is that the /VRES line can't supply as much current as the SNES /RESET line, and that causes some temporary overcurrent condition on the Genesis. (Note the game doesn't freeze when it tries to access the SRAM, it just stops trying to access it).

I discussed this with lidnariq, and he gave me some good information about the internals of the consoles:
lidnariq wrote:The SNES /RESET line is a 1kΩ resistor from a - I believe - push/pull output from S-PPU2. ... nd-pinouts

The Genesis has a 47kΩ pullup on /VRES, and it's pulled to ground by the 68k and/or bus arbiter. ... _megadrive
So, I'm not really worried about the situation too much, since I know the solution, I just don't know exactly why the solution works. Schematics and o'scope traces attached. (Note that the traces represent the /CE line on the SRAM (/CE_SRAM_BATT) - they are actually measured at the base of the transistor in the figures, but it yields similar results when measuring the /CE line of the SRAM directly)

Re: Genesis SRAM Access Issue

Posted: Thu Jan 21, 2021 11:20 pm
by poorstudenthobbyist
Just an update: these original tests were with the save circuit for games greater than 16 Mbit in size that require toggling between the upper ROM bank and RAM. I decided to try this out with games that didn't need the toggling, and got some different results. Changing the base and collector resistors didn't seem to matter much (as long as they're within reasonable limits of each other with respect to hfe). I didn't get the error like last time that caused the /CE signal to stop prematurely.

I also did these tests on my Super Retro Trio to see if there were any differences there. The success rate was the same (similar behavior happens with the 1k base resistor for >16 Mbit ROMs) but the voltage on the base of the 2N3904 was a bit less than 4V, rather than the full 5V on my Genesis 2. It doesn't seem to be in danger of causing issues though, it's still sufficiently high enough to operate normally.

I'm still not really sure what's causing the abnormality with the >16 Mbit ROMs, but I figured I'd update my results. Attached are some scope traces - Ch1 (yellow) is the collector of the transistor, Ch3 (purple) is the base of the transistor.