crows
#1 ◈ 2011-07-27
hey guys im trying to read the binary file for a p30 base and i cant get the low cam rpms to read correctly im trying the math on the wiki which is:
This is the conversion from the "low cam" 8-bit RPM values used for VTEC crossover points and in the low-cam tables.
It involves some modular arithmetic, so it's easier to break it up into a couple extra steps.
# Y = input value, 0 to 256 # let H = floor(Y/64) ''Where floor(x) = trunc(x) = int(x) = integer part of x. Fractional part truncated. Whatever you want to call it'' # let L = Y - (H-1)*64 # RPM = 1875000 * L * 2^H / 240000
You can also do it this way, using the modulo operator: # Y = input value, 0 to 256 # Q = Y div 64 ''(integer division, same as floor(Y/64) above)'' # R = Y mod 64 ''(modulus, i.e. remainder after division)'' # RPM = (2^Q)*(floor(R*500/64) + 500)
i cant get it to calculate the rpms correctly i already have the high cam rpms calculated correctly since the equation is simpler i think i have some order of operations mixed up or something if anyone has done this please post some pseudo code or something...
many thanks for any help
This is the conversion from the "low cam" 8-bit RPM values used for VTEC crossover points and in the low-cam tables.
It involves some modular arithmetic, so it's easier to break it up into a couple extra steps.
# Y = input value, 0 to 256 # let H = floor(Y/64) ''Where floor(x) = trunc(x) = int(x) = integer part of x. Fractional part truncated. Whatever you want to call it'' # let L = Y - (H-1)*64 # RPM = 1875000 * L * 2^H / 240000
You can also do it this way, using the modulo operator: # Y = input value, 0 to 256 # Q = Y div 64 ''(integer division, same as floor(Y/64) above)'' # R = Y mod 64 ''(modulus, i.e. remainder after division)'' # RPM = (2^Q)*(floor(R*500/64) + 500)
i cant get it to calculate the rpms correctly i already have the high cam rpms calculated correctly since the equation is simpler i think i have some order of operations mixed up or something if anyone has done this please post some pseudo code or something...
many thanks for any help