Thanks Darrel,
sorry it took so long for me to get back to this thread...
here is my code as I have it now (seems to work ok)
I enter the subroutine having parsed the NMEA $GPRMC recieved from the GPS.
VAR "Knots" contains the integar value, VAR "Knotss" contains the decimal or fractional value of speed data recieved from the GPS.
Code:
CalcMPH:
arraywrite speed,[dec2 knots,dec2 knotss] 'combine knots and knotss into 4 byte array
arrayread speed,[dec4 kk] 'now get the 4 digit dec value of the array
mph = kk * 9881
mph = R0 + R2.15 + kk 'mph now contains 4 digit value of mph/tenths/hundredths
mphh = mph//100 'isolate tenths and hundredths
mphh = mphh/10 'eliminate the hundreths and keep tenths
mph = mph/100 'now keep integer mph, first two digits of 4 digit value
return
I would like to learn more about the use of system variables (R0, R2...) can you point me to where these are documented? I searched the 12f683 document and did not find them.
Thanks for your help.
Dwight
Bookmarks