Hello! I need help!
Setting ADC:
IEXCON = BIT1 + BIT6; | // Enable Excitation Current Source 200uA |
ADCMSKI = BIT0; | // Enable ADC0 result ready interrupt source |
ADCFLT = 0x7F + (1<<7); | // 50Hz no filtering, Chop off, No averaging |
ADC0CON = BIT10 + BIT15; | // Gain = 32, Unipolar, enable ADC0, Int Reference |
ADCCFG = 0; |
ADCMDE = BIT2 + BIT4 + BIT7; |
while((ADCSTA & BIT0) != BIT0){} | // Wait for Calibration routine to complete |
// Gain Self Calibration
ADCMDE = BIT0 + BIT2 + BIT4 + BIT7;
while((ADCSTA & BIT0) != BIT0){} | // Wait for Calibration routine to complete |
ADC0CON = BIT0 + BIT2 + BIT4 + BIT10 + BIT15; | // Gain = 32, Unipolar, enable ADC0, Int Reference |
ADCMDE = BIT0 + BIT7; | // Enable Continuous conversion mode |
IRQEN |= (1<<BSP_IRQ_ADC);
in the interrupt handler:
IRQSTATUS = IRQSTA; |
if(IRQSTATUS & (1<<BSP_IRQ_ADC)){
if (ADCSTA & (1<<ADC0RDY_BIT) == (1<<ADC0RDY_BIT)){
ulADC0Result = ADC0DAT; // read code
}
}
in result beats ulADC0Resul +\- 2000 samples.
I expected about 20-30 beats samples. Is that possible?
What am I doing wrong?
Used EVAL-ADUC7061MKZ and EVAL-ADUC7060QSPZ.
Used different combinations of filter.But nothing helped.