Quote Originally Posted by Ingvar
This formula is missing a parethesis.

VELOCITY = (12 / ( RAW * ( 1 / 12000000 ) ) / 12

However, it will probably boil down to ....

VELOCITY = ( 12 * 12000000 ) / ( 12 * RAW )

.... which equals ......

VELOCITY = 12000000 / RAW

This is easy to calculate with DIV32 as long as the divisor is 15 bits or less.
/Ingvar
Hi Ingvar, long time since we last conversed....
Your genius has not deminished and I'm humbled by your math skills.

I ran a couple of RAW values on my calculator, YES you are spot on V = 12e6/RAW comes out right. If you knew how much time I spent trying to work that out myself you'd laugh your head off at me :-)

The 12000000 figure is the system clock frequency BTW, but I suspect you guessed that one.

I'd better go digest your code for larger than 15 bits.

Thanks again. Look me up if you ever come visiting Australia