sparcalarms, was Re: [rescue] Perverse Question

Eric Josephson ericj at speakeasy.org
Sun Jun 15 21:17:30 CDT 2003


On Wed, 11 Jun 2003, Dave McGuire wrote:

> On Tuesday, June 10, 2003, at 07:28 PM, N.Miller wrote:
> > OTOH, Java runs on cell phones, so obviously there is some kind of
> > subset that it can be cut back to.  Or perhaps Sun has hired some
> > software developers who understand assembler for some platforms?
>
>    There are even Java VMs for 8-bit microcontrollers...it's gaining
> great popularity in the embedded world.  One Java VM for the 8-bit 8051
> architecture is all of 24Kbytes in size.
>

A Java VM on the 8051?  Can it do anything useful, or is
it a just a toy demonstration?

You can do a lot with an 8051.  More than you ever should, really.

On one project I inherited, we had a telemetry system that
took data from a mobile PLC, operator's terminal, gps, and
various sensors and relayed it into a dispatch system via radio.
The hub of this system was based on an 8051 processor with about
a half dozen serial ports hung off it, none of which had interrupt
lines tied into the processor, so they had to be polled.  Between
all the drivers and support for different radios and network protocols
we were already over 48K of code space out of the 64K available.

The gps we used couldn't do any on-board coordinate transforms:
it just spit out raw nmea strings with latitude and longitude.
This was fine since the positions were just relayed back to
the dispatch server and never used by the operator.

Then one day I was asked to add a feature to display local grid
coordinates on the operator's terminal.  To get local grid coordinates
from lat-lon you need do a UTM grid projection and then apply
scaling and rotation (3d) to get from UTM to the local grid.
The task involves a whole bunch of floating-point transcendental
functions and needed about a 33-bit mantissa for the accuracy
we were advertising.

I supposed I could have written a floating-point library
(the compiler only supported single-precision), tried to
fit it in the remaining code space, and spread the processing
out so as not to interfere with all the other tasks going on,
but I just laughed and said 'no', explaining the problem and
pointing out that the processor involved was commonly used
in PC keyboards.

A few months later I was asked again, with the same answer.
I recommended spinning new hardware or adding a dedicated
processor to the GPS interface to transform the coordinates.
They rejected the idea, but kept asking.  It never seemed
to sink in that the answer wouldn't change just because they
wanted it to.



More information about the rescue mailing list