Friday, 18 July 2014

6502 ROM / RAM Replacement

When fixing old computers, a frequent problem is 'black screen', where the computer appears to be powered on, but nothing appears on the screen. Many things can cause this, failure of the CPU, ROM, RAM or the glue logic in between, or the video out or other peripheral items. It's often a process of elimination, starting by removing unnecessary items, and swapping out the socketed chips one by one.
Various things can help with this, diagnostic cartridges like these run their own code either without needing RAM (or sometimes have their own RAM), and can identify various type of problems. But these are not always an option, in computers which don't have cartridge slots for a start. In trying to diagnose some issues with a Commodore Pet, I looked around at various solutions to this, such as bitfixer's Pet Vet, and Nicolas Welte's Universal 6502 RAM/ROM Expansion. Both essentially do the same thing, they plug into the 6502 CPU socket, and selectively isolate the CPU from the rest of the system. They can be configured so that any ROM access uses the copies of the system ROMs (or even different ROMs) on the expansion board, rather than the ones on the main board which may be faulty. It does the same from RAM access, it can use RAM on the expansion board to replace and/or expand the main board RAM.
The universal RAM / ROM expansion has some RAM and ROM and uses a gate array as glue logic, and dip switches to select options. The Pet Vet is a slightly more complicated solution, in that it has RAM over the entire address range, and a microcontroller. At power on, the microcontroller writes the contents of ROM images into the RAM and loads a truth table into a smaller RAM to work as address decoding glue logic. It also has a serial interface to control things.
I like the idea of the simpler unit, and tried a few times to contact the author of the universal ROM RAM board to buy a board or a kit, but didn't get any response. I'm not sure if the page is still active, since the news page was last updated in 2007. There are however, Eagle PCB files and JEDEC files for the GALs, so I thought I'd build my own. The page describes a later mod to add a jumper for 15xx disk drive memory maps, but the PCB files are an older version. I converted the Eagle files to Diptrace, added this jumper and made a few changes to the routing (force of habit, I like neat traces).
The layout is quite tight, with the CPU pass through inline with the CPU socket, and two TTL chips live under the larger sockets. Testing was as described on the site, the usual visual inspection, and then deep intake of breath turning it on for the first time.
The first test was with no ROM or RAM, and a jumper wire to replace the GAL and set the 245 to just pass through to the main board. Obviously, testing at this stage is best with an already working computer, in this case a VIC 20 CR.
So far so good, so time to install the GAL, a small programmable logic device with 16 inputs, 8 of which can be outputs (GAL16V8). This replaces a pile of TTL chips, and also allows the logic to be changed for different memory maps.With all the DIP switches off, this should also pass through.
Add ROM, and the system ROMs can be replaced, add RAM and the system can be selectively expanded.
Here is the VIC20 with the system ROM replaced and a full 32K of RAM (of which 28159 bytes are available).
It stands off the board via an extra DIP socket added to the bottom, but that isn't enough for the original version of the VIC 20 with the big heatsink and plethora of 2114 SRAMs. It needs another socket in the stack.
Here I've found yet another use for plastic business cards (I grabbed a pile when some people were leaving a company I was working for). They are useful for paint scraping, label removing, opening plastic tab cases, and now insulating 6502 ROM / RAM replacement boards in VIC 20s. This VIC 20 was showing a black screen. Rather than swapping out all the chips one by one, I was able to confirm it was the ROM chip by just removing the CPU and installing this board. A spare ROM chip later and it was up and running again.
Option ROMs can also be included in the image, and separately enabled. The board has space for a 1Mbit EPROM, so that would be 4 system ROM images and 4 option ROMs. In this case, I've just used a 27C256 with a fixed image of the standard PAL ROM images, and a VIC20 diagnostic tool in the option ROM slot. The original page talks about software to load ROM images into EEPROM using the VIC20, but I haven't looked into that as the downloads appear to be missing.
One thing to note, some of the RAM inside the VIC20 is used by the VIC chip to build the display, so the RAM on this board does not replace that. I've tried on a board where I've had to replace all the SRAM, so it is socketed. It appears to work with at minimum the left hand 6116 for screen RAM and the right hand 2114 as Colour RAM. It does mean you could remove the other RAM (particularly if it's faulty), and the original ROMs and reduce the power consumption.
Now that's built and tested, I'll need to modify the GAL code to fit the PET 8032 memory map and I can get on with testing that. I'll also have a go at a BBC micro version, should be good for that. I may do another spin of the board with a power LED and a reset button, but I still have a number of these boards available, so if you want a board or a complete unit and can't get in touch with the original author, contact me.

UPDATE # 1
This has now been used successfully to assist with my Commodore Pet 4032 restoration.

UPDATE # 2:
The new V2.0 6502 ROM/RAM boards are available now.

UPDATE #3
The new V3.1 ROM/RAM boards are available now

UPDATE #4
New smaller PET ROM/RAM boards are available now, specifically to repair/upgrade Commodore PET machines.

UPDATE #5

These current updated version of the boards are available to buy from my Tindie Store