corrupted CHR ram (SOLVED)

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
corrupted CHR ram (SOLVED)
by on (#192349)
heya, i need some help. i've replaced PRG ROM on a 168-in-1 Contra Function cart with a DIP-32 socket, but it didn't end well. when i insert the original ROM in that socket the picture is corrupted. palettes and nametables work fine and the game is kinda functional, but all tiles are borked. after disconnecting the 4,5k resistor that is on cart it works fine ~9 out of 10 hard resets. but when i insert my custom W27E040 EEPROM it doesn't start at all (blank screen) 9/10 times and is corrupted 1/10 times. with that resistor disconnected it is corrupted more often than blank, but never works fine. i'm using a slightly modded Pegasus MT777DX (famiclone).

cart layout and "screen shot"

at first i thought i might have shorted some tracks or disconnected some pins from pads while desoldering the ROM, especially that the soldering work on that SRAM was extremely janky. but i have arduously verified that all connections on the pcb are fine. i don't know what else can i do to make it work :(

cart components:
Code:
GD74LS00   9137            OCTAL BUS TRANSCEIVER NON-INVERTED 3-STATE OUTPUTS
GD74LS174   9216            OCTAL BUS TRANSCEIVER NON-INVERTED 3-STATE OUTPUTS
T74LS273B1   99144            Octal bus transceiver
PAL16L8ACN   152JTBE            Fuse-Programmable PLD
LH5160N-10L   9103 1 DC         64K-Bit SRAM
SS 8001   HN62328BP Y55 2E1      x8 ROM Mask Programmable



edit: for posterity - the problem was that the cart mapper 15 disables CHR ROM writes in banking mode 0 and emulators didnt emulate this behavior. so this was mostly a software issue
Re: corrupted CHR ram
by on (#192350)
Did you check the connections from the ROM pin (not the socket) to both the mapper and cart edge?
Is pin 1 (VPP) connected to 5V? Can't exactly tell in the picture.
Looks like there are no bypass capacitors? I'd try adding some, like a 4.7uF or 10uF, and maybe a couple 0.1uF on the chips.
Re: corrupted CHR ram
by on (#192353)
Did you try the game on original consoles?

I'd also try replace the CHR-RAM by a standard 8KB RAM (HY6264 for example).
Re: corrupted CHR ram
by on (#192358)
Memblers wrote:
Did you check the connections from the ROM pin (not the socket) to both the mapper and cart edge?
Is pin 1 (VPP) connected to 5V? Can't exactly tell in the picture.
Looks like there are no bypass capacitors? I'd try adding some, like a 4.7uF or 10uF, and maybe a couple 0.1uF on the chips.

i've tested all connections ROM-socket and socket-edge as well as pin-edge connections of all other ICs and they are all fine. sorry for potato quality pics (they are scans actually xD) i dont have a good camera atm.

can you elaborate on capacitors? there is only one ceramic cap next to the only resistor on cart (right side on front picture). it's connected to VCC (cart connector pin 30) on one side. on the other side it's connected to pin 1 (bottom left corner) of GD74LS174 and the 4,5k resistor, that is in turn connected to ground. i never heard of bypass capacitors before being a simple programmer that has no idea what he's doing when it comes to electronics. where should i put them?

Ice Man wrote:
Did you try the game on original consoles?

I'd also try replace the CHR-RAM by a standard 8KB RAM (HY6264 for example).
i don't have original consoles, so can't test. i only tested it on emulators, and had no problems with it. i bet the problem is with pcb, most likely something to do with character memory
Re: corrupted CHR ram
by on (#192359)
Well, you've already got a socket. Why not try running some other software? Nocash's Magic Floor would be an obvious trivial test.

Have you tried dumping the original ROM? Does it match the image in goodNES? It apparently should be 1 MiB, the largest you can fit in a 32-pin socket, so make sure the pinout on the board matches that of the 'PROM you're trying to use. If the 'PROM you're trying to use won't work without Vpp high, you might need to do some rework for that, or else scrounge up a 27C080.

Have you tried continuity testing with the original ROM in the socket?
Re: corrupted CHR ram
by on (#192362)
lidnariq wrote:
Well, you've already got a socket. Why not try running some other software? Nocash's Magic Floor would be an obvious trivial test.

Have you tried dumping the original ROM? Does it match the image in goodNES? It apparently should be 1 MiB, the largest you can fit in a 32-pin socket, so make sure the pinout on the board matches that of the 'PROM you're trying to use. If the 'PROM you're trying to use won't work without Vpp high, you might need to do some rework for that, or else scrounge up a 27C080.

Have you tried continuity testing with the original ROM in the socket?

i'm gonna try that Magic Floor thing, thanks.

Yes, the dumped original ROM is 1 MiB and matches the one in database. The pinout of HN62328BP matches that of W27E040 (except A19). I also tried using M27C801 with the same result.

the cart was fully operational before i installed a socket. when i put the original ROM into the socket it either doesn't work at all or has corrupted picture. i blindly disconnected a resistor on cart and it started to work, but only with the original ROM - my ROM still has corrupted picture.
Re: corrupted CHR ram
by on (#192815)
today i programmed a W27E040 eeprom with Nocash's Magic Floor, put it in the socket on that cartridge and tried running it. it didn't start at first, but after many, many hard resets it started, though it had glitchy tiles too, just like my rom. :(

i also tried replacing the capacitor on cart with a bigger one and putting more capacitors in mostly random places. it didnt fix corrupted chars, but at least the cart is starting up more reliably - no need to reset it a thousand times to run.

i dont know what to try now, can you guys give me some pointers? i also wanted to draw the schematic of that cart, but i don't know any good software for this, can you recommend some?
Re: corrupted CHR ram
by on (#192828)
Here is the schematics. Please check all connections.
Image
Because the PAL chip might block PPU from writing to CHR-RAM, please check especially all connections to the PAL chip, and do it on top - check continuity touching to chip legs at top of PCB, not bottom.

R+C+Diode is !RESET detector from M2. Check if C is at least 1nF and if diode is not broken.
Re: corrupted CHR ram
by on (#192848)
krzysiobal wrote:
Here is the schematics. Please check all connections.
Image
Because the PAL chip might block PPU from writing to CHR-RAM, please check especially all connections to the PAL chip, and do it on top - check continuity touching to chip legs at top of PCB, not bottom.

R+C+Diode is !RESET detector from M2. Check if C is at least 1nF and if diode is not broken.


just checked and all connections from array logic chip look good. now i'm checking other chips once again.

there was no diode on my pcb, just empty space with diode symbol. i'll add it and check if it helps. dzięki za pomoc :)
Re: corrupted CHR ram
by on (#192864)
i did continuity testing of ALL connections on the pcb again and they are all ok.

i also added a diode and now resetting works like a charm, both on my rom and original rom. but my rom still has corrupted chars. without the diode the original rom has corrupted chars too
Re: corrupted CHR ram
by on (#192884)
This cart has solder-jumper on back side which allows !CPU_ROMSEL to be connected to ROM_!OE and GND to ROM_!CE (default settings) or vice-versa. Try connecting them in reverse order.
Image

Also, try connecting around 68pF capactitor betweetn CHR-RAM's !WE and gnd.
Re: corrupted CHR ram
by on (#192948)
krzysiobal wrote:
This cart has solder-jumper on back side which allows !CPU_ROMSEL to be connected to ROM_!OE and GND to ROM_!CE (default settings) or vice-versa. Try connecting them in reverse order.
Image

Also, try connecting around 68pF capactitor betweetn CHR-RAM's !WE and gnd.

that jumper wasn't just solder - those were uninsulated tracks so i had to cut them. but seems that connecting them in reverse (!ROMSEL to !CE, GND to !OE) didn't change anything. i tried connecting !CHR_WE and GND using a 100nF ceramic cap, didn't help either

i had an idea that maybe PAL chip is broken and it's outputting wrong signal for !CHR_WE, but that can't be the case because it works fine with original rom
Re: corrupted CHR ram
by on (#192960)
I dont quite understand you - what is original ROM that is working fine? 8 Mbit MASK ROM?
What ROM is causing graphic glitches? 27C801 EPROM?
Re: corrupted CHR ram
by on (#193006)
krzysiobal wrote:
I dont quite understand you - what is original ROM that is working fine? 8 Mbit MASK ROM?
What ROM is causing graphic glitches? 27C801 EPROM?

yes, the original 8 Mbit MASK ROM is working. both 27C801 and 27E040 are causing glitches.
Re: corrupted CHR ram
by on (#242916)
MEGANECRO

i started working on this project again. i managed to determine that the direct cause of the corrupted tiles is the CHR-RAM write-protection circuit. i wasn't aware of it when developing my custom rom, so no wonder it doesn't work. but i still have no idea why it suddenly became a problem when i place the original mask rom chip in the DIP-32 socket. and why tinkering with seemingly unrelated !reset detection circuit helped with that issue. i'm trying to think what kinds of tests can i put on my rom to try and debug this issue
Re: corrupted CHR ram
by on (#242918)
Quote:
why tinkering with seemingly unrelated !reset detection circuit helped with that issue

Withoud diode, latches are constantly held in reset. Mode is always 0 (so CHR-RAM writing is forbidden) and PRG bank is always stick to first 32kB (so no CHR data can be read from PRG and nothing but the menu will work)

If now the original MASK-ROMworks but your EPROM doesn't, the only reason is that your EPROM content is not valid.
Re: corrupted CHR ram
by on (#242938)
krzysiobal wrote:
Withoud diode, latches are constantly held in reset. Mode is always 0 (so CHR-RAM writing is forbidden) and PRG bank is always stick to first 32kB (so no CHR data can be read from PRG and nothing but the menu will work)

If now the original MASK-ROMworks but your EPROM doesn't, the only reason is that your EPROM content is not valid.

i don't think that is the case - the diode was missing from start, but the cart worked properly without it. well, until i installed the socket.

Code:
   ROM    |   SOCKET  |   D1   |  R1   |    RESULT
--------------------------------------------------------------
 MASK ROM | NO SOCKET |  NO D1 |  R1   |  WORKING EVERY TIME   
 MASK ROM |   SOCKET  |  NO D1 |  R1   |  TILES CORRUPTED 
 MASK ROM |   SOCKET  |   D1   |  R1   |  TILES CORRUPTED 
 MASK ROM |   SOCKET  |  NO D1 | NO R1 |  WORKING ~90% OF TIMES
  EPROM   |   SOCKET  |  NO D1 |  R1   |  NOT BOOTING ~90% OF TIMES, CORRUPTED 10%
  EPROM   |   SOCKET  |  NO D1 | NO R1 |  NOT BOOTING ~50% OF TIMES, CORRUPTED 50%


i'm gonna fix my EPROM and see what happens, stay tuned :)
Re: corrupted CHR ram
by on (#243114)
ok, i fixed my code to work in bank mode 1. first tests were unsuccessful, it wouldn't switch to mode 1 properly. i tested it with D1, R1 and C1 present and it seemed like the latches were in fact constantly held in reset. after removing R1 and replacing C1 with some huge cap it finally worked. for the first time i could see my code work flawlessly, it could switch banking mode, it could write CHR RAM. this is a huge success and i'm very happy that i managed to overcome this blocking obstacle. the only problem i have right now is that resetting doesn't work. i randomly tried replacing 4,7k R1 with 2k, but it wouldn't even boot. but i have a feeling i could manage to make resetting work with some trial and error