Monday, February 19, 2007

[technical stuff] The hard drive saga

I ran into a few snags over this weekend. My goal on Saturday was to get the sonar hooked up so I could experiment with it. I put together a distribution board that I can use to connect multiple i2c devices onto the bus and added a couple resisters to pull the data lines high. Then I went to my workbench computer (an old G3 mac running ubuntu linux) and it crashed! After attempting to reboot I found that it was complaining about bad sectors on the hard drive. Oh well, it is an old computer and all of my critical data is on my newer desktop system. Since it appeared to be just the drive I figured it would be worthwhile to just get a new drive for it. After booting from CD I was able to do an fsck (after several tries) and mount the disk read-only. I backed the data up over the network and called it a day (had a party to go to that night).

I picked up a new 320GB drive and installed it sunday. I made several unsuccessful attempts to install ubuntu to it, fiddled with connections, tried various methods of partitioning the drive, none of which worked. I was starting to suspect the new drive was bad but then did some research. Turns out the IDE controller on the old G3 mac has a maximum of somewhere around 130GB!!!! I was frustrated but at least I understood the problem. I had been wanting to add another drive to my newer system to allow me to do backups. The drive worked just fine there.

So, after nearly 2 days of fiddling (and yes a little slacking off I admit, it was the weekend!) my workbench system was still down. Since the drive seemed happy after the fsck and the data was then backed up I went ahead and put it back in. It seems to be working ok at the moment but I plan on buying a new (under 130GB of course) drive and replacing it soon.

Today (monday) I finally got back to experimenting with the sonar. I was using the linux kernel's i2c "bit bang" code along with my own driver for the digital I/O board from technologic systems for this. I was not able to get the sonar device to send the ack's when it is addressed on the bus. I decided to back up and write some user-space code to implement at least a minimal subset of i2c. With a lot of technical specs, example code, and most importantly my logic analyzer I was able to get it working. The code is a bit of an ugly hack for now but I can use what I learned from this to make the kernel driver work. I imagine it is something simple.

Tomorrow I plan on experimenting with my AVR microcontrollers and and make sure I can communicate with them over the i2c bus as well.

No comments: