Here is how it all began: I decided to upgrade my laptop memory. However, (as usual) I bought the wrong thing because I read after I buy something, not before. I needed two 1066MHz DDR3 RAM sticks, but I bought faster ones, @1333MHz, assuming the motherboard would run them at the slower speed. Which turned out to be wrong, making my machine very unstable: it was able to boot, but there were lots of kernel panics, program crashes, etc.

At first, I decided to return the memory to the shop, but then I thought maybe I could downclock it somehow. Well, it turned out there is a (relatively) easy way to do this. During POST stage of boot, the system reads information stored on an EEPROM chip on each RAM stick — like memory size, logical configuration, and supported timings. Then, based on the read values, the system decides the actual timing values it would use. This whole protocol is called SPD (Serial presence detect).

I found a free tool to modify these parameters: SPDTool. Unfortunately, it’s no longer supported, but it still does the job. I borrowed a laptop with Windows (I was too lazy to repartition my disk to install Windows just to run a single 700Kb app once) and installed one of my RAM sticks on it.

As SPDTool is outdated, it doesn’t support the DDR3 data format so you can’t rely on its data hints. You have to use it as a plain HEX editor ignoring all the tips and warnings you see — pretty hardcore! After reading some reference from Wikipedia, I found out that the only thing I had to change was byte 0x0CMinimum cycle time tCKmin. The original value was 0x0C (or 12 -> 1.5ms -> 1 / (1/8 * 12) = 667, or 1333MHz) and I changed it to 0x0F (or 15 -> 1.875ms -> 1 / (1/8 * 15) = 533, or 1066MHz).

So after modifying the values, I wrote the data to the EEPROM, installed the memory stick to my laptop and voilà! its memory is now running on 1066MHz and it is rock stable! I didn’t flash the second chip’s SPD because the system runs at the speed of the slowest installed memory anyway.

There is a proprietary tool called Thaiphoon that is made especially for editing SPD. It looks a lot easier to use and it is very well documented (that’s where I got the idea to flash my SPD from) so it’s worth checking it.

DISCLAIMER: of course, flashing an EEPROM on your RAM is not quite safe. Do it on your own risk.