This article on Commodore 64 memory repair is part of a much larger restoration. I found an old Commodore 64 retrocomputer on Facebook Marketplace for a few euros, but it had several flaws. First of all, all the accessories were missing (even the power supply). The keyboard had two missing keys, the monitor was showing strange characters and, finally, the sound of the computer did not work! A huge mess!
I originally thought about using this computer to pick up spare parts for another Commodore 64 that I wanted to fix, but… repairing such extensive damage would have been quite a challenge!
Commodore 64 memory defect diagnosis
The Commodore 64 memory defect appeared immediately upon power up:
- there was the "OUT OF MEMORY ERROR IN 0" error;
- the monitor showed strange characters in random positions.
Without memory available, because it was defective, it was not even possible to load a diagnostic program for the memory itself, to understand which was the faulty RAM chip. I then consulted the Commodore 64 service manual (attached at the bottom of this page) to retrieve the electrical diagram of the memory.
It can be seen that the RAM of the Commodore 64 is composed of 8 chips. Each chip contains 64K x 1 bit of memory - it does not contain integer bytes, but each chip takes care of a single bit. And so here is the correspondence between the RAM memory chips and the corresponding bits:
- D0 = U21
- D1 = U9
- D2 = U22
- D3 = U10
- D4 = U23
- D5 = U11
- D6 = U24
At this point, I just had to figure out which bit was faulty, which transformed the “space” character on the monitor” in the dollar "$". For this analysis, the Commodore 64 character table, otherwise called CBM ASCII, is useful:
The character “space” corresponds to the number & H20 (in hexadecimal), which is 32 (expressed in decimal numbers). Instead, the dollar character “$” corresponds to the number & H24 (in hexadecimal), which is 36 (in decimal). The number of the character has therefore moved from 32 to 36, with an increase of 4. Expressing the number 4 in powers of 2, we obtain 2 ^ 2. From this reasoning, it is clear that the bad bit of the RAM memory was D2, corresponding to the U22 chip.
Commodore 64 memory repair
Without fail, I replaced the C64's U22 chip with an identical one, an MT4264-15 purchased online. Obviously I bought a few more spare RAM chips, which, as we will see shortly, was useful to me.
To repair the memory of the Commodore 64, and then replace the RAM chip, I first removed the old defective chip, and then soldered a socket, where I housed the new MT4264-15 chip. I installed the new memory chip of the Commodore 64 on the socket, to do compatibility experiments of the various RAM memories, which I will describe shortly.
The replacement of the memory chip had positive effects, in fact the Commodore 64 started with the usual boot screen.
Another broken memory chip
Despite the replacement of the chip, the Commodore 64 did not have the expected amount of free RAM: 38911 bytes. Sometimes only 3K was available, sometimes 12K. In short: there was another faulty memory chip. That's why it made me comfortable buying a few more RAM chips!
On the monitor I did not see strange characters, so the defective bits had to be in another area of memory, outside the video memory. I then wrote a program, in BASIC, very compact, to scan all the bytes of RAM and identify the defective ones. The idea is simple and is based on the principle of operation of RAM memory:
- you scan the bytes of RAM one by one (outside the area of the program itself!)
- you write the number 0
- you read the same box, which must return the number just written: 0
- you write the number 255
- you read the same box, which must return the number just written: 255
And here is my program to test the RAM memory of the Commodore 64 in operation.
Scanning the RAM detected some faulty bytes. The number 0 turned into 1, while the number 255 turned into 254. From the reasoning already described in the previous paragraphs, it is clear that the difference between the correct number and the wrong one is 1, corresponding to 2 ^ 0 expressed in powers of 2. So the second faulty MT4264-15 RAM chip was U21, corresponding to the D0 bit line. I then replaced this second chip as well, mounting the new one on the socket.
Finally the memory of the Commodore 64 was in place!
Commodore 64 memory experiments
While searching online for the Commodore 64's RAM memory chips, I came across several alternatives. My computer was fitted with the MT4264-15 memory chip. Online I also found other acronyms, which, from datasheet, seemed to have the same characteristics, if not for the different speed (RAS access time).
Initially I replaced the chips with other identical ones, but, having mounted the socketes to replace the chips very quickly and without damaging them, I also tried to mount chips with other acronyms, and then test the operation of the C64.
At the end of all the tests, I can conclude that it is possible to mount indifferently any RAM memory chip on the Commodore 64, even mixing the various acronyms on the same mainboard, as seen from the attached photo above.
It is therefore possible to replace the RAM memory chips with any present in this list: 4164-2, MT4264-15, MT4264-20, HM4864P-2, M3764-15RS.
Regarding the speed of the chip, it is good to choose one with RAS access time equal to or less than 200ns. The above abbreviations already take this into account.
In support of this Article, I attach:
- the Commodore 64 Service Manual: it is a technical manual useful to understand the operation of the Commodore C64 and C64C circuits;
- the datasheet of the RAM chip MT4264-15.