You didn't tell what PIC you use. It can make big difference...
For example PIC18F87K22 have differential inputs, and negative results are two’s complement of result. So for -1 = $FFFF, -2 = $FFFE etc.
You can use SDEC to get correct result.
Or you can use this:
Code:
ADCIN 17,value1 'I'm not sure how ADCIN in handles negative numbers... So maybe manual reading of ADRES registers are better solution
IF value1.1 = 1 THEN
Sign="-"
ELSE
Sign=" "
ENDIF
value1=ABS(value1)
HSEROUT2 ["value1 = ",Sign, dec4 value1,13,10]
Bookmarks