On Tue, Dec 04, 2001 at 06:10:14PM -0800, jinhong kim wrote: > Hi all. > I am wondering If I could assign a floating point > number with using PIC16F876. Sure you can. But it'll be a lot of work. > Actually, I wanna set PI control constant Ki=0.1 Is > this possible? You may want to think about fixed point. You can create a fixed point number simply by taking the original number and multiplying it by the range that you wish to represent it. For example if you wanted to represent .1 in 16 bits, take .1 and multiply it by 65536 giving 6553.6. Round to 6554. Store this in 16 bits and use a 16 bit multiply followed by a 16 bit right shift (which means simply leave off the lower 16 bits). Here an example. Say we wanted to multiply 20 by our .1. So multiply 20 by 6554 giving 131080. Then shift 16 bits, which effectively divides by 65536. The result of 2.0001220703 is close enough for govt. work Hope this helps. BAJ -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.