I searched the form for logarithm and found this,
http://www.picbasic.co.uk/forum/show...ight=Logarithm
I searched the form for logarithm and found this,
http://www.picbasic.co.uk/forum/show...ight=Logarithm
Dave
Always wear safety glasses while programming.
Build a table containing log values derived from a HLL running on a PC. Embed this table into your program. You could use maybe 10, maybe 50 points in the table and interpolate between them to get a log reading. This method is not precise but workable since I assume you only need to visualise the log reading on a display. For precise log values, you have to do it the hard way.
Jerson
Hi, Savnik
Jerson is right ... the simplest Pic way is to build a retrieving table.
IN PbP that's called LOOKDOWN2 ... ( catches the closest values, sup and inf ... just think to use a clever index !!! )
Then just have to add a linear approx. between table values ...
Buuuuuut, My old brain tells me it is very easy to do it with 3or4 couples of linearising resistors and diodes ...
or to use a logarithmic AOP !!!
Last and simplest solution: The App Notes of ICL 7106 or 7136 show a logarithmic scale design ...
Which is closest to your requirements ??? ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I have make a table.
I want to measure the volts at the input of pic , and show on LCD the power
Code:POWER VOLT POWER VOLT 1 7,1 26 36,1 2 10,0 27 36,7 3 12,2 28 37,4 4 14,1 29 38,1 5 15,8 30 38,7 6 17,3 31 39,4 7 18,7 32 40,0 8 20,0 33 40,6 9 21,2 34 41,6 10 22,4 35 41,8 11 23,5 36 42,4 12 24,5 37 43,0 13 25,5 38 43,6 14 26,5 39 44,2 15 27,4 40 44,7 16 28,3 41 45,3 17 29,2 42 45,8 18 30,0 43 46,4 19 30,8 44 46,9 20 31,6 45 47,4 21 32,4 46 48,0 22 33,2 47 48,5 23 33,9 48 49,0 24 34,6 49 49,5 25 35,4 50 50,0
May I suppose the number in the "Power" column has to be displayed ... or is it just your Index ???
In this case ... It would be much easier to use if the "Volts" were integers numbers and "Power" decimals ... I know: some more work for you !!!
Alain
See Also Here : http://curveexpert.webhop.net/
That Helps ... isn't it ???
Quadratic Fit: y=a+bx+cx^2 ( y: Power ; x :Voltage )
Coefficient Data:
a = 0.00076569488
b = -8.0880958e-005
c = 0.019999816
Last edited by Acetronics2; - 28th March 2007 at 14:05.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks