Searching \ for 'Ln or log' in subject line. ()
Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=log
Search entire site for: 'Ln or log'.

Truncated match.
'Ln or log'
2000\01\24@073607 by

<x-flowed>Hello everybody

can anybody explain how to perform the ln() function on af pic16c84. I could
also use info about how to perform the log() function. I need it to measure
the size of a capacitor.

Thomas Thorsen
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

</x-flowed>
Hi Thomas,

Offhand I don't have a LN or LOG routine for you, but I can tell you that
you can convert from LN to LOG and vice versa by the following:

log x = (ln x)/(ln 10) =  (ln x)/2.30259
ln x = (log x)/(log e) =  (log x)*2.30259

ln x is defined as the integral from 1 to x of (1/y)*dy
You could probably kludge together a routine from that fact and a simple
numerical integration algo, but I'm sure there are many optimizations
possible.

Sean

At 01:25 PM 1/24/00 CET, you wrote:
{Quote hidden}

| Sean Breheny
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
shb7cornell.edu ICQ #: 3329174

Thomas Thorsen wrote:
>can anybody explain how to perform the ln() function on af pic16c84. I
could
>also use info about how to perform the log() function. I need it to measure
>the size of a capacitor.

This Microchip AppNote gives all the gory details:
www.microchip.com/10/Appnote/Category/Library/00660/index.htm
(AN660)

Cheers,

Ken

Get an old log table book, check the data range required and copy every
tenth sample  or whatever you need to eliminate to squeeze into a table
in the PIC, you may also need to drop some digits.

For data on intermediate positions you can make a guess based on
position between look up table entries.

{Quote hidden}

On Mon, 24 Jan 2000, Thomas Thorsen wrote:

> can anybody explain how to perform the ln() function on af pic16c84. I could
> also use info about how to perform the log() function. I need it to measure
> the size of a capacitor.

Theory:
http://www.dattalo.com/technical/theory/logs.html

Practice:
http://www.dattalo.com/technical/software/pic/piclog.html

However, before you consider using these, you may wish to describe why you
need them to measure 'the size of the capacitor'. I know the answer, but I
also know that there have been many other techniques discussed here on how