Searching \ for 'logarithmic calc' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/index.htm?key=logarithmic+calc
Search entire site for: 'logarithmic calc'.

Truncated match.
PICList Thread
'logarithmic calc'
1997\12\10@204111 by Aaron Hickman

flavicon
face
Good evening,

       Can anyone point me in the direction of an example showing the
implementation of a logarithmic calculation on the PIC16C84.  I am trying
to convert a voltage (1.5-8.7 volts) from a vacuum gauge into a pressure
in Torr using the relationship (P=10^(V-11.00).  Any help/suggestions
will be greatly appreciated.

Sincerely,
Aaron Hickman

1997\12\10@211758 by Andrew Mayo

flavicon
face
If you only need modest precision, a lookup table might be your best
bet.

> ----------
> From:         Aaron Hickman[SMTP:spam_OUThickmaabTakeThisOuTspamDUNX1.OCS.DREXEL.EDU]
> Reply To:     pic microcontroller discussion list
> Sent:         Thursday, December 11, 1997 2:37 PM
> To:   .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
> Subject:      logarithmic calc
>
> Good evening,
>
>         Can anyone point me in the direction of an example showing the
> implementation of a logarithmic calculation on the PIC16C84.  I am
> trying
> to convert a voltage (1.5-8.7 volts) from a vacuum gauge into a
> pressure
> in Torr using the relationship (P=10^(V-11.00).  Any help/suggestions
> will be greatly appreciated.
>
> Sincerely,
> Aaron Hickman
>

1997\12\10@220433 by Sean Breheny

face picon face
At 08:37 PM 12/10/97 -0500, you wrote:
>Good evening,
>
>        Can anyone point me in the direction of an example showing the
>implementation of a logarithmic calculation on the PIC16C84.  I am trying
>to convert a voltage (1.5-8.7 volts) from a vacuum gauge into a pressure
>in Torr using the relationship (P=10^(V-11.00).  Any help/suggestions
>will be greatly appreciated.
>
>Sincerely,
>Aaron Hickman
>

Aaron,

It would seem to me that you are looking for an exponential function rather
than a log. If you have voltage and wish to calculate pressure, then you
simply want to raise 10 to the power of the Voltage - 11.00

Take a look at http://www.microchip.com I took a quick look at the Embedded
Control Handbook which has many Microchip App notes, including floating
point math routenes, but no exponentiation functions. As Andrew Mayo
suggested, you might try a lookup table, but I would also suggest using a
polynomial approximation to fill in the gaps among values from the lookup
table. I just tried constructing a taylor series for 10^x and it works, but
it requires alot of terms to be accurate over the range you are talking
about. You might try expanding around some value other than the center of
your range. I used 5.1, your center.

Microchip does publish code for floating point multiplication, division,
square roots, etc.

Good luck,

Sean




+--------------------------------+
| Sean Breheny                   |
| Amateur Radio Callsign: KA3YXM |
| Electrical Engineering Student |
+--------------------------------+
http://www.people.cornell.edu/pages/shb7
shb7spamKILLspamcornell.edu
Phone(USA): (607) 253-0315

1997\12\10@224116 by Andrew Mayo

flavicon
face
Off-the-wall slimy hack. Depending on how fast you need to do the
conversion, you could also attach some analogue circuitry to the PIC
which does the calculation (you would want to just do 10^V, with a
feedback-connected semiconductor junction through an op-amp, or
something), and then use single-slope integration via a capacitor to
measure the voltage. Its a pretty weird idea, though, I have to admit. I
think a lookup table in E2PROM sounds nicest - a 24LC16B gives you 2048
bytes of table space for $1.50, after all, and a random-access lookup
time of around 100uS.

{Quote hidden}

1997\12\11@132740 by sdattalo

face
flavicon
face
Aaron Hickman wrote:

>         Can anyone point me in the direction of an example showing the
> implementation of a logarithmic calculation on the PIC16C84.

www.interstice.com/~sdattalo/technical/software/pic/piclog.html

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...