Date: Sun, 30 Mar 1997 16:04:37 -0800 From: Don McClaren Subject: Floating point on the PIC > The lack of decent floating point support seems to be a major > shortcoming with the PIC programming tools. Last year I posted a > query on this listserver, which resulted in an email reply from > Microchip. (My answer is reprinted below, although they weren't able >t o help me at the time). > > I expect that the PIC is (or could be) often used to control an LCD > with a readout of acquired analog measurements. The raw values read > would be translated into user units by some algorithm(s) involving at > least the 4 basic math functions and possible some transcendental > functions as well, such as log, sine, square root, etc. > > App note AN575 seems to cover the basic math functions (although I've > seen at least one posting questioning their accuracy, and I noticed a > problem with an early version of the library with multiplication in > certain numeric ranges). However at the moment there seems to be no > support for the transcendental functions. Don As someone who have also gone through these same headaches before... let me give you a small word of advice. Forget about using Pics for this application. Its not worth the effort you will have to put into it to get it working. Rather use the Atmel 89C2051 microcontroller with a C compiler like Keil or Archimedes. That gives you decent floating point capability and sprintf statements etc. And they are not that much slower or more expensive than PIC microcontrollers. > I have an older version of the CCS C compiler which I like using > (except for this problem) -- does anyone know if their latest > version supports the FLOAT data type and math.h? Also I read here > that the Avocet C compiler supports f/p; anyone have any experience > with that? I recently upgraded to the more recent Windows version of the CCS compiler which integrates the older PCB and PCM compilers. I found there is not much difference between this and the older DOS version, and it definetely does not yet support floating point artithmetic. I also read about the Avocet compiler and its ability to support FPA, and quickly dowloaded the beta version. However, to my dissapointment they had no examples showing the use of FPA and I also could not see any reference to it in the accomponied documentation. Maybe I just overlooked something, but I certainly did not see it.... Any comments? Rgds Werner