> ----------
> From: Sean Breheny[SMTP:
.....shb7KILLspam.....CORNELL.EDU]
> Reply To: pic microcontroller discussion list
> Sent: Thursday, December 11, 1997 4:02 PM
> To:
EraseMEPICLISTspam_OUTTakeThisOuTMITVMA.MIT.EDU
> Subject: Re: logarithmic calc
>
> 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
>
shb7spam_OUTcornell.edu
> Phone(USA): (607) 253-0315
>