Analog value too high

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
henker
Posts: 45
Joined: Mon Dec 22, 2008 11:22 pm
Location: Prospect, NS, Canada
Has thanked: 7 times
Been thanked: 2 times
Contact:

Analog value too high

Post by henker »

For years I have been using the PIC 18F4685 for our equipment. Never had any issues however recently I had to use a PIC 18F4682 as the 5 was not available.
Everything seemed to be working normal until I realized that all the Analog values are a bit too high.
When applying a clean 2.5V on the an analog input, I ready a value of 522 / 523.
When I change the uP to a 4685 on the same PCB, it does ready the correct value of 512...
I have checked the data sheet but can't find any difference between the 2 uP's other then the memory size...
I'm using the VDD as the ref which is exactly 5V.
Not sure if this is a FC issue or a hardware problem...
Thanks
Henk

chipfryer27
Valued Contributor
Valued Contributor
Posts: 666
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

Re: Analog value too high

Post by chipfryer27 »

Hi

I might have one of those chips kicking around. If so I'll try with FCv5 and v10. Won't be until the weekend though due to travel.

Regards

chipfryer27
Valued Contributor
Valued Contributor
Posts: 666
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

Re: Analog value too high

Post by chipfryer27 »

Hi

Sorry, I don't have one. It was a 4680 so of no use.

Is the difference consistent over range (e.g. 5v / 2.5v / 0v etc) and does using Vref pins make any difference?

Regards

henker
Posts: 45
Joined: Mon Dec 22, 2008 11:22 pm
Location: Prospect, NS, Canada
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Analog value too high

Post by henker »

Yes it is consistent.
With 0V the raw value is 6. With exactly 2.5V is it 519 / 520.
It never goes over 1023

Henk

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Analog value too high

Post by Steve »

I have just compared the Flowcode v5 chip definition files for the 18F4682 and 18F4685 and there are no differences that will affect the generated code that handles analogue inputs. So I don't think this is a Flowcode issue.

There is a silicon errata note for that family (see here) which mentions an issue with the ADC module, but it doesn't seem to be the cause of your problem either.

I would suspect a hardware issue. It could even be you have obtained a fake chip. It is rare, but we have seen this happen before.

Post Reply