Hi, I am doing an interface of MSP430FR5969 with an image sensor.
So, I have this ADC settings. The adc input is connected to the analog out of the sensor
void initADC()
{
while(REFCTL0 & REFGENBUSY); // If ref generator busy, WAIT
REFCTL0 |= REFVSEL_1 + REFON; // Select internal ref = 2V
// Configure ADC12
ADC12CTL0 = ADC12SHT0_1 | ADC12ON; // Sampling time, ADC12 on
ADC12CTL1 = ADC12SSEL_3 | ADC12SHP ; //sample-hold, SMCLK 8MHz, repeat-single channel // Use sampling timer
ADC12CTL2 |= ADC12RES_2; // 12-bit conversion results
ADC12MCTL0 |= ADC12INCH_3 | ADC12VRSEL_1 | ADC12DIV_1 ; // A3 ADC input select; Ref 0-2V, ADC 4MHz
ADC12IER0 |= ADC12IE0; // Enable ADC conv complete interrupt
}
But the problem is that when i read every pixel of the image array, it is quite noisy. When I tried to sample each pixel 30 times and average it, it gives me a decent image but this is surely wasting time. So i thought that there is no problem with the image analog out but when I sampled the output several times, it gave me a different result, which should not be. I have tried to play with the clock, sampling time (regarding with the minimum tSample), and everything as slow as possible but the result still the same. Any suggestion?