Programming a flash rom via the cart edge connector

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Programming a flash rom via the cart edge connector
by on (#131150)
Hey group,

I'm wanting to program a tsop flash rom through the cart edge connector. The MAD1 /OE is high and causing programming problems as is. If I lift pin 4 of the mad1, it programs fine. Is there a way to have my programmer assert the mad1 so the OE line is asserted correctly for writing or reading?
The flash rom I'm using is the typical 29F032B on the pcb 36 pin adapter.

Thanks!


Edit: I suppose disabling the SRAM would be prudent for this also.
Re: Programming a flash rom via the cart edge connector
by on (#131157)
Hi,

if i understand you right, you try this?!

https://dl.dropboxusercontent.com/u/197 ... C10248.JPG

Cardrige connectore and soldered tsop adapter on pcb?!


Thanks

red
Re: Programming a flash rom via the cart edge connector
by on (#131167)
Right, i plan to make something similar. But what do you need to do to get the mad1 to not interfere with programming? Mad1 controls the OE line to the flash rom.
Re: Programming a flash rom via the cart edge connector
by on (#131180)
Hi,

you can solve this problem via bypass:

https://dl.dropboxusercontent.com/u/197 ... apter1.jpg

Its the same for hirom and lorom. You have to change the soldering for hirom and lorom on card adapter.

https://dl.dropboxusercontent.com/u/197 ... apter2.jpg


thanks

red
Re: Programming a flash rom via the cart edge connector
by on (#131182)
Thank you. But I am not wanting to modify the cart. I have a lot of blank Tsop adapters and I'd like to be able to go ahead and solder them in the cart. Put the case on and when I need it, just pop it in and program it through my EPROM programmer. Think of it as a 1 game flash cart. Don't have to open up the case or do any jumpering. I want to be able to insert cart on the connector and be able to read or program the flash rom through the edge connector. I think there is a way to do it. I have my /WE connected to edge 48 (mask rom pin 35). This pin is not used on lo rom games and not used on hi rom games except extended hi rom games (which wouldn't apply in this case.)
So I have connectivity through the edge connector on all pins except /OE (which the Mad1 controls).

So thank you again.
Re: Programming a flash rom via the cart edge connector
by on (#131183)
MAD1 doesn't connect to /RD and /WR at all, so there is no way how could output signals like /OE or /WE.
Unless you have swapped /OE and /CS (which wouldn't matter for ROM/reads, but it would be fatal for FLASH/writes).
Re: Programming a flash rom via the cart edge connector
by on (#131184)
Pin4 of MAD1 goes to mask rom pin 33 (/OE), right?

/OE has to go high and low depending on what the game program needs to do.

So why can't I make the mad1 do the same thing from the cart edge?

Again, if I pull the mad1 pin4 leg from the circuit, it'll program (/OE is floating).

So what must I do?

I assume the process for hi rom and lo rom carts will be slightly different.

Edit: just to clarify, the OE line has to go high to program. Low to read.
Re: Programming a flash rom via the cart edge connector
by on (#131199)
Nevermind. Figured it out.


Edit: Cancel that! :/. I had it working perfectly -- programming and reading but it was a fluke/glitch. Can't get it to work now.

So do I need to toggle A19 and A20?
It's just a decoder so what do I need to do to get it to decode! Even for just a read the rom! The OE line is definitely the issue. Earlier, when I *Thought* I had it working, I thought the SRAM was the problem and when I held reset low (should disable the SRAM), that's when it worked briefly.
The snes can read the rom so why can't I?
Re: Programming a flash rom via the cart edge connector
by on (#131210)
If you look at this link, it displays all the possible "configurations" of the mad chip:
- http://www.dbwbp.com/index.php/13-elect ... ruth-table
- http://problemkaputt.de/fullsnes.htm#sn ... tsmadchips
Maybe it can help you find the right combination.

However ...

According to the 29F032 datasheet you need it like this for programming:
CE LOW
OE HIGH
WE LOW
RST HIGH

And like this for reading:
CE LOW
OE LOW
WE HIGH
RST HIGH

And on your standard hirom board like 1J3M-20, WE is connected to 5V all the time. So you can't pull it low and therefore can't write to the flashrom.
So you need to disconnect WE on the TSOP to SNES adapter board and attach it directly to the programmer to flash it.
Re: Programming a flash rom via the cart edge connector
by on (#131219)
rom_enable = A15 | A22;
Re: Programming a flash rom via the cart edge connector
by on (#131220)
Wouldn't that enable the ROM even while the CPU is accessing internal RAM at $7E0000-$7FFFFF, causing a bus conflict? I thought that was why the cart edge included a /ROMSEL signal.
Re: Programming a flash rom via the cart edge connector
by on (#131261)
Make your own TSOP adapter and switch /CE and /OE. For some reason, Nintendo chose to feed what should have been the ROM /CE signal into the /OE pin, and vice versa (or sometimes just grounded /CE and then connected the ROM /CE to the chip's /OE pin). It works fine for MaskROMs because they truly are read-only, but it makes it really annoying to do what you want to do. I ran into the same headache trying to do the same thing with a Cx4 cart.
Re: Programming a flash rom via the cart edge connector
by on (#131267)
Grounding /CE lets the cart get away with using slightly slower mask ROMs at the cost of more power consumption.
Re: Programming a flash rom via the cart edge connector
by on (#131326)
Thanks for all the replies! I am still trying to wrap my head around how the mad1 works and why.

I'll try some of the suggestions soon. Swapping the OE and CE is a pretty good idea! Wish I had thought of this a few years ago. I had a large batch of tsop adapters made back then when I truly didn't know what I was doing. Back then, I *thought* pin 35 of the mask rom wasn't used so I used it as my pathway for my programmer to access the /WE pin (/WE is also pulled high via a pull up resistor). But, it seems it's also a good thing in that it still provides a pathway through the cart edge connector for what I want to do. Anyways.... I'll have to work with what I got. Worst case scenario, I'll just have to disconnect the OE (pin 33) from my adapter to reprogram. But it's nice to know that I won't have to unsolder the whole rom/adapter to reprogram in-circuit.

I really was hoping to mount the adapters (as they are) and close up the shell, program/reprogram as needed. I'll keep trying to see if there is a way using the Mad1 inputs. Mad1 pin 4 has to be able to go high...
Re: Programming a flash rom via the cart edge connector
by on (#131381)
I'm not 100% sure on what I said about swapping /OE and /CE, I just remember that being an issue on the Cx4. If you wanted to confirm that was the issue, the fastest way to do it would be to hook up a logic analyzer to the /OE and /CE signals on the ROM and try reading and writing to the cart edge in the ROM address space. During a read, /CE (the real /CE signal, regardless of which pin it's connected to) should go low and stay low while /OE (again, the real /OE) should toggle for each read. Then, when you try to write, /CE should go low and /OE should go high. If I'm right, you'll see the signals swapped, and it's that second part, where /OE going high is actually driving /CE high instead, that makes writing impossible. Also, you'll probably have to connect the ROM /WE pin to pin 54 on the cart edge, since there is no /WE signal going to the ROM normally.