ADAM'S WEB PRESENCE

12 August 2008

Working prototype of RS232 Rate Converter

Filed under: General — adam @ 8:33 pm

First prototype of the RS232 Rate Converter

I am making some progress toward a manufacturable design of my RS232 baud rate converter. I now have the prototype working.

As you can see from the photo, I had to add a couple of wires to the PCB but only a couple and I am very pleased about that!

I am going to revise the board design before sending it for manufacture - apart from the couple of patches I also forgot to bring out the chip programming lines and the reset line. These are not needed for normal operation but will be needed to initially program the chip. To this end I am putting a new 10-way header on the board for programming and debugging.

Another issue I had when bringing the thing from prototype to a production stage was the firmware. I realized there really should be some way for end users to update the firmware either to patch bugs or add new features when customers inevitably request them. I do not want to be physically mailing these things back and forth for modification once they are sold. To that end, I have written a boot loader and firmware update utility.

I’m now ready to get the board manufactured. I want to do a small run of 20 or so to start off with. I used BatchPCB for my prototype but they are not cost-effective for more than one or two boards. After comparing a few different places, I have also come to the conclusion that local Australian PCB manufacturers are 3 to 4 times the price of an offshore fab. So I am going to try a Chinese manufacturer.


4 August 2008

Commercializing my Hobby

Filed under: General — adam @ 6:52 pm

I enjoy designing little electronic devices in my spare time. I like working with circuit boards and digital chips, I’ve posted a few of my projects here on my blog in the past.

And some people have been reading those blog entries and have been asking me to make stuff for them. I’ve given in to a few people here and there and built some. I think this indicates a clear although small demand for these devices.

So I’ve decided to have a go at manufacturing some things for sale. I’ve reviewed my designs and I think these two are obvious candidates:

1. RS232 Speed Converter
2. MIDI Clock Source

I’m going to start with the RS232 Speed Converter since that design requires the least amount of work to get it to production. I’ll post my progress here on this blog. Let’s see if I can sell something. Wish me luck!


21 July 2008

Linux Equivalent of the Windows GetTickCount() function

Filed under: Nerd Notes — adam @ 4:08 pm

GetTickCount() is a real handy function in Windows but does not exist in Linux. This code will give a similar result:

#include <sys/time.h>

unsigned GetTickCount()
{
        struct timeval tv;
        if(gettimeofday(&tv, NULL) != 0)
                return 0;

        return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}

14 July 2008

Gravatar support

Filed under: General — adam @ 10:54 am

Just a quick note that this site now supports Gravatars. So if you make a comment here and are registered over at www.gravatar.com, your picture will appear next to your comment like magic!


3 June 2008

UDEV swapped my drives!

Filed under: Nerd Notes — adam @ 4:18 pm

After doing a dist-upgrade on a Debian Etch system, it would no longer boot! It loads the kernel and then stops displaying the following message:

Waiting for root filesystem

I’ve just spent a few torturous hours trying to get it back up again. It took me a while to figure out what was happening but it seems that the updated package for UDEV changes the GRUB configuration so it tries to mount hdb1 instead of hda1 as the root file system. Of course hdb1 does not exist on this single-drive machine so it just sits there like a moron.

Turns out it is not frozen. If you wait about 3 minutes, it will eventually come up with the following prompt:

(initfs)

I found that I can kind of get the system running by typing the following commands. These are for a single-partition system on an EXT3 file system on an IDE hard drive. If your system is different, you will need to modify them a bit:

mkdir /mnt

mount /dev/hda1 -t ext3 /mnt

chroot /mnt

login

Then log in. The next thing to do is to correct the GRUB configuration:

nano -w /boot/grub/menu.lst

Change the root=/dev/sdb1 entry to root=/dev/sda1. Once again, this is for a single IDE drive, you may need to change it if you are booting from SATA or some other kind of device.

Now regenerate the initramfs image:

dpkg-reconfigure initramfs-tools

At last we can reboot. The system came up fine for me after this.

reboot

26 May 2008

Adaptec 1430SA on Debian Linux “Etch”

Filed under: Nerd Notes — adam @ 4:38 pm

Well folks, I just got saddled with this Adaptec/Marvel piece of poo and now I have to make it work on a Debian server. The server belongs to my employer and is running Debian “Etch”.

The Etch release of Debian does not have a driver for this card built-in and even though Adaptec claim to support Linux, their drivers simply do not work unless you are running some specific outdated versions of Red Hat or SUSE. That’s not what I call Linux support!

I’m not the only one discovering this, Brent Norris wrote a wonderful article titled “Adaptec 1420SA is JUNK!” on his blog which describes pretty much the exact situation I find myself in which Adaptec just doesn’t want to know about Linux.

When are these guys (by whom I mean most major hardware manufacturers) going to realize that Linux is here to stay and is getting real popular, especially in the server room.

Anyway, enough ranting. After a couple of hours Googling around, I see that there is an open source driver available for this card and it is built into Linux kernel version 2.6.22. Debian Etch uses 2.6.18 so all I need to do is upgrade the kernel.

The easiest way to install the upgraded kernel is to get a DEB package from Debian Backports. Go to this page:

http://packages.debian.org/etch-backports/admin/

and grab a kernel, there are usually a couple of different versions available there.

Install it and reboot. Works great so far.

PS. I notice that the driver for this card was released into the Linux kernel by Red Hat corporation. So it seems even they are fed up with Adaptec’s poor support for Linux!


13 May 2008

Extract Chapters from a DVD

Filed under: Homemade Creations, Products — adam @ 11:07 pm

I have this video camera, a Sony DVD201E which records straight to a mini-DVD disc. I want to copy the recorded video onto my PC but the software which comes with the camera is pretty awful. Besides it is Windows-only and I do prefer to use Linux.

So I have made a little Linux app which can extract scenes from a DVD disc. The camera records each scene as a DVD “chapter”. My application reads a DVD disc and copies each chapter into a separate MPEG file. I’ll publish it here in case anyone else finds it useful.

Downloading and Compiling

I’m just releasing this as source code at the moment. I have tested it under Ubuntu 7.10 but It will probably work fine on any UNIX-based system. You can download it here:

DvdChapterExtract-1.2.tar.bz2 (16k)

You will need libdvdread and libavformat before you compile. So install those:

sudo apt-get install libdvdread-dev libavformat-dev

Next unpack and compile:

tar jxf DvdChapterExtract-1.2.tar.bz2

cd DvdChapterExtract/Release

make all

Usage

1. You need to record your discs in Video mode, not “VR” mode. VR is a Sony proprietary format which cannot be read in a regular DVD drive.

2. After recording your disc, you must Finalize it in-camera.

3. Put the disc into the DVD drive on your PC.

4. Launch the DVD chapter extract tool like so (assuming /dev/scd0 is the name of your DVD drive).

./DvdChapterExtract -d /dev/scd0

It will extract each chapter into a separate file called chapter001.mpeg, chapter002.mpeg and so on. These can be loaded directly into any video editing software.

The camera also tags each chapter with some meta-data such as the date and time the scene was recorded. I have not yet figured out how to read that data.


30 April 2008

No more advertising

Filed under: General — adam @ 8:36 pm

As you can see, I have removed all the Google ads from this blog.

This blog gets around 1000 page views per day and I’ve been running the ads for about a year and a half now. In all that time Google have not paid me anything. Not a cent! So they are gone.


23 April 2008

Installing Debian from a USB Key

Filed under: Nerd Notes — adam @ 1:33 pm

My USB KeyI’m astonished how quickly CDs and DVDs are going the way of the Fondue Fork. Seems that everyone is downloading stuff these days and USB devices have exceeded DVDs in capacity already.

I can see it won’t be long before DVD drives will be an optional extra on new PCs (especially laptops) and will eventually disappear like floppy drives (remember them ?).

So it’s time to look at installing from USB on a machine which has no disc drive at all. I’ve found a few guides out there on the internet but none of them were easy to follow. I had to read several of them and then I still had to guess at stuff that wasn’t mentioned.

So here is my guide which is a little more comprehensive.


NOTE 1: I am assuming your USB device is /dev/sdb. If yours is not, you will have to change the examples to suit.

NOTE 2: I’m assuming you are logged in as a regular user. if you are logged in as root, just drop “sudo” off the beginning of all these commands.

Step 1 - Download the installation image

While there are several “small” installs for putting on a credit-card CD and so on, USB sticks are now large enough that you can use a normal install CD image. I am going to use the Debian Net Install which weighs in at around 160MB. This should easily fit on a 256MB device which quite frankly, people throw away these days because it is so uncool to have such a small device dangling from your keyring.

Go to http://www.debian.org/CD/netinst/ and download the netinst image for your platfom (if you don’t know, it’s probably i386).

Step 2 - Partition and Format the USB device

Most USB keys come pre-formatted with a FAT16 or FAT32 file system. If this is the case with your stick, just erase all the files on it and proceed to Step 3.

But of course, I had previously formatted mine with EXT3 so I’ll need to reformat it with a DOS format.

First set the partition type to DOS

sudo sfdisk -c /dev/sdb 1 c

Next, format the partition.

sudo mkdosfs /dev/sdb1

Step 3 - Obtain a kernel and RAMdisk image

Next you need an hd-install kernel and initrd image. You can download these from Debian also. For the current version of the kernel, they should be available from here:

http://ftp.debian.org/debian/dists/stable/main/installer-i386/current/images/hd-media/

Grab the two files vmlinuz and initrd.gz then mount your USB device and copy them onto it:

sudo mount /dev/sdb1 /mnt

sudo cp vmlinuz /mnt/

sudo cp initrd.gz /mnt/

Then you will need to make a file on the USB device called syslinux.cfg - just create a plain text file. Cut and paste the following two lines into it:

default vmlinuz
append initrd=initrd.gz

Step 4 - Copy the installation image

Next copy the ISO file you downloaded onto the USB device. From the commandline you can do it like this:

sudo cp debian-40r3-i386-netinst.iso /mnt/

Step 5 - Make the device bootable

You will need to have a couple of additional packages installed to do this:

sudo apt-get install syslinux mtools

Type these commands to make the stick bootable:

sudo syslinux /dev/sdb1

sudo install-mbr -r -p 1 /dev/sdb

Now you can unmount the USB device and you are good to go!

sudo umount /mnt/usb

UPDATE - I corrected an error in this, if you tried following it before 15-Jul-2008, you might have ended up with a non-working installer.


28 March 2008

Apple Crumble

Filed under: Homemade Creations — adam @ 8:21 pm

My last few articles have been very technical, so to slow the pace down a little, here’s an Apple Crumble I made the other day. I was kind of winging it but it turned out pretty good. I’ll write it here so I can remember the recipe.

Before you start, preheat your oven to 180°.

The Apple

  • 850g Apples (I used “Pink Lady” apples but any kind would probably do)
  • 2 tablespoons Brown Sugar

Core the apples, cut them in half or quarters and slice them with the skin still on. Mix the sugar with about 50ml of water and put it with the apples in a pan. Stew until soft.

The Crumble

  • 175g Plain Flour
  • 100g Brown Sugar
  • 125g Butter
  • 100g Oats
  • ½ teaspoon Cinnamon

Put the oats into a food processor and lacerate them into small pieces. Then dump in the rest of the ingredients and process until it is well mixed.

Put the stewed apples into a baking dish. There was some liquid left over from the stewing, I did not drain it.

Then sprinkle the crumble over the top. Do not pack it down, you want it light and crumbly.

I baked it for about 50 minutes, it was OK but that was probably too long. Next time I’ll try about 30 minutes.

Serve with whipped cream or ice cream. You’ll get about 12 serves from these quantities.


Next Page »

Powered by WordPress