[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FILTMPH



Dig wrote:
> 
> The Sunbird XDE just says N= MPH * 256... does it
> mean the whole word, or the upper byte?
> 
> I always understood it as a two-part var, with
> the upper byte being the whole interger, and the
> lower being a fractional remainder. Is that the
> case?
> 
> I'm starting to think this understanding isn't
> right, since I'm getting some really weird inter-
> polated values for the lookups into this table.

You're talking about the 16 bit RAM variable?  Your understanding should
be correct, just remember, the 'HC11 is a big endian processor with the
upper byte stored at the lower address.  RAM location 0x4e contains the
integer portion, and 0x4f the fraction.

There is another RAM variable designed for indexing tables.  The MPH
value is scaled by 16/5ths to give nice column headings.  The downside
of this variable is a maximum road speed of 70 MPH and no fractional
bits.  This 8 bit variable is stored at 0x50.  It is updated whenever
0x4e:0x4f is changed.

Trivia: The 16/5ths scaling turns out to be the same as converting MPH
to half-kilometers per hour (within the accuracy of 8 bits).

-- 
Ludis Langens                               ludis (at) cruzers (dot) com
Mac, Fiero, & engine controller goodies:  http://www.cruzers.com/~ludis/

----------------------------------------------------------------------------
To unsubscribe from gmecm, send "unsubscribe gmecm" (without the quotes)
in the body of a message (not the subject) to majordomo@lists.diy-efi.org