A machine displaying less than 38911 free bytes or “?Out of memory error in 0” is often an indication of malfunctioning RAM. If several RAM-chips are broken, or shorted, you will be greeted with a blank(black) screen.

Free basic memory is verified when the computer boots up. It starts checking the memory from location 2049($0801) and goes upwards. If you get “3 bytes free”, it indicates a problem at address position 2049+3=2052($0804).

Even if RAM-chips are failing, it does not mean that every byte has a failing bit, this is why you need to test a larger area of memory. In the example above, 3 bytes passed the test.

Many fastload cartridges(The Final Cartridge or Action Replay etc.) skip the RAM-test to speed up the boot sequence. These will always display “38911 Basic Bytes free” regardless of RAM status.

Broken RAM is usually a sign of a bad powersupply. The components inside the PSU deteriorates and therefor delivers higher voltage than it should. RAM circuits are sensitive to overvoltage and are often the first to go.

Failed RAM can get very hot(burn-your-fingers-hot) and is easy to find, but that is not always the case. Some machines can even have broken memory that are a mix of “hot and cold” chips.

Depending on the C64 motherboard revision, you either have 2 or 8 RAM-chips. For the C128 it is 4 or  16 chips.
C64: 2 x 41464 (64kbit x 4) / 8 x 4164 (64kbit x 1)
C128: 4  x 41464 (64kbit x 4) / 16 x 4164 (64kbit x 1)

Replacing two chips is not that much of a work, but with 8 or 16 chips you want to know which one(s) are broken.

C64s with 8 memory chips also have two multiplexers; MOS7708(identical to 74257) located at U13 and U25. It is more seldom these fail but they should not be neglected.

 

There are a couple of ways finding failing RAM:


 

1. Piggybacking.
You insert a known working chip on top of a chip on the PCB. All legs must have good contact, bend the legs slightly inwards on the piggyback chip and work your way through all RAM. You can piggyback several IC;s, just make sure your equipment is powered off and that your PSU is working properly(so it won’t burn even more RAM). If the amount of free RAM changes when turning on the computer, replace that RAM-chip.

 


 

2. Calculating BITS

Each BIT on every BYTE is handled by a RAM-chip. Depending on which BIT is malfunctioning, you can determine which RAM-chip is broken.

Test every memoryposition with the byte combinations in TABLE 1. After that use TABLE 2 to determine which chip has failed. Remember that bit 0 is the rightmost and bit 7 is the leftmost bit.

The behavior of the “wrong bits” are because the broken RAM-chip either keep a data line high or low when it shouldn’t.

A couple of ways to figure out which bit is failing:

Visually check bytes on the screen
Inspect the start-up screen(or whats left of it). It is normally mostly filled with “space”-character (hex 0x20). If there are other chars than space, for example “!”-character (hex 0x21) you can determine that there is a failing RAM that handles bit 0, another example is a “%”-character (hex 0x25) indicating that bits 0 and 2 are failing in that specific memory location.

Action Replay monitor (or any other cart)
Use a machine code monitor to fill the memory and find the differing bytes.

Use basic routines POKE and PEEK
In the first example, with problems at address 2052($0804), use the following command: “POKE 2052,x : PRINT PEEK (2052)” where x is from TABLE 1. The result in and out should be the same, if not, take the differing bits and check with TABLE 2.

TABLE 1 – test bytes

binary hex dec binary hex dec
00000000 $00 000 11111111 $FF 255
00000001 $01 001 11111110 $FE 254
00000010 $02 002 11111101 $FD 253
00000100 $04 004 11111011 $FB 251
00001000 $08 008 11110111 $F7 247
00010000 $10 016 11101111 $EF 239
00100000 $20 032 11011111 $DF 223
01000000 $40 064 10111111 $BF 191
10000000 $80 128 01111111 $7F 127
10101010 $AA 170 01010101 $55 085

TABLE 2 – bits vs chips

BIT C64A,B C64B3 C64E C128,C128D C128DCR
0 U21 U10 U10 U38/U46 U38/U40
1 U9 U10 U10 U39/U47 U38/U40
2 U22 U10 U10 U40/U48 U38/U40
3 U10 U10 U10 U41/D49 U38/U40
4 U23 U9 U11 U42/U50 U39/U41
5 U11 U9 U11 U43/U51 U39/U41
6 U24 U9 U11 U44/U52 U39/U41
7 U12 U9 U11 U45/U53 U39/U41

 


 

3. Use a diagnostic program or cart
There are several diagnostic programs that test the memory for you. The Commodore diagnostic cartridges “C64 Dead Test Rev.781220” and “Diagnostic Rev.586220” are both good for this.

The “C64 Dead Test Rev.781220” cartridge is able to find broken RAM even with a blank(black) screen. It flashes the screen according to which bit fails. This one will save you a lot of time and work 🙂

Both cartridges are available at the Diagnostic Carts and Manuals page.
If you are interested to see how the memory is verified, there is also a disassembly of the Diagnostic Rev.586220 cartridge.