Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

A to D conversion on a PIC 18F14K50

Status
Not open for further replies.

tjnic

Newbie level 2
Joined
Jan 18, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
UK
Activity points
1,303
Hi,

I am trying to use the PIC 18F14K50 to read a barometric pressure from a pressure sensor chip.

The chip in question has an analogue output range of 0.5 volts to 4.5 volts but I am only interested in pressures that will produce an output voltage between 1.7 and 4.0 volts so I thought I would use the VRef- and VRef+ on the PIC to limit the conversion range to those values thus allowing me to sample the voltage a little more accurately.

In order to generate suitable reference voltages I used a couple of potential dividers. (ratios 680/330 and 180/820)

The problem I am having is that when I connect the VRef+ pin to the centre of divider the voltage drops from 4.5 volts to about 2.4 volts (as measured on a DVM)

Can someone tell me what would cause this to happen?

I am sure I have set up the PIC registers correctly.

I have set bits 0 and 1 of TRISC to 1 to disable the digital output
I have set bits 4 and 5 of ANSEL to 1 to enable analogue input
I have set the lower 4 bits of ADCON1 to 0101 to use Vref+ and Vref-

I have also set up AN10 to read the input voltage. (This works fine if I use VDD and VSS for the voltage reference.)

Can anyone give me any pointers as to why The VRef+ pin is pulling down the voltage? - I have tried dividers with a total resistance of 10K and 1M and the same thing happens.

I am guessing that it is a loading or impedance problem, but I am not sure why or how to get around it.

Thanks


Tim
 

Okay,

Prehaps I need to break this problem down.

Can someone tell me if there is any reason why I should not use a voltage divider to provide VRef+ and VRef- for the A/D on the PIC18F14K50. My circut looks like this.




Code:
------------------------------------------------ +5V (VDD)
         |                             |
         X                             X
         X 1K8                         X 6K8 
         X                             X 
         |                             |
         ----- VRef+                   ----- VRef-
         |                             |
         X                             X
         X 8K2                         X 3K3
         X                             X
         |                             |
-------------------------------------------------0V (VSS)

Is this a valid approach?
 

I've never used this device but having looked at the data sheet, it looks like you are doing everything right.

The current through the internal voltage divider chain is quite small in comparison with your external resistor values so that shouldn't cause any problems either.

The symptoms suggest the pins are still in digital mode or set to be outputs for some reason, can you try reading back the TRIS and ADC registers to confirm they have accepted the values you set them to.

Brian.
 

Hi,
you can apply 2 (OpAmp) voltage buffers for both references, as separations, to checkout your PICs input/load problematics...
K.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top