Thanks SN96, but I’ve tried using p16 too and that doesn’t change anything.
(I know the example doesn’t do anything with the value put into volts, it just proved that it doesn’t get past adin)
I should also add that I’ve tried this on 3 new sets of botboards/basicatoms, so I hope it isn’t a hardware problem…
Another thing I tried was not using the adin command and manually setting the registers according to the PIC16F87x manual (page number 113 or page 115 in the pdf) but it never ‘completes’ the a/d conversion:
;Configure the A/D module
ADCON0 = %00000001 ;fastest clock, channel 0, conversion not started, a/d turned on
ADCON1 = %10000000 ;right justified with all the pins set to analog input
;Configure A/D interupt
PIR1 = PIR1 & %10111111 ;clear ADIF
PIE1 = PIE1 | %01000000 ;set ADIE
INTCON = INTCON | %11000000 ;Set PEIE and GIE
;Wait the required acquisition time
pause 800 ;I think this enough time to wait
;Start conversion
ADCON0 = ADCON0 | %00000100;set the go/'not done' bit
;Wait for A/D conversion to complete
while ADCON0.bit2 ;repeats this loop forever
wend
;Read A/D result register pair
serout S_OUT, I8N1_9600, "high : ",hex ADRESH, 13,"low : ", hex ADRESL, 13]
;check the register status
serout S_OUT, I8N1_9600, "ADCON0 : ",sbin ADCON0, 13]
serout S_OUT, I8N1_9600, "ADCON1 : ",sbin ADCON1, 13]
serout S_OUT, I8N1_9600, "PIR1 : ",sbin PIR1, 13]
serout S_OUT, I8N1_9600, "PIE : ",sbin PIE1, 13]
serout S_OUT, I8N1_9600, "INTCON : ",sbin INTCON, 13]
end