Raady Here
Full Member level 5
- Joined
- Jun 8, 2013
- Messages
- 242
- Helped
- 26
- Reputation
- 52
- Reaction score
- 26
- Trophy points
- 28
- Location
- India
- Activity points
- 1,571
PIC30f5011, MPLAB 8.8,
HI,
I am reading voltages which vary from 2 millivolt to 4.8v
I have configured adc and reading the value aprox.
but getting huge error while reading milli volts.
Fluke reading(v)----adc reading(v) error
3.012----------------3.008----------------4 mv
1.002----------------0.991----------------11 mv
0.503----------------0.495----------------18 mv
0.210----------------0.189----------------21 mv
0.080----------------0.001----------------79 mv
0.070 -0.001--------0.000----------------not detected
how can we sense the correct value, because my application has millivolt sensitivity ?
how to configure so that adc will be able to reading even below 70 mv also ?
Regards,
Raady.
HI,
I am reading voltages which vary from 2 millivolt to 4.8v
I have configured adc and reading the value aprox.
but getting huge error while reading milli volts.
Fluke reading(v)----adc reading(v) error
3.012----------------3.008----------------4 mv
1.002----------------0.991----------------11 mv
0.503----------------0.495----------------18 mv
0.210----------------0.189----------------21 mv
0.080----------------0.001----------------79 mv
0.070 -0.001--------0.000----------------not detected
how can we sense the correct value, because my application has millivolt sensitivity ?
how to configure so that adc will be able to reading even below 70 mv also ?
Regards,
Raady.
Code:
#define OPV 5.017
#define samples 1024
#define adc12bit 4096
#define mf (OPV/samples/adc12bit) // multiplying factor
void int_adc(void)
{
....
....
ADPCFG = 0x7FFF; // Selecting inputs AN15
ADCSSL = 0x8000; // Scan Select AN15.
IEC0bits.ADIE = 1; // ADC interrupt is enabled.
ADCON1bits.ADON = 1; // Turn on ADC Module.
}
void __attribute__((__interrupt__,no_auto_psv)) _ADCInterrupt(void)
{
adc_temp_R += ADCBUF2;
i++;
if(i > samples)
{
adc_Voltage = (float)adc_temp_R * mf;
adc_temp_R = 0;
i = 0;
}
}
Flag.adc = 0;
}
/* ADC Timer Interrupt Handler */
void __attribute__((__interrupt__,auto_psv)) _T3Interrupt(void)
{
if(Flag.adc == 0 )
{
Flag.adc=1;
IFS0bits.ADIF = 0;
}
IFS0bits.T3IF = 0; //Clear Timer3 interrupt flag
}
Last edited: