Hi,
Im working on a project where i need a thermistor to sense the temperature. Im working in assembly. The controller I'm using is 8051. As the thermistor characteristics are exponential i need to find the (ln) value of my ADC count. So my problem is how to find the logarithm of a number in assembly language?
could anyone here can help me in this regard?
IanP is correct, a lookup table would be the easiest since most likely you are only concerned about finding the natural log over a fixed interval of inputs.
An alternative is to calculate some number of terms of the Taylor series for ln(x).
The Pade approximation is simply another series which can be generated to approximate ln(x). The idea is similar to the Taylor series. I searched google and found this link **broken link removed**
Thks jonathan! I had seen that link already and im writing code for my A/D converter, basing on PADE approximation. One thing I want to ask again is when measuring temperature over a full range from 0 degrees centigrade to 100 degrees centigrade, should i maintain 100 values in luk up table?
You could, or you could store fewer values and use interpolation between stored values (interpolation costs time and code). It depends on how much error you can tolerate, etc. 100 values is not too big of a table if you've got some program memory to spare and it's easiest as IanP stated earlier.