Page 1 of 1

PIC18f26k80 Analog

Posted: Tue Jan 19, 2016 4:15 am
by alanwms
I have the 18f26k80 connected and running a serial display. I'm reading AN0 on pin 2 of the chip. My meter reads from 0 to 5 volts. The display show 4095 (full bore) and does not change. This pic chip has configuration bits for differential analog inputs, and I suspect that these bits are not set properly. My input is referenced to ground.
Can you set me straight on the config bits or give me some hints? Here are a few jpegs for reference:
flowcode.jpg
flowcode.jpg (178.53 KiB) Viewed 6553 times

Re: PIC18f26k80 Analog

Posted: Tue Jan 19, 2016 11:47 am
by Benj
Hello,

Please can you post your program so we can look at your config bits?

Re: PIC18f26k80 Analog

Posted: Tue Jan 19, 2016 3:45 pm
by alanwms
Gauge Array Test.fcf
(19.98 KiB) Downloaded 326 times


FLOWCODE 5

Re: PIC18f26k80 Analog

Posted: Thu Jan 28, 2016 4:34 pm
by alanwms
Not sure how this forum works - Is anyone looking at the detail I sent for review?

Re: PIC18f26k80 Analog

Posted: Mon Feb 01, 2016 4:47 pm
by Benj
Hello Alan,

Sorry I saw your reply but then got distracted onto other things.

From your config settings I would advise the following.

Extended Instruction Set - Disable

Everything else looks ok.

Let us know how your getting on, it could be there is a bug in the ADC CAL for that chip which has been fixed in v6 buts needs rolling back to v5.

Re: PIC18f26k80 Analog

Posted: Fri Feb 05, 2016 6:47 pm
by alanwms
I had set the extended instruction set to enable in an effort to resolve the analog issue. What I'm saying is that the problem persists either/or extended instruction set enabled or disabled.

Any time line on having this resolved?

Re: PIC18f26k80 Analog

Posted: Tue Feb 09, 2016 11:46 am
by LeighM
Hi
Could you try changing the Conversion Speed and Acquisition time (in the ADC component Ext Properties)?

Re: PIC18f26k80 Analog

Posted: Tue Feb 09, 2016 3:50 pm
by alanwms
I made a few changes and empirically ended up with Fosc/4 and 6 cycles acquisition time. Certainly got my analog acting more realistic.
If you wouldn't mind detailing me about the values - Is it more beneficial to be slower?

Thanks much - I can take it from here. :D

Re: PIC18f26k80 Analog

Posted: Tue Feb 09, 2016 6:22 pm
by Benj
Hello,

Acquisition time specifies how long to change up the ADC conversion capacitor, the longer the cap has to charge the closer it will be to a stable DC signal. However if too long then you will start to miss things such as spikes in the signal.

The Conversion speed specifies how fast to do the conversion from the voltage on the ADC capacitor to the digital representation. The faster you do the conversion the less accurate it will be and the more noise will creep in.

So speed vs accuracy is a fairly open ended discussion and in most cases needs to be tailored to the specifics you require to get the best result.