Continue to Site

# [PIC]12 bit ADC measurement problem

Status
Not open for further replies.

#### khaleel.arya

##### Junior Member level 2
MPLAB8.8
dsPIC30F5011

Hi,
I am using a 12bit SAR [succesive approximation converter] adc for measurement and I am getting a variation of 15~20 mv difference with out sampling w.r.t DC Voltages.

i have used a crystal,primary oscillator of 8MHZ with 4 PLL
*************************************************************************
Fcy = Fosc/4 = (Source Osc freq * PLL mul)/(program post scalar *4)
Tcy = 1/ Fcy
A minimum of 333.33 ns is required for TAD,
from this

these are my initialisations fr adc convertion clock
---------------------------------------------------------------------------
Code:
ADCON3bits.SAMC	= 14;		// fr 12 bit ADc 14TAD
ADCON3bits.ADCS	=  5;
-----------------------------------------------------------------------------------
is there any wrong with this calculation or any other suggestions to get accurate values

Regards
khaleel

Last edited by a moderator:

Use independed ground and reference voltage for ADC_Ref+/-.

independent ground in the sense?
can you explain it briefly

I didn't seen your PCB. For reference voltages reasonable to use intependend ground and supply, connected via low pass filter, based on inductor and capacitor.

What are the voltages you are expecting to measure - in other words what is the relative error of the 15-20mV.
12-bit ADCs mean that the last bit is 1/4096 of the maximum range. If you are trying to measure (say) 0 to 5V then the bottom bit is +/- 1mV.
However, unless you are dealing with a *VERY* (electrical) noise-free environment, the best you can typically expect to measure with an ADC is something like 8 (+/-0.5%) or perhaps 10 bits (+/- 0.1%). That is just the nature of electrical signals .
Susan

I have connected a keypad which is made with different resistors and provides different voltages when i press the different buttons.when i compare the voltages im getting with voltages shown by multi meter it showing a difference of 15-20mv.

Increase to 100-200mV and it will work.

Status
Not open for further replies.