Hard to Phrase Question

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Hard to Phrase Question
by on (#116575)
I just wired a TSOP flash memory to a breadboard today and learned how to erase it, program it. I threw Super Mario World on there, and then soldered it into my Mario Paint cartridge, it ran fine on Super Nintendo.

Now, I tried to erase the chip from within the SNES cartridge, I connected flash's /WE to SNES /WR. It won't work.

When I try to do the chip write sequences, to read manufacturer code for instance, I am read back the actual ROM contents. However, I can read/write SRAM just fine.

I even tried connecting the /WE to the IRQ line on my cart, that cart line is connected to nothing. Still doesn't work. So my hunch is that it has to do with the address decoder or with the timing? But all my other read/write routines are working. Makes no sense to me.

/WR is only connected to flash and sram /WE. nothing else. I can dump the cart just fine, most times it dumps perfectly, sometimes there are some hiccups in the results but I think it's the typical "blow cart and then it works" routine.

I hooked my multimeter up to /WE on my flash memory of course, and put the other end at the Cart pinout for /WR (54) and it's connected. So I am really mystified. Once again this worked perfectly when the flash was directly connected to the MCU. The only other thing I did was clean off the flux with a toothbrush after I put it into the SNES cart. However, since the cart dumps fine, I can assume D0-7 and the address lines are fine, including OE and CS. and since /WE passes continuity test. Really guys. Am I at a loss.
Re: Hard to Phrase Question
by on (#116576)
Quote:
When I try to do the chip write sequences, to read manufacturer code for instance, I am read back the actual ROM contents. However, I can read/write SRAM just fine.


Are you relocating your program that writes to the flash chip to work RAM? If you are sending any type of command to the flash chip you can't also be executing code from it.

So you'd have to copy your code to work RAM, jump to there, and then talk to the flash chip. You'd also want to turn off all DMA/HDMA/interrupts during this time to prevent any unintended ROM accesses (vector fetch on each V-Blank, etc).

For a simple test you can send the command to read the manufacturer / device ID, and if that works, try the more complex erase/write commands.
Re: Hard to Phrase Question
by on (#116577)
What about /OE and /CE?

You need to take /OE high, and /CE low for writes to flash. /WE pin is only one piece of the puzzle.

I'd suggest connecting /OE to /RD and /CE to /ROMSEL. Then manipulate /WE /CE and /OE all properly.

Make sure you've got all the address lines valid as well of course as needed for unlock and other necessary commands.