Schematic and the WHOLE code would help.

and this one...
Code:
CURRENT1 = CURRENT1 - CURRENT1 >> 6
not sure how it will be processed...
Code:
CURRENT1 = CURRENT1 - (CURRENT1 >> 6)
could be better.

What's the initial value of CURRENT1?

Darrel did some nice average routine, maybe you want to have a look at it?
http://www.pbpgroup.com/modules/wfse...hp?articleid=7