CommanderLake
Member
I want to pulseout (at 32MHz) with a time value straight from the ADC10 input and display the pulse time on a 2X8 OLED display, the thing I cant figure out is how to display a time such as "1279.25u", if I reduce the maximum time by dividing ADC10 by 10 I can display the time like this:
w10=w9*125+50
bintoascii w10,b6,b7,b8,b9,b10
gosub print
where w9 is the ADC10 value.
But if I want up to "1280.50u" (ADC10 +1 *125+50) for example it results in an overflow.
Note: I add 1 to ADC10 so the minimum is 1.
I cant do w9*12 because its inaccurate, so how do I achieve this without exceeding 65535?
w10=w9*125+50
bintoascii w10,b6,b7,b8,b9,b10
gosub print
where w9 is the ADC10 value.
But if I want up to "1280.50u" (ADC10 +1 *125+50) for example it results in an overflow.
Note: I add 1 to ADC10 so the minimum is 1.
I cant do w9*12 because its inaccurate, so how do I achieve this without exceeding 65535?