Searching \ for 'logarithmic calc' in subject line. ()
Help us get a faster server
FAQ page: massmind.org/techref/index.htm?key=logarithmic+calc
Search entire site for: 'logarithmic calc'.

Truncated match.
'logarithmic calc'
1997\12\10@204111 by

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
If you only need modest precision, a lookup table might be your best
bet.

> ----------
> From:         Aaron Hickman[SMTP:hickmaabDUNX1.OCS.DREXEL.EDU]
> Reply To:     pic microcontroller discussion list
> Sent:         Thursday, December 11, 1997 2:37 PM
> To:   PICLISTMITVMA.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
>
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

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
shb7cornell.edu
Phone(USA): (607) 253-0315
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}

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...