Hi Rob,
a *very* good point.
The physical magic behind that "measurement" is indeed the fact, that you take
a sample right *within* the acquisition time.
And, as the line
-- adc_conversion_delay = adc_conversion_delay / 10
in adc.jal is commented out, I presume the delay is not 10us and not the
recommended approx. 20us, but like 210us. No chance with a 30pf CVD to measure
anything after such a long wait.
You have to address the ADC module yourself then, for in fact it is an error
you're measuring. The library is meant to not measure errors.
But, when you can't use the library in the first place, I'd highly recommend
reading chaper 19 of the 18f45k22 datasheet. It explains the periperal which is
meant to measure capacitors.
Sorry for not checking the library... I only had the hardware in mind ;-)
GreetsKiste
Am Dienstag, 4. Februar 2020, 19:08:13 MEZ hat RobJ <[email protected]>
Folgendes geschrieben:
Hi Gilles,
I am not sure but if you check the adc library you see this code: ADCON0_ADON
= TRUE -- turn on ADC module
delay_10us(adc_conversion_delay) -- wait acquisition time
ADCON0_GO = TRUE -- start conversion
while ADCON0_GO == TRUE loop -- wait until conversion
completed
So when you start reading the ADC there is first a delay of 10us of acquisition
time and I wonder if this delay influences your measurement.
Kind regards,
Rob
On Tuesday, February 4, 2020 at 8:53:08 AM UTC+1, Gilles BARTHELEMY wrote:
I received my brand new 18F45K22, and tested with it... with exactly same
result. I invariably get:
A0 alone (tied to nothing) = 841A0 tied to ground = 0A0 tied to VCC = 1023A0
tied to B7 (i.e OUT_PIN) = 1015
Also, I commented the line "enable_digital_io()" => same measurement.
I can't see any difference in the way it's done with Arduino, and my code...
Obviously, I miss something, but where ? Hardware maybe ? Or am I simply blind
? ;-)
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/18728482-9fd4-42cb-8b6e-f5c7fa55437b%40googlegroups.com.
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/1306732347.447101.1580846551659%40mail.yahoo.com.