%HTTP_EQUIV_ON_VIEW%
PGMFI Logo
Library> OBD1_8bitHighCamRPM ( vs. r1.1) Destinations: Home | Library | Change Log | Index
Search | Go

 <<O>>  Difference Topic OBD1_8bitHighCamRPM (r1.1 - 26 Jul 2005 - Home.mind-eracer)
Added:
>
>

%META:TOPICINFO{author="mind-eracer" date="1122408060" format="1.0" version="1.1"}% This formula is used to convert values in the high cam table scales to real-world RPMs. If ''x'' is an 8-bit high-cam scale RPM value,

  • Hi Cam RPM?(''x'') = 1875000*''x'' / 53248

53248=D000h. Here is how it's calculated using standard integer fixed-point math tricks:

| |MOV er2, 0ach|; 0805 0 02 00 B5AC4A | |MOV er0, #0d000h|; 0808 0 02 00 449800D0 | |CLR A|; 080C 1 02 00 F9 | |DIV|; 080D 1 02 00 9037 | | |; DIV = (er0, A) <-- (er0, A) / er2; in this case, 0xd0000000 / (1875000/RPM) | | |; using bytes instead of words, (r1,r0,Ah,Al) <-- (r1,r0,Ah,Al) / (r5,r4) |||''... store the high bit of A, decide whether the divide overflowed, etc...'' | |LB A, r0|; 0817 0 02 00 78 | | |;r0 is the least significant byte of er0, which is the most significant word of the quotient! | |JNE label_081f|; 0818 0 02 00 CE05 |||''... overflow conditions, etc...'' |label_081f:|STB A, 0aah|; 081F 0 02 00 D5AA


{ View | Diffs | r1.1 | More }
Copyright © 2002-present by the contributing authors. All material on this collaboration platform is the property of the
contributing authors, and is covered by the Non-Commercial Share-Alike License unless explicitly stated otherwise.
Ideas, requests, problems regarding the PGMFI TWiki?? E-Mail the WikiAdmin
Site Designed By: Digital Fusion   Need a website?

Revision -
Revision r1.1 - 26 Jul 2005 - 20:01 GMT - Home.mind-eracer
%WEBCOPYRIGHT%