Understanding a 139 decoder to wire up 2 roms.

A place that you can discuss reproduction of classic titles or "licensed-for-reproduction" homebrew for personal use.

Moderators: B00daW, Moderators

Forum rules
1. NO BLATANT PIRACY. This includes reproducing homebrew less than 10 years old, with the exception of free software.
2. No advertising your reproductions, with the exception of free software.
3. Be nice. See RFC 1855 if you aren't sure what this means.
Post Reply
darknezz19
Posts: 71
Joined: Wed Aug 26, 2009 8:28 am

Understanding a 139 decoder to wire up 2 roms.

Post by darknezz19 » Fri May 08, 2015 10:11 pm

So I'm playing around with this 139 decoder and a couple 27c322's to try and make an 8MB Genesis cart but so far have not got it to work. Some questions have come to mind about how this should be wired up. This is going off a setup for a 6MB Snes game as a reference which has the address input line connected to A19 on each of the two flash chips. Then it uses the OE lines, one output to each chips line, to control which rom to enable. Pin 1 on the 139, which I believe just enables that side of the chips decoder outputs, is tied to mad-1 pin which is OE. Couldn't this pin just be tied to any 5v source though? Also the decoder output are setup so the first output goes to the second rom, and the second output goes to rom 1, why is that? I tried swapping these just to see if it would work the other way but it wouldn't.

Furthermore after looking at a Genesis pcb with 2 rom chips that uses a 139 to decode it's using the CE lines on the outputs instead of the OE lines. I'm just going off of pictures from romlab so it's hard to tell exactly how it's setup though. I have tried using both the OE, and then the CE for outputs to the 27c322s but it's hasn't made a difference. For the address input I've tried A19, A18, A20, both A20 and A19 together, A21, A22, A23, A24 and AS. Gave it my best shot, any advice?

Pictures for reference:
http://imgur.com/a/98uL5#5

Data Sheets:
http://www.nxp.com/documents/data_sheet ... 39_CNV.pdf

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

Re: Understanding a 139 decoder to wire up 2 roms.

Post by tepples » Sat May 09, 2015 7:13 am

If addresses $400000-$FFFFFF are used by memory-mapped I/O ports, you'll have to use a mapper to switch between the two ROMs. Super Street Fighter II, for instance, uses a mapper.

darknezz19
Posts: 71
Joined: Wed Aug 26, 2009 8:28 am

Re: Understanding a 139 decoder to wire up 2 roms.

Post by darknezz19 » Sat May 09, 2015 9:25 am

In the pictures posted, the one of the pcb with the two mask roms removed uses 42 pin chips. This would lead me to think they are two 2MB roms at least. Also another member asked about this once, Ice Man in the other retro dev forum. I sent him a PM and he said he got it working with a 139 but forgot how and couldn't remember the Russian website he got the info from unfortunately.

I also found another cart from my collection that usesa 42 pin 2MB rom, another 40 pin rom that is 1MB, and a pc74hc00p. I have traced it out and it uses the /CE lines on each rom for the outputs and A19 for the input.

pc74hc00p
http://pdf.datasheetcatalog.com/datashe ... _HCT00.pdf

darknezz19
Posts: 71
Joined: Wed Aug 26, 2009 8:28 am

Re: Understanding a 139 decoder to wire up 2 roms.

Post by darknezz19 » Sat May 09, 2015 1:16 pm

I think I understand now Tepples. 139 decoders work on SNES because the hardware can address more than the 4MB address range. This wont work on a Genesis because there is nothing to signal to the 139 that it needs an address over the 4MB threshold, is that correct? If this is correct then what signals to the mapper to use an address over $FFFFFF?

Edit: Well that doesn't seem right actually, after reading a wiki about Snes memory mapping for Hi and Lo roms it only supports up to 32mb according to what this says. So how is it that a 139 decoder works for a snes game that is 48mb like Chrimson Echos for example? How does OE on the MAD-1 and A19 on the rom signal to the 139 to use and address over 4MB?

http://en.wikibooks.org/wiki/Super_NES_ ... memory_map

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

Re: Understanding a 139 decoder to wire up 2 roms.

Post by tepples » Sat May 09, 2015 2:48 pm

Apples and oranges. The Super NES memory map has 95 Mbit devoted to the cartridge: $400000-$7DFFFF, $C00000-$FFFFFF, and every second 32 KiB part of $008000-$3FFFFF and $808000-$BFFFFF. The Sega Genesis memory map, by contrast, has only 32 Mbit for the cartridge: $000000-$3FFFFF. ($400000-$9FFFFF is "Sega reserved" for the Sega CD and 32X accessories.) Accessing more than 32 Mbit requires a mapper.

User avatar
FARID
Posts: 499
Joined: Wed Apr 07, 2010 1:14 am
Location: Iran
Contact:

Re: Understanding a 139 decoder to wire up 2 roms.

Post by FARID » Sun May 10, 2015 12:26 am

I don't know anything about Sega hardware at all.
But I know to control 8MB / 16Bit memory you need a proper A21 signal coming from the CPU (or mapper or whatever else)
If there is no such a signal on Sega then you have to find out how to make that signal from decoding other signals.
Once you have that signal, you can wire it to the two 27C322 in different ways to make a 8MB / 16bit memory.
27C322 has up to A20, but its /OE pin can be used for A21 like this :

Code: Select all

A21 (Sega)  ------+----------------------> /OE (EPROM1)
                  |
                  +----> 74HC04 --------> /OE (EPROM2)
I have never tested the above circuit on the real hardware, so maybe I am making mistake :mrgreen:

User avatar
mikejmoffitt
Posts: 1352
Joined: Sun May 27, 2012 8:43 pm

Re: Understanding a 139 decoder to wire up 2 roms.

Post by mikejmoffitt » Mon May 11, 2015 8:00 am

tepples wrote:Apples and oranges. The Super NES memory map has 95 Mbit devoted to the cartridge: $400000-$7DFFFF, $C00000-$FFFFFF, and every second 32 KiB part of $008000-$3FFFFF and $808000-$BFFFFF. The Sega Genesis memory map, by contrast, has only 32 Mbit for the cartridge: $000000-$3FFFFF. ($400000-$9FFFFF is "Sega reserved" for the Sega CD and 32X accessories.) Accessing more than 32 Mbit requires a mapper.
Is the $400000 and above reserved by Sega's rules in writing only, or actually enforced in hardware? I see A17 is the highest bit; only 2048 16-bit words leads to 4096KiB addressable ROM space immediately.

User avatar
Fisher
Posts: 1144
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Understanding a 139 decoder to wire up 2 roms.

Post by Fisher » Sat Sep 19, 2015 11:33 am

Hope this helps!!
It's the scans of a pirated DeCapAttack game.
4mbit with 4x27c010 and a 74ls139.
Attachments
Component side
Component side
Solder side
Solder side

Post Reply