Page 1 of 1

AD on AN3 and AN4 not working PIC18F87J50

Posted: Sun Nov 24, 2019 4:10 pm
by faveremario
Hi all
I'm working on a home domotic system and as a part of this project, I'm measuring 5 analog values. Doing this with a voltage divider & a stabilizing capacitor on the ANx-input. Quit forward.

For testing purposes I attached 5x 1k-thermistors and used the thermistor component in FC8. Reading every input as real temperature & sending it over USB-port to the PC where I display the values in a terminal window.
All works fine, but readings on AN3 & 4 are not correct. AN4 is connected to a 1k-thermistor on the PCB (monitoring the temperature inside the case - just in case :wink: ).

I measured the voltage across the input pin and it's OK, so it has to be a software failure.
So I updated FC8 & used the AD-component in stead of the termistor-sensor, but without success.

Did anyone had the same issues ?


Capture.png = part of the schematic & terminal readings.
FC-program : reading T & sending over USB-serial. I'm using a bootloader.

Re: AD on AN3 and AN4 not working PIC18F87J50

Posted: Mon Nov 25, 2019 11:17 am
by LeighM
Could you please try the attached, to go into
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC
Thanks

Re: AD on AN3 and AN4 not working PIC18F87J50

Posted: Mon Nov 25, 2019 12:02 pm
by Benj
Also available now via the v8 update system. :D

Re: AD on AN3 and AN4 not working PIC18F87J50

Posted: Mon Nov 25, 2019 12:18 pm
by faveremario
Hi Leigh
Thanks for the quick reply!

Sure something has changed. All temperature-readings show 125° so I guess the ADC reads 1024 for all channels.

Re: AD on AN3 and AN4 not working PIC18F87J50

Posted: Mon Nov 25, 2019 12:29 pm
by faveremario
I looked @the file you send me (thank you for that btw)

On line 3311, I see :
ANCON0 = ~0x01;
shouldn't is be
ANCON0 &= 0xFE;
to set PCFG0 to 0 ?
?

The image joined, shows the result. I try this out for the other channels & get back as soon as I can.
Thanks for the support.

Re: AD on AN3 and AN4 not working PIC18F87J50

Posted: Mon Nov 25, 2019 12:57 pm
by faveremario
With this file it works as a dream :) - I modified the channel-selector as described above.

@Ben, could you place this file for the FC8-update please ?

Thanks all !

Re: AD on AN3 and AN4 not working PIC18F87J50

Posted: Mon Nov 25, 2019 3:58 pm
by LeighM
Thanks for the contribution, I have pushed this into our repo, Ben will process this into the auto update system in due course