Hi,

I got side tracked on some engine math that might be of general interest. Probably somewhat specific to my PCM but I expect this will be done in similar ways in other PCMs. This is my just my understanding and if you find errors or can jump in with a better explanation, please do!

I got looking at the TPU chip and the math behind the computer measuring engine speed. I believe that $1482 in the TPU is updated each low resolution pulse with a count of prescaled clocks that happen between low res pulses. This is a function of the TPU and may be different depending on the loaded microcode but I suspect it is the same for all LT1s.

Since low res pulses happen four times per revolution, 15RPM would represent 1 fire event per second. The TPU clock is based on the CPU E clock. The CPU crystal frequency is 12.5829MHZ, Eclock is a divide by four function resulting in the frequency of Eclock being 3,145,725HZ. My understanding of the TPU is that the clock counted in Location $1482 is a prescale of Eclock with a divide by 48 circuit. This clock frequency is 65535.9375 which we can round up to 2^16. I note that this is the same frequency used by the VATs I wrote about a week or so back.

The software uses the count to arrive at various "divide by n" RPM numbers. Various scales are used depending on the purpose. The intent is to have the scale fit the lookup table and RPM range as needed.

In my Eside half of the PCM I see a good number of scaled RPM variables are used. In my case I see:
RPM/5
RPM/6
RPM/8
RPM/25
RPM/62.5
RPM/500

The variable used to generate each of the scale factors is generated using the 15RPM constant that results in 1 ignition per second. Divide that by the desired scale, then multiply by 512. Examples...

Scale 15/Scale Variable/Denominator
5 3 1536
6 2.5 1280
8 1.875 960
25 0.6 307.2
62.5 0.24 122.88
500 0.03 15.36

The Tside has similar code. The variables differ because the prescale is no the same in the timer inside the CPU.
My Eside code uses various scaled counts and also uses the TPU count directly for various (yet unknown to me) functions. With this I now have hundreds of places where scaled RPM is used.

-Tom