J.P. Brown wrote: > Thanks for that Andy, yes I tried compiling with some different maths > functions, the log(x) function uses 599 words and the sqrt(x) function > uses 573 words, I will have to think of something else, If I use any maths > functions using the 16F84 I won't have much room left for my program!. This is way too much even for floating point! I know for sure sqrt(x) takes 87 instructions for 24 bit float using PIC16 instruction set. You can easily include that in assembly as a C function, only conversion between Microchip and IEEE floating point representation would be required (it's just three instructions either way). The routine (and conversion) is at www.piclist.com BTW, it was debugged recently. And log(x) might take around 200 instructions if implemented using the CORDIC method. If you can tolerate ~0.05% error it can be even smaller and faster with a 16 entries table. For example, take a look at "[PIC]: [MATH] x^y routine implementation" thread in September. Good luck, Nikolai -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads