At 09:44 PM 5/25/2005 -0400, you wrote: >What is the point in ADC if you can't use floating point? The 16F88 >has ADC but even Microchip's C compiler will not work for it. I don't >see how ADC can be usful without a multiply and divide instrution to >calcuate the actual voltage value from the 10 bit representation. You don't need FP for that (if you indeed need to do that). Fractional fixed point math is sufficient. Suppose you have the number 1023 and you want that to read 5.15V (because you're using Vdd for the reference and it's not exactly 5.00V). Let's further say that you will represent 5.15V as 515. So you want to multiply by 515/1023 = 0.5034213098729227761485826001955. If you use 32 bit fixed-point math, you could multiply by 0x40701C07 and retain the most significant 33 bits of the 64-bit result. If you use 16 bit fixed point math you could use 0x4070 and keep the ms 17 bits of the 32-bit result. Eg. 0x3FF * 0x4070 = 0x1017F90, keep ms 17 bits, round up to 0x203) which is 515. The dsPIC has a 17 x 17 bit hardware multiplier that will do something like this extremely fast, but it's easy enough to do in software on any MCU. >I guess I'm hoping there is something that makes floating point easier >for the 16 series. It sure would be nice to have a convienent way to >represent a floating point number. I guess I got spoiled on C where >you can put the floating point values in your code without manually >converting to binary. You can get yourself a utility program that converts floating point binary values to human-readable form. Also, the watch window in MPLAB can interpret certain types of standard floats. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com ->> Inexpensive test equipment & parts http://search.ebay.com/_W0QQsassZspeff -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist