Dear Graham North, Ever heard of http://www.piclist.com/ ? To get code to divide by 10, I would go to http://www.piclist.com/techref/piclist/codegen/index.htm and type in "0.1" and check the "round" button. Notice how much bigger and slower this code is than dividing by 8 (multiplying by 0.125) or 16. Elsewhere on piclist.com you should find 24 bit addition code ... Graham North on 2001-04-29 09:23:19 AM Please respond to pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: (bcc: David Cary/TULSA/BRUNSWICKOUTDOOR) Subject: [PIC]: Averaging 16 bit values. Code? Hi, Have any emails got through from me about this already? I have not seen them! Anyway, can someone help me with the code to add multiple 16 bit numbers to a 24 bit running total? I'm a bit stumped here. I understand the basics, but I'm not sure what to do with rollovers etc. Does anyone know of any sources of code? Thanks Graham _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu