Simple ADC Interfacing

Status
Not open for further replies.

Viann

New Member
PIC I will be using is the PIC16F877A.

My question is, how do I manually manipulate the ADC input values using resistors? If not resistors, is there an alternative method?

My ADC is set to VDD as VREF+ and VSS as VREF-
The port I want to manipulate is Pin-3, which is RA0/AN0.

I have tried connecting resistors directly from AN0 to VDD, but it keeps giving out the 5V reading. Shouldn't there be some voltage drop across the resistor and the reading should be at a lower Voltage value?
 

hi again Viann.

To get a reduced voltage you require two resistors to form a potential divider.

For example, two 4.7K resistors in series between +5V and 0v will give +2.5V at the junction of the two resistors.

Is this what you mean.?
 
Here you a little drawing to go by I like this way because i can set it how I want it to read
 

Attachments

  • adc.PNG
    5.3 KB · Views: 189
I think the following merits some explanation.
I have tried connecting resistors directly from AN0 to VDD, but it keeps giving out the 5V reading. Shouldn't there be some voltage drop across the resistor and the reading should be at a lower Voltage value?

AN0 is an analog input. It tests to see what the voltage is at the pin but draws an insignificant amount of current. No current flows in a resistor between Vdd and AN0.

What is often misunderstood is that a resistor with no current flowing through it will have the same voltage on both ends.

Why is there no voltage drop ?

The voltage drop across a resistor is
V=IR
If the current I is zero the voltage drop for the resistor will also be zero.

3v0

Feel free to untangle the little lies that exist in the above. As a digital guy I tend to simplify the analog.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…