Resistor interfering with backup SRAM?

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
Post Reply
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Resistor interfering with backup SRAM?

Post by Fisher »

Hello and happy new year!
A while ago, I've got a "thrashed" Sonic 3 cartridge and with some help I could put it back to work.
So far so good. The cartridge has been played locked with Sonic & Knuckles and saves fine with it.
The problem is that if I play the cartridge alone, it also don't saves but corrupts the old saves too.
This seems really weird!
Would the resistor I used to fix the boot problem be causing some interference with the saves?
If so, what can I do? Put an pull up resistor with the same value or trying to add a buffer on this pin (D7) be the most apropriated solution?
Thanks in advance.
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Resistor interfering with backup SRAM?

Post by Fisher »

I know this seems silly, but the resistor interfering with the SRAM writes is the only thing I can think of.
I tested the SRAM enable circuit and it seems just fine.
I removed th SRAM and put it as a PRG RAM on a NES clone I have and it worked fine.
Heck! It functions fine when locked on, so I don't know whrere to look for answers...

Testing the FeRAM as suggested to test the ROM on the other thread gave me similar results on the IC's pin D7.
Strangelly, when the FeRAM was on the circuit it didn't save even with the resistor mod.
Maybe it's a completelly different history, since the pin is not only an output, but an input too.

I could find an SMD DM7407, but its datasheet says the output when in high level is 30v!
I don't think my MD will survive to this...
Maybe if I use 2 NOT gates of a 74HC04?
If I could do a transistor based circuit, it will probably be easier to solder on th PCB and save some space.

Could this circuit possibly work fine as a digital buffer?

Code: Select all

ROM D7--------E      C --------Cart PCB
               \____/          
         1K      | B  NPN
 5V-----\/\/\----+
I'm thinking in use a BC548, but I'm not sure if it will be fast enough.
Maybe a BF494 should be better suited for that?
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: Resistor interfering with backup SRAM?

Post by nocash »

Going by the other thread, you have repaired megadrive cartridge, by soldering a 1k pulldown resistor to a broken pin on an unspecified chip? No idea which pin on which chip... but 1k sounds violent... if it's working with 3k..33k then better use that, the bigger the better, ie. less risk to damage your unspecified chip, and less risk to disturb your ram chip (if that's also connected to your unspecified pin).

Not sure what you want to use 7407 what for, but it's open collector, that means that it doesn't output anything when "high", certainly not 30v, and certainly nothing higher than you power supply anyways. The 30v in the datasheet just means that it won't die when attaching an external 30v pullip to the output.

Hmmmm, as far as I understand you want to compensate problems caused by your pulldown resistor by attaching a conditionally switched pullup resistor to it? Whilst that might work, it isn't actually a suitable straightforward solution for the problem. A bit like using a hearing aid to compensate ear plugs.
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Resistor interfering with backup SRAM?

Post by Fisher »

nocash wrote:No idea which pin on which chip... but 1k sounds violent...
It's the pin D7 of the ROM chip.
I followed TmEE's advice and searched for a pin wich reacted different for the diode test and that was the pin.
Since that was the value of the resistor used on the MegaKey adapter, I've stick with that.
I'll try your tip and put a bigger resistor, thanks. :-)
nocash wrote:Not sure what you want to use 7407 what for
The objective is to make the resistor to not cause interference with the other part of the circuit.
I think an open collector buffer would do the job, just putting it after the resistor.
Am I correct?
I also found pretty weird to have an output with a higher tension than my power supply, but...
nocash wrote:Hmmmm, as far as I understand you want to compensate problems caused by your pulldown resistor by attaching a conditionally switched pullup resistor to it? Whilst that might work, it isn't actually a suitable straightforward solution for the problem. A bit like using a hearing aid to compensate ear plugs.
Exactly! Mostly like a workaround to fix a problem caused by other workaround. :roll:
I think the best solution would be to write a new EPROM with the game data and substitute it's ROM.
But that unfortunatelly is out of my reach.
I'll try your tips as soon as I can.
Thanks! :wink:
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Resistor interfering with backup SRAM?

Post by lidnariq »

Fisher wrote:I could find an SMD DM7407, but its datasheet says the output when in high level is 30v!
It doesn't generate 30V from scratch! It's just an open-collector inverter.

It's basically identical to this:

Code: Select all

           OUTPUT
          _|
INPUT --||_
           |
          gnd
The 30V is the maximum voltage it can be exposed to without itself taking damage.
Could this circuit possibly work fine as a digital buffer?

Code: Select all

ROM D7--------E      C --------Cart PCB
               \____/          
         1K      | B  NPN
 5V-----\/\/\----+
No, that tries to use a BJT as a transmission gate. It "works" but not very well. It doesn't buffer anything at all.
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Resistor interfering with backup SRAM?

Post by TmEE »

It is more likely that the FeRAM bank you're using is damaged. You should tie the unused address line to different state to use the fresh FeRAM bank on the chip. The game uses early type of FeRAM with much more limited write cycle capability than modern chips and it isn't the first time I see a damaged FeRAM in Sonic3 carts.
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Resistor interfering with backup SRAM?

Post by Fisher »

TmEE wrote:It is more likely that the FeRAM bank you're using is damaged.
That makes a lot more sense.
By the way, I'm not using the original FeRAM, I'm using a SRAM I got from an old famiclone.

I didn't have time to try to solve this issue yet. :cry:
But maybe when I tried it as a NES clone PRG RAM it could have used only part of it and worked fine.
I'll try to alternate the address pins that are grounded first, since when locked on the game saves fine.
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Resistor interfering with backup SRAM?

Post by TmEE »

Do you have a proper battery management circuit there ? The 8 pin chip that most carts have rather than some diodes and resistors arrangement ?
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Resistor interfering with backup SRAM?

Post by Fisher »

I'm using this circuit as power management:

Code: Select all


                 10K
              +--/\/\------SRAM /CS
              |   1K
 -Batt+--->|--+--/\/\---+--SRAM Vcc
 |      1N4148          |
GND                     |
       Console's --->|--+
          Vcc     1N4148
It's working fine on a pirate Mario Kart I have.
How good (or bad) is it?
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Resistor interfering with backup SRAM?

Post by TmEE »

I have found similar circuits to be completely unreliable when you remove the cartridge or otherwise handle it, more often than not the SRAM gets corrupted.
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Resistor interfering with backup SRAM?

Post by Fisher »

Interesting.
This can sure be one of the reasons that this corruption happens.
Can you please suggest a good circuit?
Maybe I should use a transistor on the /CE or /WE pin?
Looks like I'll finally have time to try to fix this tonight, so any suggestions are welcome.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Resistor interfering with backup SRAM?

Post by lidnariq »

The discretes battery switchover-and-protection circuit I've seen used looks like ( picture instead of ascii art in https://forums.nesdev.com/viewtopic.php ... 57#p110357 )

Code: Select all

 +5V
  |
  +-----+
  |     |   
 1k     |   
  |   |↙    
  +---|     
  |   |\    
 8.5k   +--- +PowerGood
  |     |   
 gnd   100k 
        |
       gnd
                Vups
                 |
               _____
+PowerGood ---o\    \   ← must be CMOS, not TTL
                )    >--- /RAMCE
/RAMEN     ----/____/
                 |
                gnd

Vbat ---|>|---1k---+---- Vups
+5V  ---|>|--------+
Use schottky diodes with a low forward voltage.

If you're using a RAM with a separate +CE input, you can connect +PowerGood to it instead of using a demultiplexer / inverter and OR gate.
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Resistor interfering with backup SRAM?

Post by Fisher »

Thanks!
Shifting an address pin (I think it's A9) from GND to VCC did the trick. The game is saving fine now.
I don't think the FeRAM can be reused because of that anomaly in pin D7.
I don't know why the NES game booted with this bad RAM. Maybe the failed addresses were not used or not critical for the 2 games I tried...

@lidnariq for the diodes would 1N4148 do the trick?
I have a couple of them at hand with some BC558 bjt. Do they fit the needs?
For the OR gate, I think I saw some 74HC32 on the junk pile. If they fit I can "harvest" a couple of them.
Thanks for the schematics. :-)

If I was going to use a rechargeable battery, I would need to just omit the battery's diode?
Wich would work best, a rechargeable or a not rechargeable battery?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Resistor interfering with backup SRAM?

Post by lidnariq »

Fisher wrote:@lidnariq for the diodes would 1N4148 do the trick?
It depends on the specific RAM you're using.

You need to check out the minimum retention voltage for the RAM, the current drawn in standby mode, the forward voltage of the diode you're using at that current, and make sure that's something that could operate off the battery.
Similarly, you need to check the minimum active voltage for the RAM, the current drawn in active mode, the forward voltage of the diode you're using at that current, and make sure that's something that could operate off +5V.

Whether a 1N4148 would work depends on lot of the other specifics.
I have a couple of them at hand with some BC558 bjt. Do they fit the needs?
Yeah, any old PNP transistor will do. You might need to adjust the 8.5k resistor: just make sure that PowerGood transitions from +5V at some appropriately high voltage.
For the OR gate, I think I saw some 74HC32 on the junk pile. If they fit I can "harvest" a couple of them.
Note one of the inputs on that OR gate was inverted. A 74HC139 or 74HC138 might be easier.
If I was going to use a rechargeable battery, I would need to just omit the battery's diode?
Depends on the battery. Every secondary cell needs a different charging circuit, and you need to pick the correct thing for it.
Which would work best, a rechargeable or a not rechargeable battery?
Secondary (rechargeable) cells usually have substantially higher self-discharge rates than primary (non-rechargeable) cells. It's not rare to hear of CR2032s (Lithium primary cells) that still retain the contents of RAM two decades later; rechargeables certainly won't last that long.
Post Reply