PIC18f26k80 Analog

Moderator: Benj

Post Reply
alanwms
Posts: 67
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

PIC18f26k80 Analog

Post 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.52 KiB) Viewed 12735 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC18f26k80 Analog

Post by Benj »

Hello,

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

alanwms
Posts: 67
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

Re: PIC18f26k80 Analog

Post by alanwms »

Gauge Array Test.fcf
(19.98 KiB) Downloaded 555 times
FLOWCODE 5

alanwms
Posts: 67
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

Re: PIC18f26k80 Analog

Post by alanwms »

Not sure how this forum works - Is anyone looking at the detail I sent for review?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC18f26k80 Analog

Post 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.

alanwms
Posts: 67
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

Re: PIC18f26k80 Analog

Post 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?

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: PIC18f26k80 Analog

Post by LeighM »

Hi
Could you try changing the Conversion Speed and Acquisition time (in the ADC component Ext Properties)?

alanwms
Posts: 67
Joined: Tue Sep 16, 2008 2:09 pm
Location: Minnesota USA
Has thanked: 4 times
Been thanked: 17 times
Contact:

Re: PIC18f26k80 Analog

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC18f26k80 Analog

Post 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.

Post Reply