Hi guys,
I have a problem with the combination Jallib ADC library and 18F1840.
I'm using only adc_read_high_res() and see the results 'jumping'
between low and a high values while the input signal is steady. For
example I see a series of results with values 85 and 5440 and similar
pairs of values. It appears that 5440 == 64 * 85. By looking closer I
see also other result pairs with this property, like 602 <-> 38528.
Since this is a 10-bits ADC module it looks like the high result is the
left-aligned value of the low result. To verify this I read the
ADCON1_ADFM bit immediately after an ADC read I see always '1' with a
low result and '0' with a high result. This proves my suspicion.
When looking in the asm output of my program I see the ADFM bit only set
and nowhere cleared (or ADCON1 cleared as a whole except by enable
digital_io).
There is no ADC entry in the errata of this PIC.
I've quite a few other programs using the ADC library with other PICs
but never observed this behaviour. What could be the reason?
Suggestions welcome!
Reards, Rob.
--
*Rob H*amerling - https://www.robh.nl
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.