xGoat
More tea please.

I2C Device udev rule

I just wrote a udev rule that would make any userspace i2c devices be owned by the i2c group:

KERNEL=="i2c-[0-9]*", GROUP="i2c"

(You can stick that in a file in /etc/udev/rules.d if you’re using Fedora).

Posted at 12:24 am on Tuesday 29th January 2008
No Comments

Doubling the resolution of your CNC machine

  1. Add 4 lines to the firmware for the MSP430s that sequence the stepper motor drivers so that they half-step (so that there are sometimes two active coils).
  2. One’s resolution has doubled.
  3. Dance.
  4. Push changes up to public firmware git repository.

We did have a resolution of 0.2mm per step. Now we have 0.1mm. w00t.

Posted at 1:51 am on Wednesday 15th August 2007
One Comment

CNC Videos

CNC!

Posted at 11:11 am on Sunday 12th August 2007
No Comments

Scraping John’s Site…

Have just spent an hour or so setting up an RSS feed for John’s New Zealand adventures. Should update every half an hour.

Source used to generate it available here :-)

Edit: Something’s gone wrong with the ECS servers… I guess it’ll be back up soon…

Edit: Seems to be back up now.

Posted at 11:48 pm on Monday 6th August 2007
No Comments

Sunday 6th August, 2007

Posted at 12:01 am on Monday 6th August 2007
2 Comments

Using an ICD 2 from a Virtual Machine

I want to be able to program and debug PICs with my MPLAB ICD 2. Unfortunately, Microchip doesn’t spec the USB interface to the ICD 2, so unless I reverse engineer it there’s not much I can do but use the Windows software they provide.

I don’t like windows.

So, I installed Windows Server 2003 in the version of QEMU that the KVM people produce. The install ran really smoothly up until there were 39 estimated minutes remaining. It then took around 4 hours to complete. I installed MPLAB in the VM, plugged the ICD 2 into my laptop and then “plugged” it into the VM’s USB. One of those annoying little “you’ve just done something” balloons appeared and I selected “automagically locate driver”. It failed to find a driver. Urgh.

I then thought “Hmm. I haven’t actually tested that MPLAB works in the VM”. I ran MPLAB. It said something along the lines of “MPLAB doesn’t work in this operating system”. Damn.

Take 2

So, I started to create a new VM containing XP. Many hours later I had a fresh install of XP. Installed MPLAB. Ran MPLAB. Worked. “Plugged” ICD 2 in. No magic bubble. Rats.

“Perhaps I need SP2… I’ll run Windows Update.”

I ran Windows update. Many many many hours later I have SP2 installed. Plugged in ICD 2 and joy - magic bubble appears. Automagic search for driver successfully installs the driver.



From when I’ve used the ICD 2 before, I remembered that when one plugs it in, you get two magic windows “device connected” beeps - and one has to install two drivers. I’d only installed one on the VM and the magic bubble generator appeared to have run out of fuel.

Then I noticed that the USB Device ID of the ICD 2 had changed. Presumably the first driver changes it in some way after loading firmware into the ICD 2. Telling QEMU to connect the second device caused Windows to locate the device and to generate another magic bubble.

Yay!

I ran MPLAB and it successfully updated the “operating system” on the ICD 2:


I have yet to try it with a PIC… That’s the next step :-)

Posted at 12:56 pm on Saturday 23rd June 2007
One Comment

Tcl stuff

I spent the first half of today learning Tcl. Then I started writing a gumsense extension for it:

load ./libgumsense.so

gumsense::open
puts "The time is [gumsense::read_time]"

gumsense::set_time 3
puts "The time is [gumsense::read_time]"

(NB: I’m experiencing problems with making it a package at the moment because the gumstix buildroot doesn’t install everything (I think) it should - wasn’t a priority.)

Output:

# ./test.tcl
The time is 1176423144
The time is 3
#

So now I just have to spend a few hours wrapping Tcl around the C library, and I’ll have got somewhere…

Posted at 12:14 am on Friday 13th April 2007
No Comments

Dancing around my first kernel driver.

Four days ago I started working on getting the Gumsense to turn the Gumstix supply rail off when Linux has shutdown. I started writing a blog post containing all the things that I had examined. I’m still writing that post; it’s getting pretty long, and will arrive soon.

During that process, I realised that I was going to have to write a kernel driver for the Gumsense. I’ve now written that driver. It’s the first kernel driver I’ve written. It’s a relatively simple driver, but it represents a big increase in my knowledge of Linux internals, and I’m pretty pleased with it. It’s an I2C chip driver and hooks into the Gumstix platform code (which I also had to slightly modify so that I could hook into it).

Posted at 5:12 pm on Monday 9th April 2007
No Comments

And then there were three

After a surprisingly straightforward and pleasing construction and debugging session, the Gumstix is now on the Gumsense mark 2 :-) The Gumstix powers up fine and communicates with the MSP430 successfully.

So far I’ve found two mistakes and two slight annoyance on the board:

  1. I’d missed a ground connection to the output capacitor and diode of the Gumstix switchmode supply. Easily fixed by a short piece of thin blue wire soldered between the diode and a nearby grounded via.
  2. I’d done something weird in the Eagle schematic editor. Eagle has an annoying feature that allows two unconnected wires on the schematic to become part of the same net. That’s not so bad - normally I promote using netnames to connect different parts together. The problem is that in this case, only one of those tracks is labelled. So, I ended up with the MSP430 supply being connected straight to the voltage regulator rather than going through a schottky diode first. This meant that the button cell initially didn’t do anything. Fixing this required the cutting of 4 tracks and the addition of 2 very short pieces of blue wire.
  3. The first slight annoyance is that I’ve put a dual diode (BAT54C) too close to a capacitor. It all fits, it’s just a little tight.
  4. I neglected to put a decoupling/resevoir capacitor on the MSP430 internal reference output pin. The datasheet recommends this. I’d written it down in my list of things to do before the board went off to made too. For some reason, I just completely ignored it.

So, the blue wire count is now three. Analogue section next.

Posted at 6:55 pm on Friday 30th March 2007
One Comment

Isn’t free software great

I’m currently:

Oh, but wait, msp430-gdbproxy and friends aren’t free. Arrrrgh. I can feel my soul dissolving.

If I ignore the dissolving for now, it’s all amazing. So much debugging.

Posted at 11:50 pm on Monday 26th March 2007
No Comments

Site by Robert Spanton. ©2008