Maybe I can try to translate from Canadian to English. (Just kidding Steve)
Steve's idea is to pre-calculate every value before hand using the PC. It could be done with VB or you could do it in excel if you wanted. Those values are then stored in an external eeprom as one great big look-up table.
Then later when the pic is running, when it needs to convert the numbers, it doesn't have to do any calculations. Just look up the answer from the eeprom. The PC doesn't need to be hooked up to the PIC during normal operation.
Assuming you wanted a range of 600-1100 milibars with 1 decimal place, you could store the whole thing in a 16kbyte eeprom. If you needed 2 decimals it would take a 128kbyte eeprom (yikes).
To calculate the given formula in real time, you would need at least 48-bit math (due to the decimals requested) so there really aren't many other options.
I even tried a 3rd order Power Polynomial formula to try to approximate the numbers, and it came up with an error of +/- 100 feet at the high and low ends. (Not too good)
HTH,
Darrel
Bookmarks