'PIC] Reading AN5 but getting AN2'
> For some reason I read AN5 I get the value on AN2.
> As it turns out I was setting the GO and ADON bits at
> the same time. Don't do that!
Just flicking through AN546
to check something and saw, page 4
a) Do not set bits GO/DONE and ADON in the
same instruction. First, turn the A/D is on by setting
bit ADON. Then allow at least 5us before
conversion begins (setting the GO/DONE bit),
longer if sampling time requirement is not met
b) Aborting a conversion: A conversion can be
aborted by clearing bit GO/DONE. The A/D
converter will stop conversion and revert back to
c) Using the ADRES register as a normal register:
The A/D only writes to the ADRES register at the
end of a conversion. Therefore, it is possible to
use the ADRES register as a normal file register
between conversions and when A/D is off
More... (looser matching)
- Last day of these posts
- In 2008
, 2009 only
- New search...