Sunday, January 31, 2010

"Mind" -> Hacking SPD On Memory

This the laptop that I was wrestling with yesterday.  It is an old NC4010 that I decided that I would buy refurb about 2 year ago, so that my wife could have her own PC to do email.  The PC is very small, and while it sold for $2000 when new, it was selling for $200 as a refurb.

The PC never ran as fast as I thought that it should and the battery was not very good, but it was good enough for logging into Google mail for my wife.  After using it a lot for the last two years, I bought a big 17" Acer Portable for her desk downstairs, which she uses all the time.  The nice thing about her new portable is that from time to time, the kids use to watch videos on.  The new portable is more like an entertainment system.

But there were a couple of nice things about the old portable.  With a new battery, it should still get around 2.5 hours of battery life, which is a lot longer than the entertainment system.  It also comes in at about 3.5lbs, which is a very light portable considering that the screen is very tall (albeit with a resolution of 1024 x 768), which is pretty much a winner.

I like that it also had a track stick and a speaker that could be cranked up quite high to listen to web casts.

If the portable was a bit more responsive, I would actually like to keep the thing around, as it had some unique features.  No doubt, the original $2000 price tag allowed the designers to put in a few of the extras that I just described.  So how to fix the performance? 

I suspected that the real issue on the PC is that it had a fairly large, for the age, shared memory space with the video, and I needed a bit more RAM in the thing.  I also needed a new battery, so I looked on ebay, and I found a Hong Kong seller of batteries that would replace the battery for less than $40.  The battery cost wasn't bad.  What about memory?

So, I looked up the memory on the HP site.  It was166Mhz memory (also called PC2700), and the memory was DDR1 (or just DDR).  So, I got online and found I could buy a gigabyte of RAM, doubling the RAM space, for around $40 dollars.  My guess is that this would lower the hard drive swapping by a lot, thus speeding it up.

I had read on the HP forum that some had problems getting new memory to work, so I was very careful to order PC2700/166Mhz chips to make this work just fine. 

Putting in memory is not that hard.  The picture above shows this class of memory, and I'm holding the old memory chips that came out of the HP. 

Laptop memory normally comes in 200 pin DIMMs, which is just another way of describing the packaging.  The important thing to note is that there are 4 or more types of memory in use over the last 5-6 years.  Each memory package look a little like each other, but the notches are set up so that you can't plug a DDR1 into a DDR2. 

The other thing is that the older memory technologies, like SDRAM and DDR1 aren't made much any more if at all.  If you are buying chips, it probably means that you might have a repackaged chip.

When I  got the new chips, I plugged them into my HP, and the screen just went black.  I went to the HP forums, and this is what happens when the memory is not being accepted.  The people on the forum had no idea what was happening, and the were speculating all types of things.  The good thing is that you don't have to speculate, because you can use tools.

Now you may be asking why I am posting this here, but the posts on the HP forum were a couple of years old.  I had a suspicion about why the memory didn't work, and I had enough knowledge to figure out how to check on it.  Unfortunately, the forum posts were for people that had given up a couple of years ago.

The key for me was having another older laptop in my house that I could use to see the chips.  So while the new memory would not boot on the HP, it would boot on my old Dell laptop.

The first thing that you can use to see the memory is something call CPU-Z, which will tell you what is inside of your PC.   Now, I didn't take snapshot at the time of my new memory, this is actually a picture from my Dell portable with its own memory, but you can see that CPU-Z will show you a bunch of stuff including the memory type that is in your machine.  In this case, you can see that the utility is looking at slot #1, which is the onboard memory in my old Dell, and that the type of memory that I have is DDR in that slot is just DDR or DDR1. 

Now what is PC2700?  The memory manufacturers came up with an idea of labeling the memory in terms of bandwidth because this is what the hard drive guys do.  However, it just confuses everyone as the key thing is matching the memory for Mhz not bandwidth.  Regardless, the term PC2700 means that the data transfers at 2.7 Gigabytes of information per second.

Again, most people just want to know the megahertz (MHz).  You can see that the MHz is both 133 and 166.  This is interesting.  Is it 133 or 166?  The answer is "it is both," which we'll cover in just one second.

So, I put my new memory, which was labeled as 166Mhz into my Dell portable to double check the speed, and although it said "166Mhz," there was a third line with 200Mhz on it also!  The memory maker that sent me the chips had repackaged some newer chips, and said that it would work with my older system.

In most cases it is true.  Remember I said that the memory could operate at 166 or 133?   If you have faster memory, it will often work with the older machines.  This is why there are two memory speeds above.  If the system cannot connect at the fast speed, it falls back to the slower speed.  The problem is that my HP was choking and not trying to negotiate the speed.  I did not want to go through the problems of doing an RMA, so I decided to program the chips.  The mechanism for detecting speed is called "Speed presence detect" or SPD, and to program this SPD you need a PC with an open memory slot and a SPD programmer.

The best program is something called Thaiphoon burner.  If you are only going to use the program once, it is $20, but they have a 15 day trial.  So, you can use it for a single shot issue.  There is also SPDtool, but it is harder to use.  The screen shot above shows you a picture from my old Dell portable, looking at the memory that was is in the machine.  What you need to do is "read SPD at 51" which reads the SPD timing of the memory in the second slot.  Beware that you can read the wrong slot and write the wrong data.  Luckily, if you really hose your memory, you can boot with certain pins covered with tape, and reprogram the memory, but it is a real pain.  Better to be careful and not screw up.

If you go onto the memory page, you can pull up the timing memory table.  I stuck the memory from the HP into my Dell to pull up the information, and I got the memory table above.

You can see that it has "table 0" and the other tables.  Table #2 is grayed out, so it doesn't exist.  This only has two memory settings:  166 MHz and 133 MHz.  I also popped in the new memory and sure enough, it had 3 tables.  The third table was at 200 Mhz, just like I saw in CPU-Z.

To get the timing speed, you adjust tRCD, tRP, tRAS, tRC, tRFC, and the tRRD.  I won't go through what they mean because they are Wikipedia.  However, I guessed that I needed to set all tables so that they would coincide with the memory that worked.  What was interesting is that the 166Mhz timing was also different on my new memory.  So, I adjusted my new memory table 0 to the above timings, and I adjust table 1 to the above timings.  If I didn't wipe out the 200MHz setting, the memory would still try and negotiate to a higher speed, so I had to totally remove the 200MHz setting.

After resetting the SPD, I put in the memory chips in the old HP and I let out a whoop of delight as the PC purred to life without a problem.  I also found a new driver for the old Ali Chipset, which was dog to begin with as the company went bankrupt.  Luckily, a university type had spent a bunch of time research the Ali 7101 driver and had it posted on his University page.  Thank goodness to academia.

My wife used the portable last night and remarked how much faster it was with new memory.  I felt a little bit guilty for not fixing it earlier, but for $80, we were going to have a very servicable extra portable around the house.

1 comment:

phil said...

Thanks for the article, man! Although the newest version of Thaiphoon Burner 6.7.1.0 is already available, it does not bring something new for DDR SPD. Anyway, you may contact Vitaliy Jungle (the author of TB) to get a free personal license!