piclist 2008\07\06\223744a >
Thread: Reading AN5 but getting AN2
face picon face BY : Jinx email (remove spam text)

> 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

Additional tips:

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
within 5us

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
sampling state

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

<037c01c8dfda$4c8be400$89aafea9@ivp1> 7bit

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Reading AN5 but getting AN2

month overview.

new search...