SNES NPN transistor battery circuit necessary?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
poorstudenthobbyist
Posts: 54
Joined: Fri Jun 24, 2016 4:20 pm

Re: SNES NPN transistor battery circuit necessary?

Post by poorstudenthobbyist » Wed Sep 18, 2019 3:18 am

I did look into the NVRAM as you mentioned a bit but I didn't see any chips that were less than $10 so I gave up haha

I didn't notice that on the data sheet, I guess I didn't look too hard at it. Shame on me! I thought I bought these on a recommendation I saw years ago, they've just been sitting in my parts cabinet and I wouldn't have SRAM lying around for any other reason. I wonder if it's a similar situation for the 256K. I've only been using the 256K since I can disable the top two bits on my boards so it's just been more convenient to use.

I guess I'll search for more suitable RAM later and order some. Any suggestions off the top of your head? I am going to take the SRAM off the SNES board and put it in mine later today and see what the drop is there.

If that's really all the problem was, I'm also gonna do some more long term testing with my circuit. Really hope that's the case!

poorstudenthobbyist
Posts: 54
Joined: Fri Jun 24, 2016 4:20 pm

Re: SNES NPN transistor battery circuit necessary?

Post by poorstudenthobbyist » Wed Sep 18, 2019 8:51 am

Just got around to checking the HM62256 SRAM, the typical standby current is 0.5mA, which across a 1k resistor (what I have) is 0.5V, which would explain the voltage drop I see. Going to try the Sony CXK58256P/M-10L which has a typical standby current of 0.002mA. The only problem is they're a lot more expensive than the HM62256s.

The UT6264CPC-70L is a 64k SRAM with 2uA of standby current so that's even better. Gonna grab some of those I think.

Any other suggestions for part numbers are welcome :)

User avatar
infiniteneslives
Posts: 2097
Joined: Mon Apr 04, 2011 11:49 am
Location: WhereverIparkIt, USA
Contact:

Re: SNES NPN transistor battery circuit necessary?

Post by infiniteneslives » Thu Sep 19, 2019 10:31 am

ISSI, Cypress, and Alliance all have and assortment of 256Kbit low power SRAMs available for close to $1each. Something like IS62C256AL for example. If you upgrade to the 1Mbit versions you also gain a CE pin which you can simply connect to /RESET (IS62C1024AL for example).

Honestly, so long as the IC driving the SRAM /CE pin is designed for partial power down, you're likely to be fine with just the diode pair, resistor in series with battery and diode (measure voltage across this resistor to verify retention current is low), and ~10k pullup on /CE pin to SRAM supply.
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers

poorstudenthobbyist
Posts: 54
Joined: Fri Jun 24, 2016 4:20 pm

Re: SNES NPN transistor battery circuit necessary?

Post by poorstudenthobbyist » Thu Sep 19, 2019 7:21 pm

Ok, so I did some more reading and researching. I think I understand why the transistor circuit is included on the boards. I'm going to repeat myself a bit but I want to give a clear picture of my findings.

So, from what I've seen, many SRAM chips in the 62256 and 6264 family have a specification on their datasheets for "Standby current" and "Data retention voltage". Normally, I see a data retention voltage of 2V. The standby current is the current that the SRAM draws when in a low power state, which the SRAM enters whenever the supply voltage is (usually) below 4.5V. The SNES outputs ~5V onto the cartridge, the battery is set for 3.3V, so whenever the SNES is on the SRAM operates normally. Whenever the VCC voltage on the SRAM is below 4.5V, as when the battery is the sole supplier of power, it enters a sleep mode where data is stored but functionality is disabled (as long as that supply voltage is above the data retention voltage specification).

The standby current on the chips I had was pretty high. With a resistance of 1kΩ (which is used on the SNES boards), the current was high enough that the voltage could drop down below the 2V necessary to keep the SRAM on (V=IR, so for example 0.5mA through 1kΩ resistor is a full half volt across the resistor, subtracting from the battery voltage puts it at 2.7V). The blocking diode also has a voltage drop based on current as well, in the datasheet. On my original boards from when I first posted this last year, I had used 220Ω resistors because they were convenient. Therefore, with the lowered resistance, I didn't see the effects of the voltage drop as much, BUT I was still discharging the battery faster than I noticed. This wasn't (completely) due to the circuit I used, it was due to my SRAM chips. Kinda. More on that later.

So what I'm saying so far is, my circuit seems to work just as well as the official Nintendo one. Except for one key component.

The standby current on most datasheets I've found for the better-suited parts are in the microamps. But this comes with a very important caveat. For one 64K SRAM chip, for example, this standby current is in the microamps ONLY when the /CE voltage is held high, OR when the CE2 pin is held low (within 0.2V).

Image

(I ordered the -LL chips, for reference).

So, the boards with the transistor circuit have a pull-down resistor on the CE2 pin, which is also connected to the emitter of the NPN. This means the CE2 pin will be defaulted to GND whenever the board is off, or the reset button isn't pressed (because /RESET on the cart is 5V during normal operation). Whenever the RESET line is 5V, the CE2 pin is pulled high, which allows the operation of the SRAM.

Image

Thus, whenever the power is off, the CE2 pin is tied to GND which then allows the standby current on the SRAM to drop to very low currents. This is why the transistor circuit is necessary, or at the least, why the pull-down is necessary. I'm not exactly sure why the transistor needs to be there and why the RESET line isn't just tied to CE2 directly, but maybe it has something to do with glitch prevention or the available current supply isn't very high from the RESET pin. I don't know, I could test it further, but I don't care too much.

So back to my circuit. The CE2 pin on my boards is tied to VCC when using 64K SRAM. My idea was to rely on only the /CE pin to turn the SRAM on and off, because I wanted to just buy a bunch of 256K SRAM packages and tie the unused address pins to VCC to emulate a 64K SRAM package. And the 256K SRAM packages, well they don't have a CE2 pin. So in order to enter a low standby current mode on my boards for whatever SRAM you use, you need to instead make sure the /CE pin is pulled high when the power is off. So the pull-up resistor on the /CE pin to SRAM VCC should take care of that, right?

Image

But, for whatever reason, I'm measuring a 0.5V drop across the pull-up resistor, so the /CE pin does not meet the criteria to put the chip into the low standby current mode. I'm kind of at a loss as to why it's not pulling up all the way to VCC. Maybe if I used a smaller resistance? (I'm using a 5kΩ on the board in front of me, but I called out 1kΩ on the circuit). But I don't know where the current is going, it's only connected to the LS139 totem-pole output, and that chip isn't even powered on. Perhaps there's some leakage current through the totem-pole circuit? I'm not sure, that seems unlikely to me though.

Anyway, the boards work ok, it just has bad leakage current that drains the battery faster. The solution at the moment seems to be switch to the transistor circuit for the 64K SRAM, be sure to use lower standby current parts, and try to find a 256K SRAM that has lower standby current even without the /CE pin being pulled high so the simple pull-up works ok. Or... I could figure out why there's that voltage drop on the pull-up resistor... given that there aren't too many 256K SRAM games out there, this might be put on the back burner for now. I spent all week on this problem, it's kind of burning me out.
Last edited by poorstudenthobbyist on Thu Sep 19, 2019 7:29 pm, edited 1 time in total.

lidnariq
Posts: 9034
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: SNES NPN transistor battery circuit necessary?

Post by lidnariq » Thu Sep 19, 2019 7:28 pm

poorstudenthobbyist wrote:But, for whatever reason, I'm measuring a 0.5V drop across the pull-up resistor, [...] I'm using a 5kΩ on the board in front of me
Ohm's law says that something is pulling 100µA through that resistor. No idea what, unless it is the 74'139 somehow, despite its lack of ....

wait a moment, do you know whether 74LS also leaves its outputs completely Hi-Z when unpowered?

poorstudenthobbyist
Posts: 54
Joined: Fri Jun 24, 2016 4:20 pm

Re: SNES NPN transistor battery circuit necessary?

Post by poorstudenthobbyist » Thu Sep 19, 2019 7:37 pm

lidnariq wrote:
poorstudenthobbyist wrote:But, for whatever reason, I'm measuring a 0.5V drop across the pull-up resistor, [...] I'm using a 5kΩ on the board in front of me
Ohm's law says that something is pulling 100µA through that resistor. No idea what, unless it is the 74'139 somehow, despite its lack of ....

wait a moment, do you know whether 74LS also leaves its outputs completely Hi-Z when unpowered?
I tried some aggressive googling but I can't find much information. The datasheet doesn't mention it - unfortunately, in my experience, datasheets never mention things like that or what to do with unused inputs :\

If it's a true totem-pole, there might be some leakage through the bottom transistor to GND? Maaaybe? The VCC of the decoder is floating. Otherwise... it seems like it should be Hi-Z.

I do know a guy who works at Texas Instruments, I could probably ask him tomorrow haha

poorstudenthobbyist
Posts: 54
Joined: Fri Jun 24, 2016 4:20 pm

Re: SNES NPN transistor battery circuit necessary?

Post by poorstudenthobbyist » Fri Sep 20, 2019 1:11 pm

Got in contact with TI, and they confirmed there would be a leakage, but it's unknown how much since it's not on the datasheet. I asked if 50 to 100uA sounded reasonable and he said yes, and that he could have someone run a test on an old evaluation board (but I told him not to worry about it).

I wonder if there are any 139's that have a high-Z output when powered off. Time to google more. Or figure out a separate transistor circuit to pull the pin high without worrying about the leakage. That might be easy.

User avatar
Memblers
Site Admin
Posts: 3786
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: SNES NPN transistor battery circuit necessary?

Post by Memblers » Fri Sep 20, 2019 2:28 pm

Like INL mentioned, parts supporting partial-power-down is another way to go. But it's a more feature common in buffers, 74LVC1G34 is one that comes to mind. LV-A and LV-AT are a couple other logic families that might be suitable (pretty sure there's no '139 though).

I saw a Sega Genesis cart with battery backup, and it uses the coin-cell to power some of the 74HC logic. I guess that's another way.

poorstudenthobbyist
Posts: 54
Joined: Fri Jun 24, 2016 4:20 pm

Re: SNES NPN transistor battery circuit necessary?

Post by poorstudenthobbyist » Sat Sep 21, 2019 9:08 pm

I tried using krzysiobal's circuit from this post, and got some interesting results.

Looks like this circuit could be used for preventing leakage from the decoder, but I won't know for sure until I get some low-leakage 256K SRAM chips in. Seems to work for 64K SRAM at least. I read a 0.2V drop across the D1 diode, but nothing across the resistor. Which I think indicates the leakage current is very low.

poorstudenthobbyist
Posts: 54
Joined: Fri Jun 24, 2016 4:20 pm

Re: SNES NPN transistor battery circuit necessary?

Post by poorstudenthobbyist » Thu Feb 13, 2020 5:25 pm

Just a quick update for completeness sake - the circuit from the other thread seems to work fine, I read a very low voltage drop across the diode, indicating low leakage currents based on the V-I curve from the datasheet. I have a board set up with it and recorded the battery voltage as a precaution, and will periodically check it, but I'm pretty confident it'll work just fine.

I would've posted sooner but I forgot about it ;)
256ksramcircuit.PNG
256ksramcircuit.PNG (3.14 KiB) Viewed 459 times

Post Reply