Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

PIC 10bit ADC linearity problem

Status
Not open for further replies.

Sobakava

Full Member level 6
Joined
Mar 27, 2002
Messages
350
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
3,346
I connected the output of Texs.Inst. Instrumentation
Amplifier output to PIC18F452's ADC input.
My instrumentation amplifier has good linearity.
I measure input signal (differential from a bridge sensor)
and I measure output signal. It's pretty good with
analog multiply factor 23.
But ADC does not measure signal correctly.

Input signal varies from 500mV to 4V. But I
divide input signal in mV to ADC value, it is
not linear. For instance:

Input(mV) , ADC Value , Ratio
560 129 4.341
720 161 4.47
800 178 4.494
980 216 4.53
1110 241 4.609
1130 284 3.97
1168 364 3.208

PIC clocked with 20MHz oscillator and ADC is
clocked with Clock div 32 option. I also tried
clock div 64 and internal RC....

I think it may be about impedance matching.

??? What do you think ???
 

flatulent

Advanced Member level 5
Joined
Jul 19, 2002
Messages
4,629
Helped
489
Reputation
980
Reaction score
150
Trophy points
1,343
Location
Middle Earth
Activity points
46,689
measurement

Did you measure the amplifier output when it was attached to the PIC input? These measurements will give you a clue. Another thing to try is look at the signal path at each point with an oscilloscope to see if something is oscillating.
 

Sobakava

Full Member level 6
Joined
Mar 27, 2002
Messages
350
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
3,346
PIC adc linearity

I made the measurements while PIC is connected.
I connect probes between GND and PIC ADC input and
see ADC value at LCD screen and voltage at
voltmeter's screen.
 

flatulent

Advanced Member level 5
Joined
Jul 19, 2002
Messages
4,629
Helped
489
Reputation
980
Reaction score
150
Trophy points
1,343
Location
Middle Earth
Activity points
46,689
binary - bcd

Your problem may be in your binary to BCD conversion code. Try putting a lab supply to the input of the ADC. Slowly vary the voltage and see if the LCD display numbers are monotonic or if they make big jumps up or down.
 

Sobakava

Full Member level 6
Joined
Mar 27, 2002
Messages
350
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
3,346
PIC ADC Linearity

I tried this at first with a potentiometer. PIC measures
voltage on pot. correctly. My problem is with Instrumentation
amplifier...

Probably it's output impedance does not match with
ADC's requirements.

Opinions?
 

KamW

Advanced Member level 4
Joined
Jul 16, 2001
Messages
113
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
1,130
What kind of Instr. amplifier are you using - Often problem is with impedance connected to amplifier Ref pin, it could decrease amplifier parameters. How about bias current return path? or maybe you have problem with input common voltage range?
Another idea - is PIC response stable on LCD? maybe your problem is with noise High impedance input could be very noisy.- every multimeter integrate signal, but PIC do not.
In some circuits connecting scope probe to the circuits could very change signal (input impedance), so maybe your PIC measure OK, but meter do not? I always prepeare circuits simulating input with known conditions and then you could check circuit point by point.

regards
KamW
 

Sobakava

Full Member level 6
Joined
Mar 27, 2002
Messages
350
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
3,346
PIC ADC Linearity

I use Burr Brown INA129 instrumentation amplifier.
You are right, I've to check circuit with an RC integrator first.

Amplifier is fed from +-12V power supply. Coupling
capacitors exists for each supply. Ref pin of amplifier
is connected to GND with a very short trace.
 

koky

Full Member level 2
Joined
May 12, 2001
Messages
145
Helped
11
Reputation
22
Reaction score
8
Trophy points
1,298
Location
Italy
Activity points
1,097
Microchip datasheet raccomand a maximum of 10Kohm impedance in analogic input, you can try pulldown the input with 4K7 resistor
 

luben111

Advanced Member level 1
Joined
Mar 2, 2002
Messages
490
Helped
111
Reputation
223
Reaction score
107
Trophy points
1,323
Location
UK
Activity points
3,886
Hello,

For sure you have to search the problem outside of the PIC or into your software.

Some time ago I checked all codes of ADC convertor and I could say that PIC ADC has excellent linearity.
The same I could say for their 12 bit ADC PIC - PIC16C774 - works great.

Even if you put capacitors on the inputs you could get wrong results if the PCB is not routed correctly.
 

Sobakava

Full Member level 6
Joined
Mar 27, 2002
Messages
350
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
3,346
yes I know it is linear if I use a potentiometer but
it is not with my sensor. I'll try to use a RC circuit
between amplifier and PIC.
koky, pulling the input with a resistor was one of the
first experiments. it did not help...
 

KamW

Advanced Member level 4
Joined
Jul 16, 2001
Messages
113
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
1,130
I am wondering if your problem it isn't the input voltage range. If your sensor circuit is float, then you could have problem with amplifier. I assume that the voltage you have written it was differential voltage. But what are the absolute voltages on amplifier inputs?
With INA129 and your supply you should have not more than +-10V on any amplifier input (internal too). Instrumentation amplifiers are very difficult to use becouse of this. Before I use any amplifier first I simulate it, so maybe you should measure absolute voltages on both inputs, then simulate it (I use p*r*o*t*e*l) using discrete amplifier and circuit from datasheet. For simulation purposes I always use much higher supply voltages, and then I could check every point.
If problem is with floating sensor you could try to ground it, and sometimes large resistor is enought

regards
KamW
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top