I wrote up a "brief" explainer on SNES cartridges

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.
lidnariq
Posts: 9421
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: I wrote up a "brief" explainer on SNES cartridges

Post by lidnariq » Fri Feb 14, 2020 12:21 pm

If your board had a conventional 8-bit ROM, you could rely on the ROM's enables to only drive the data bus at the right time.

But because your board mixes in the 74'257s, you have to correctly enable them (not the ROM) at the right time in order for things to work correctly.

The only safe time to drive the data bus is when other things aren't driving it, which could be things inside the SNES (such as RAM or PPU) or on the cart (RAM).

In a HiROM cart, it's ok (although pedantically wrong) to just use /CART (p49) to enable the '257s, because nothing will ever try to write to ROM, so we can assume that if the SNES is accessing the cart it's reading from the cart. (There's some marginal behavior at the beginning and end of each memory access cycle, but it's more-or-less ok.)

In a LoROM cart, you can make a similar assumption, using the output of the 74'139 enabling the ROM based on /CART and other address lines.

Finally, if you're using an analog multiplexer, like the '4066, then you can safely use the ROM's output enables and not worry about enabling the '4066 at the right time, because if the ROM's data bus is high-impedance, then the output of the analog multiplexers will also be.

(Note that the 74'3257 is a bad choice specifically in the case of the SNES, because it doesn't pass full 5VCMOS voltages, because it only has nMOSFETs inside instead of NMOS+PMOS full transmission gates)

tepples
Posts: 21985
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: I wrote up a "brief" explainer on SNES cartridges

Post by tepples » Fri Feb 14, 2020 1:23 pm

nocash wrote:
Fri Feb 14, 2020 10:07 am
No, that's nonsense the SNES does draw (consume) power, it does not supply (generate) power.
Both. It draws power through a 7805 regulator, and it uses some of that power to supply power to the Game Pak and controllers connected to it. ("Supply" doesn't necessarily mean "generate".)

User avatar
poorstudenthobbyist
Posts: 84
Joined: Fri Jun 24, 2016 4:20 pm

Re: I wrote up a "brief" explainer on SNES cartridges

Post by poorstudenthobbyist » Fri Feb 14, 2020 1:31 pm

Ice Man, I should clarify that my write-up was from the perspective of a SNES board that uses the original Mask ROM, not the 27C322. Maybe that's where our disconnect lies. Sorry for the confusion!

Lidnariq, would you mind me asking what your background is in? You've got a lot of insight into these things.

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

Re: I wrote up a "brief" explainer on SNES cartridges

Post by lidnariq » Fri Feb 14, 2020 2:16 pm

Although I have an engineering background, all of this is self-taught. It's been obsolete for too long to be things you'd pick up in most professional contexts.

nocash
Posts: 1211
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: I wrote up a "brief" explainer on SNES cartridges

Post by nocash » Fri Feb 14, 2020 2:54 pm

I am afraid that I had misread this sentence "On every SNES board you’ll notice a handful of capacitors." I had interpreted it as referring to the mainboard, but now I think that it does refer to the cartridge board... and then the description makes much more sense than I had thought : )
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty

User avatar
poorstudenthobbyist
Posts: 84
Joined: Fri Jun 24, 2016 4:20 pm

Re: I wrote up a "brief" explainer on SNES cartridges

Post by poorstudenthobbyist » Fri May 01, 2020 6:59 am

Hey lidnariq --
lidnariq wrote:
Sun Nov 17, 2019 1:37 am

Yes, Nintendo themselves did release some boards with these two pins backwards, but not all of them, and it still has the same problem I've mentioned above.
I was thinking about this lately, say you have a 27C322 with muxes connected to an OEM board, with the /OE of the muxes tied to the /OE of the SNES ROM pinout, that is, the /OE signal that toggles each cycle as shown in this picture: http://forums.nesdev.com/download/file. ... &mode=view

If the board in question had /OE and /CE swapped, as you mentioned some boards do, could that create a bus conflict since the muxes would be active continuously with the /CE signal? How common are those boards?

Edit: I should mention I finally got around to getting boards made with the /OE connected to /RD instead of /CE, and they're not working properly. I also checked a few OEM boards I have lying around and all have /RD connected to /CS as my custom boards do. Those OEM boards I have tried with my 322 adapter boards, and they work fine with the 257 enable line connected to the /OE pin on the ROM socket (pin 33). In the board with RAM (HiROM), this /OE is connected to the MAD-1 (which toggles with the /CART signal) and in the RAM-less board (LoROM) this /OE is connected to /CART as well. So I'm a bit confused now because obviously this connection isn't creating bus conflicts, if the games work. Is it accurate to say /RD is the /OE in that scope capture, and that /CART is /CE? Is this wiring of a 322 and muxes gonna cause problems if the /OE is commanded by /RD and /CE is commanded by /CART?

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

Re: I wrote up a "brief" explainer on SNES cartridges

Post by lidnariq » Fri May 01, 2020 10:53 am

poorstudenthobbyist wrote:
Fri May 01, 2020 6:59 am
If the board in question had /OE and /CE swapped, as you mentioned some boards do, could that create a bus conflict since the muxes would be active continuously with the /CE signal? How common are those boards?
Which is the board in question?

None of Nintendo's boards used multiplexers - they all started with 8 bit ROMs in the first place.

Basically, for the following instruction:
LDA $123456,x
The /RD and /CART lines would look something like

Code: Select all

/CART   ....________^^....  _ = low
/RD     ....~_~_~_~_~_....  ^ = high
CE-CART ....nnnnnnnnFF....  n = on, power consumed, lower latency
OE-RD   ....ZdZdZdZdZZ....  F = off, low power, higher latency
CE-RD   ....FnFnFnFnFn....  Z = high impedance, no bus conflict
OE-CART ....ZdZdZdZdZZ....  d = driven, potential for bus conflict, but can't tell in isolation
Specifically in the case of these old 8-bit ROMs, it's safe, because you don't care about writing to them, and the SNES needs them to only drive the data bus when both signals are low, and that's what they'll do.
Edit: I should mention I finally got around to getting boards made with the /OE connected to /RD instead of /CE, and they're not working properly.
The '257s should, ideally, only be enabled when /RD and /CART are both low. But you can probably get away with it when only /CART is low.

User avatar
poorstudenthobbyist
Posts: 84
Joined: Fri Jun 24, 2016 4:20 pm

Re: I wrote up a "brief" explainer on SNES cartridges

Post by poorstudenthobbyist » Fri May 01, 2020 11:10 am

Sorry I might be talking all over the place and being confusing, I know SNES boards don't have muxes haha. Let me try again.

I was looking at 1J3M and 1A0N to confirm the /CART wiring, but I guess my question is how common are these kinds of boards in comparison to the "proper" wiring you mentioned in that reply. Maybe I'm misunderstanding what you said, it seemed like you were saying the standard SNES board has it wired that way where /RD controls /OE. I just don't have an example of that board. All the ones I see have /CART driving /OE in some form, which as you confirmed is fine, but not ideal. Thanks for the logic diagram btw, that helps.

I made a few new boards that I was testing out, and I made an OEM-style (36-pin socket) and a 322-style, both rewired with /RD and /CART driving /OE and /CE, respectively. The 322 has the /OE of the muxes driven by /RD, and the /CE of the EPROM driven by /CART (/OE of EPROM tied to GND). When I say driven, I mean either directly or indirectly affected by, like if a decoder is used as well. I think that's giving me a bus conflict, because it's not working - I think now that's because /RD can cycle even when /CART is not active, correct? I'm just using a standard mode 20 RAM-less test ROM. The 36-pin board works when I use an 8-bit EEPROM to test it out (so no muxes), but not with my 36-pin-to-322 adapters, hence my concern that the adapters might not work all the time. Are there cases where pin 33 is tied to /RD?

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

Re: I wrote up a "brief" explainer on SNES cartridges

Post by lidnariq » Fri May 01, 2020 2:09 pm

poorstudenthobbyist wrote:
Fri May 01, 2020 11:10 am
Maybe I'm misunderstanding what you said, it seemed like you were saying the standard SNES board has it wired that way where /RD controls /OE. I just don't have an example of that board. All the ones I see have /CART driving /OE in some form, which as you confirmed is fine, but not ideal.
I was under the impression that was kinda mixed, but I don't know.
The 322 has the /OE of the muxes driven by /RD [...] because it's not working - I think now that's because /RD can cycle even when /CART is not active, correct?
Yes, that's the problem. In the case of using '257s, tying their /OE outputs to /RD causes a bus conflict on every read cycle. They need to only be active in both the right region and also the right time.

Pedantically, it's probably ok to tie the '257s /OEs to /CART (for HiROM) or from the 74'139 (for LoROM), because the game will never try to write to ROM - it would have no effect, so there's no reason to try to generate a bus conflict. But a badly programmed game could cause a bus conflict, which would cause some extra heat, so that could eventually be bad.

User avatar
poorstudenthobbyist
Posts: 84
Joined: Fri Jun 24, 2016 4:20 pm

Re: I wrote up a "brief" explainer on SNES cartridges

Post by poorstudenthobbyist » Fri May 01, 2020 3:05 pm

Ok thanks a lot, that all makes sense then. I think I was having one of those overthink-y "I-don't-actually-know-anything" moments after my new cart boards didn't immediately work last night at 2AM haha

I'm gonna check through all my cartridges for non-MAD-1 carts to see if /RD is ever tied to pin 33 instead of /CART. And I'll add this info into the explainer as well.

Post Reply