I need to process some GPS data that is in 32bit and 64bit Floating Point format.
My PIC16F648A project gathers serial data from a GPS Disciplined Oscillator unit and stores it in a array.
This past week I didn't even know what 32 or 64bit Floating Point was, now I understand how to assemble the floating point data into a decimal number, from the HEX bytes, on paper. But, I need to have PBP do the math for me.
Here is an example of the oscillator temperature data in 32bit FP:
MSB..........LSB
41E99BBE
Here is what I have been trying to do with PBP...
The following code ignores the 'Sign' bit in Byte1 and is to extract the 'Exponent' from the next 11 bits.
B0 = 0 'EXPONENT
B1 = BYTE1.BIT6
IF B1 = 1 THEN LET B0 = B0 + 128
B1 = BYTE1.BIT5
IF B1 = 1 THEN LET B0 = B0 + 64
.
.
.
The following code example is to extract the Mantissa from the remaining bits
B2 = 0 'MANTISSA
B3 = BYTE2.BIT3
IF B3 = 1 THEN LET B2 = B2 + .5
B3 = BYTE2.BIT2
IF B3 = 1 THEN LET B2 = B2 + .125
.
.
.
Unfortunately, I get the following PBP messages when trying to compile.:
ERROR Line 158: Bad variable modifier: .125.
ERROR Line 158: Bad expression. (vmon5_0.pbp)
Is there an easier way?
Thanks,
John
Bookmarks