Site Network: Home | Portfolio | Essay and Reports | Sandbox | Wiki

Embedded Ethernet

Interfacing an AVR with an ubiquitous Ethernet network allows for a host of novel applications with embedded communications. The Microchip ENC28J60 makes the tedious job of building a network interface simple, using the 'Serial Peripheral Interface' (SPI) and requiring only 4 wires.

Read more...

Cameras in OpenGL

I had assumed that having a camera in a 3D-graphics system was fairly elementary, until looking into walking-through a scene with OpenGL. The system does not contain a ‘camera’ object, but requires the entire scene to be rotated to simulate a moving viewport.

Initially, this seems to be a convoluted solution to a simple problem, but it is almost certainly a performance issue. OpenGL using interactive (rather than Ray Traced) rendering needs a strong idea of where objects are with respect to the camera. If the camera were to be moved, it would be likely that the OpenGL system would have to rotate the whole scene to achieve the effect, and therefore is trying to be a little more transparent.

The GLu library provides a useful helper function gluLookAt(...) to calculate the transformation matrix which is all well and good. However, trying to achieve ‘common’ camera effects with this rough interface is a challenge, involving lots of vector algebra and nasty code.

I have created a C library which implements a Camera-like ‘object’ on top of the functionality provided by GLu. This is currently pre-beta and totally undocumented – an updated version should be available soon:

Comment

Good Documentation

I am not one for providing copious documentation within source code – especially when it is totally unnecessary. However, I do like to see complex structures and crazy little hacks statements are given a little qualification.

Today, trying to port a software library to the AVR family of microprocessors I came across a good one:

++((char *)uip_appdata);

The GCC compiler is understandably nervous about this one, and I’m still not sure what it actually means.

Suggestions on the back of a postcard please.

Comment

Compiling for AVR with GCC and *nix

The file system employed by *nix systems is far more comprehensible that either FAT32, NTFS or whatever Microsoft is promoting with Vista or Windows 7. One problem, however, is portability between Windows and *nix platforms.

I have just lost half a morning trying to compile some C code for an AVR on my MacBook – the compiler complaining that:

compiler.h:31:26: avr\signal.h: No such file or directory

compiler.h:31:27: avr\interrupt.h: No such file or directory

compiler.h:31:28: avr\io.h: No such file or directory

I know for a fact that these libraries exist and looking at the offending lines of code there is nothing obviously wrong:

#include <avr\signal.h>

#include <avr\interrupt.h>

#include <avr\io.h>

Then it seemed obvious: the path separator is the wrong way around – just another way for Windows to make my life difficult without having to touch it! Correcting it to:

#include <avr/signal.h>

#include <avr/interrupt.h>

#include <avr/io.h>

and the problem is fixed (expec signal.h is deprecated).

So much for code claiming to be tested on every platform, but then again what is to be expected of code that tries to redefined the keyword ISR?

Comment

Drawing a Sphere

I have spent the morning trying to draw a wireframe sphere, using OpenGL but without the standard glu_ and glut_ extensions. I now have a sphere with a very pleasant spiral pattern on it – just a shame watching it rotate makes my head hurt!

Comment

The Specification

Time and time again I tell clients that we need to work out and agree a detailed specification of the product to be delivered; normally met with a response of ‘oh just do what seems right.’

This is also the case with the coursework exercise that I’ve just been set of a module in Management – which I never really wanted to study anyway:

This should be answered in report style, with a clear introduction and conclusion. The answer should have a well written, well observed case study that includes the evidence you might draw upon in your analysis. I will be looking for:

A well chosen and relevant case study.

Clear analysis.

A link between your case and the stance you take in answering the question.

Tell me about the technology of the project/company and then provide an analysis of how accounting/finance may interact with the engineering/technological aspects of the case study.

A more vague description I’ve never seen.

Then again, what should we expect from a department that specialises in training managers…

Comment

LaTeX Listings Package

The LaTeX Listings package is woefully underspecified in any documentation readily accessible online. One such problem is trying to change the title of the list of listings from “Listings” to “List of Listings” to fit in with the built-in “List of Figures” and “List of Tables.”

Searching Google reveals many mailing list articles and forum posts describing the exact same problem, but never arriving at a neat solution. After dissecting the .sty file it turns out it is a simple one-line redefinition:

\renewcommand{\lstlistlistingname}{List of Listings}

Comment [1]

Pictures and Photos and Flickr - Oh My!

I have been playing around with the excellent vdh_flickr plugin for Textpattern. After a little disagreement between various stylesheets I can now announce that my Flickr photos are now available here.

Comment

What I'm Reading: Why Don't Pengin's Feet Freeze?, Mike O' Hare

Why Don't Penguin's Feet Freeze?, Mike O' Hare

The New Scientist magazine’s ever-popular “Last Word” column produces and endlessly fascinating array of questions and answers from its readers. For all those who relish its mixture of wit, insight and scientific curiosity – not to mention those who have read and enjoyed Does Anything Eat Wasps?, the brilliantly successful previous collection – this new volume will be irresistible.

Why Don’t Penguins Feet Freeze? includes recent answers never before published in book form, as well as old favourites from the column’s early days. This bumper collection brings together the highlights of the ‘Last Word’ in another wise, weird and wacky compendium that is guaranteed to amaze, inform and delight.

See more at Amazon

Review Coming Shortly

Comment

What I've Read: Mostly Harmless, Douglas Adams

The fifth and final book in the ‘trilogy’ of Hitchhikers Guide to the Galaxy, Mostly Harmless by Douglas Adams is a good read.

Mostly Harmless by Douglas Adams

The Hitchhiker’s Guide to the Galaxy has, in what we laughingly call the past, had a great deal to say on the subject of parallel universes. Very little of this is, however, at all comprehensible to anyone below the level of advanced god and, since it is now well established that all known gods came into existence a good three-millionths of a second after the Universe began rather than, as they usually claimed the previous week, they already have a great deal of explaining to do as it is, and are therefore not available for comment at this time…

See more at Amazon

Review Coming Shortly

Comment

Hitchhiker's Guide to the Galaxy

A trilogy in five parts, written by Douglas Adams relating the tale of Arthur Dent and Ford Prefect as they travel across the Universe:

Comment

Previous