Hello everyone! Im doing my final project about intelligent traffic system with fuzzy logic that need to build into PIC16F877. But I face a problem that is there are no multiply, divide, square and square root instruction with MPlab. Another problem is I need to do the math in floating point. How can I solve it? Any advices and suggestions do u all can give me?
Thanks for spending your time.
Most small MCUs do not have an FPU unit due to various constraints. If you are using C there is probably a FP library available. Not very efficient though, it will cost speed and memory.
Check out Application note AN576 (I think) from Microchip. It gives details on implementing IEEE-754 compliant floating point routines. (If it's not AN576, try AN575. The Microchip website is down right now, so I could not check).
yes, 16F877 can do floating point and I think most of mcu's. the problem will be the speed. MPLab not a good choice when programming floating point algorithms.
if u are using an assembler u have to implement floating point algoritham urself, or else if u use any c compiler ther will be build in libraries that take care of floating point operations. flaoting point operations require more instructions to execute. mostly the micro clock determines how fast floating point operations takes place and jence if ur clock freq. is too small then micro an't complete it.