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:
PIC18f26k80 Analog
Moderator: Benj
- 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
Hello,
Please can you post your program so we can look at your config bits?
Please can you post your program so we can look at your config bits?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
Not sure how this forum works - Is anyone looking at the detail I sent for review?
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
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?
Any time line on having this resolved?
-
- 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
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.
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.
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel