RGBrainbow
New Member
Hi folks,
what i have done:
try to read out two A/Ds of the PIC12F675, both A/Ds with a different setup (one left justified, one right justified)
the data sheet says on page 42: 'Note: The GO/_DONE bit should not be set in the same instruction that turns on the A/D.'
so my code was like this:
for A/D2:
for A/D3:
the result had nothing to to with the position of the pots connected to the A/Ds.
After placing the 'bsf adcon0, go__done_bit ;start conversion' far away (~5ms) from the A/D setup it worked well.
my question:
What is the minimum wait time between setting up an A/D and starting the conversion?
(the 5ms above are because it fits nice in the rest of the code).
And is it the same with other PICs?
regards
joachim
what i have done:
try to read out two A/Ds of the PIC12F675, both A/Ds with a different setup (one left justified, one right justified)
the data sheet says on page 42: 'Note: The GO/_DONE bit should not be set in the same instruction that turns on the A/D.'
so my code was like this:
for A/D2:
Code:
clrf adcon0 ;reset A/Ds
movlw b'10001001' ;A/D2,right justified, on
movwf adcon0
bsf adcon0, go__done_bit ;start conversion
Code:
clrf adcon0 ;reset A/Ds
movlw b'00001101' ;A/D3,left justified, on
movwf adcon0
bsf adcon0, go__done_bit ;start conversion
the result had nothing to to with the position of the pots connected to the A/Ds.
After placing the 'bsf adcon0, go__done_bit ;start conversion' far away (~5ms) from the A/D setup it worked well.
my question:
What is the minimum wait time between setting up an A/D and starting the conversion?
(the 5ms above are because it fits nice in the rest of the code).
And is it the same with other PICs?
regards
joachim