Ioannis,

Try this modification to the averaging routine for the CSM.
http://www.picbasic.co.uk/forum/show...598#post107598