Hi all
ive been playing with ADC and ive used a potential divider (2 10k resistors in series) connected to AN0 of my chip Pic 16f1825, potential divider is connected to the circuits 5v supply, as i expected the display shows 2.5v, but if i alter the circuits 5v supply the lcd stays steady at 2.50v, however if i connect a potentiometer to the analogue input the reading goes from 0v to 5v just as in simulation, i thought by altering the voltage supply this would have affected the reading on the divider but it doesnt, what am i missing, is it a case of re-writing the calculation using the resistor values,
regards bob
ADC ISSUES
Moderator: Benj
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 24 times
- Contact:
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: ADC ISSUES
By changing the supply voltage you change the reference voltage used by the pic and the voltage over the divider. Both drop by the same percentage. You need a stable reference voltage to be able to see any change.
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 24 times
- Contact:
Re: ADC ISSUES
Hi kersing
Thanks for the reply, i just tried using the internal reference voltage and set the FVRCON as well as changing the pots property to FVR rather than VDD but no joy ive either set it wrong or this is not suitable ??
Bob
Thanks for the reply, i just tried using the internal reference voltage and set the FVRCON as well as changing the pots property to FVR rather than VDD but no joy ive either set it wrong or this is not suitable ??
Bob
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: ADC ISSUES
Check viewtopic.php?f=7&t=22569&p=104899&hilit=1.024#p104899 as an example on how to do this. You need to make sure your controller has a real stable reference voltage and not something that depends on voltage powering it. Should be easy recognizable by the voltage limits listed in datasheet (like the Vd >= 2.5V in the example).
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 24 times
- Contact:
Re: ADC ISSUES
hi all
ive set up the FVRCON register as well as ADCON1 to try and get this working, ive trolled through the data sheet to try to get this right but no joy, can anyone point me in the right direction on how to set the FVR function up correctly please
bob
ive set up the FVRCON register as well as ADCON1 to try and get this working, ive trolled through the data sheet to try to get this right but no joy, can anyone point me in the right direction on how to set the FVR function up correctly please
bob
- Attachments
-
- BATTERY GAUGE.fcfx
- (10.9 KiB) Downloaded 173 times