Hi, Ruijc

I just re-wrote your code ... works fine ( I'm only talking of the PIC point of view - do not talk about precision ...)

Try to write carefully ( and readably) ALL your config sequence ( I know ... ~ 50 lines ! )... and it will work !!!

Just a tip:

instead of :

" temp = (va1*/500)>> 2 "

try :

" temp = val*125
temp = temp.highbyte "

Alain