
Originally Posted by
glenlivet
When you do a conversion the upper 6 most significant bits will be zero's by default.
Not if the ADC result format is left-justified, in which case the 6 least significant bits would be 0; you will get a 16 bit number with 10 bit accuracy.
The following code works perfectly in ISIS:
Code:
Device = 18F2420
Dim result As Word
ADCON2.7 = 1
result = ADIn 1
Cls
Print Dec result, $FE, $C0, Bin16 result
The following code gives problems like you describe:
Code:
Device = 18F2420
Dim result As Word
result = ADIn 1
Cls
Print Dec result, $FE, $C0, Bin16 result
Are you sure you have right justified the data?