Commodore 64, breadbin case restoration repair memory, RAM, SID, CBM, C64, fix

Commodore 64 memory repair

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!

Subscribe my YouTube channel ValorosoIT. Retro technology, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

Commodore 64, used defective broken, ad, Subito.it, Facebook Marketplace, Kijiji, flea market

I initially thought of using this computer to get 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.
Commodore 64,? Out of memory error in 0, ready, strange characters on screen, memory defect, RAM defective

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.

Commodore 64, schema elettrico, schema RAM, chip memoria MT4264-15, MT4264-20, 4164-2, HM4864P-2, M3764-15RS, D0 U21, D1 U9, D2 U22, D3 U10, D4 U23, D5 U11, D6 U24, D7 U12, 64Kx1 150ns 16-pin DIP DRAM chip

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
  • D7=U12

At this point, I just had to figure out which bit was faulty, which transformed, on the monitor, the “space” character into the dollar “$”. For this analysis, the Commodore 64 character table, otherwise called CBM ASCII, is useful:

Commodore 64, character table, ascii cbm, U5 2332A, character ROM

Il carattere “spazio” corrisponde al numero &H20 (in esadecimale), che è il 32 (espresso in numeri decimali). Invece, il carattere dollaro “$” corrisponde al numero &H24 (in esadecimale), che è il 36 (in decimale). Il numero del carattere si è quindi spostato da 32 a 36, con un incremento di 4. Esprimendo il numero 4 in potenze di 2, si ottiene 2^2. Da questo ragionamento, si evince che il bit difettoso della memoria RAM era il D2, corrispondente al chip U22.

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.

Commodore 64, removal, memory chip replacement, RAM, MT4264-15, 4164-2, MT4264-20, HM4864P-2, M3764-15RS, memory chip replacement, DRAM, memory defect, strange writing on screen, 64Kx1 150ns 16-pin DIP DRAM chip

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.

Commodore 64, RAM memory chip test program, MT4264-15, MT4264-20, 4164-2, HM4864P-2, M3764-15RS

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).

Follow me on Instagram channel. Retro technology, Commodore, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

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.

Commodore 64, memory chip, RAM, 4164-2, MT4264-15, MT4264-20, HM4864P-2, M3764-15RS, memory chip replacement, DRAM, memory defect, strange on-screen lettering

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.

Commodore 64, memory chip, RAM, 4164-2, MT4264-15, MT4264-20, HM4864P-2, M3764-15RS, memory chip replacement, DRAM, memory defect, strange on-screen lettering

Documentation

In support of this Article, I attach:

Subscribe my YouTube channel ValorosoIT. Retro technology, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

Do you like this page? Share it:

Posted in Retro Computer, Retro Technology and Vintage Electronics, All articles.

5 Comments

  1. Amedeo, I would like to see videos on how to repair the power supplies of the commodore 64 and C64C, as well as on the power supplies of the floppy drives 1541-II and the repair on the datassettes. Can you prepare them ??
    And if you can best buy these products, or the power supplies just mentioned. Greetings

  2. Hi Amedeo
    I am writing to you just to tell you that this page on repairing RAM memory C64 I was
    very useful for which I wanted to thank you, very interesting also the reasoning you have
    followed to find the failed ram based on the displayed characters.
    I already follow you on Youtube and Facebook.

Leave a Reply

Your email address will not be published. Required fields are marked *