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
Analog value too high
Moderator: Benj
-
- Valued Contributor
- Posts: 687
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 185 times
- Been thanked: 204 times
- Contact:
Re: Analog value too high
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
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
-
- Valued Contributor
- Posts: 687
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 185 times
- Been thanked: 204 times
- Contact:
Re: Analog value too high
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
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
-
- 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
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
With 0V the raw value is 6. With exactly 2.5V is it 519 / 520.
It never goes over 1023
Henk
- Steve
- Matrix Staff
- Posts: 3424
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: Analog value too high
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.
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.