From: Folderol on
I thought some of you might like to know where we'd got to on this. We
now have a working test rig that's looking much better (and easier) than
we expected. Sadly there is little Linux content to it now :(

We discovered the Arduino development environment based on the
ATmega168 microcontroller. This package is fully open source, and the
development board will actually do much of what we want by itself.

The programming language is a cut-down version of C with added, easy to
use functions for I/O, and interrupt control as well.

We are using one interrupt for the incoming timing pulses (at which
point the 4 data lines are read) and another for the cycle reset. This
way all measurements are locked to absolute machine position and resolve
to accurate distance measurements regardless of machine speed.

We use a 625 byte array of char as two 4bit nibbles giving effectively
1250 readings per cycle. In 'search' we use a step size of 8. This
gives us 0.8mm resolution covering the entire cycle of 10,000 pulses
and in 'fine' we get a 125mm window of 0.1mm resolution.

As this is all done under interrupts it is effectively decoupled from
other functions. We have an ordinary polling loop running and when it
gets the appropriate message via the serial port it spits out the
entire array contents at 19200 baud.

So far we've had this running reliably at 15kHz which is faster than we
need.

As a bonus, we can use one of the analog inputs to give an approximate
temperature check!

Having the data cleaned up and read serially means we can use just
about any computer for control and display (the Arduino has a
serial/usb module on board).

Because the computer is only needed in a single-tasking mode, and
graphics we need are extremely simple but have to be big and bold
(visible at a distance in poor light), we decided to use a descendant of
the Acorn RiscPC - an A9. The cost of the machine is more than offset
by the ease of programming.

Oh, and we are indeed using the built-in BASIC interpreter - and it's
in-line ARM assembler for some fast bit flipping :)

--
Will J G
From: Martin Gregorie on
Folderol wrote:
> I thought some of you might like to know where we'd got to on this. We
> now have a working test rig that's looking much better (and easier) than
> we expected. Sadly there is little Linux content to it now :(
>
Thanks for the feedback. I'd wondered which way you'd jump. Needless to
say, I'm not surprised that Linux got washed out: doubtless it was just
too big a hammer for your particular nut.

> We discovered the Arduino development environment based on the
> ATmega168 microcontroller. This package is fully open source, and the
> development board will actually do much of what we want by itself.
>
Thanks for the heads-up. I've tagged this for later reference: I've
looked at the Atmel devices in the past but never needed to use them.
They look very capable chips - MUCH more so than the ubiquitous PIC
devices. The Arduino development system looks like an excellent basis
for one-off or low volume projects.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |