David, sorry I am not familiar with your method at all. I know what LUT is but=20 I do not know how you did it? can you give brief explanation? thanks Andre=20 ________________________________ From: David VanHorn To: Microcontroller discussion list - Public. Sent: Mon, February 14, 2011 10:37:01 AM Subject: Re: [PIC] RPM measurement question Depending on the accuracy you need, and the code space available, lookup tables can be your friend. Do the hard math externally, and just look up the answer. I used LUTs when taking Shannon's entropy for 10 different analog and digital sensors in a security sensor application. MUCH faster than computing it all from scratch. Also, scale your variables. Normally Shannon's entropy is expressed as 0-1 in floating point, but expressing it as 0-255 in integer was plenty good enough for my application, and much faster. Do you NEED to know 1999 vs 20000 rpm? --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .