Dear all,
I have the problem with the spikes in my data from ADC, when I'm using the sleep mode LPM0 between conversion of ADC. Without using sleep mode LPM0, I don't have these spikes. The freqency of the spikes is 7 Hz and I read 256 samples per sec via ADC.
My procedure of meaurement is : wake up the microcontroller on every 4 ms , set SD16CCTL3 to start conversion, go sleep and wake up when conversion is ready, read the data and go sleep again. For sleep mode I'm using LPM0 mode.
Is it the problem of Sampling capacitance Cs of the ADC? Why the spikes occured only when I'm using the sleep mode?
This is my settings for the ADC:
void SD16AInit()
{
SD16CTL = SD16REFON + SD16SSEL_1 + SD16XDIV_1; //SMCLK = 8 MHz
SD16CCTL0 |= SD16GRP + SD16OSR_256 + SD16UNI + SD16SNGL; // Group with CH1
SD16CCTL1 |= SD16GRP + SD16OSR_256 + SD16UNI + SD16SNGL; // Group with CH2
SD16CCTL2 |= SD16GRP + SD16OSR_256 + SD16UNI + SD16SNGL; // Group with CH3
SD16CCTL3 |= SD16IE + SD16OSR_256 + SD16UNI + SD16SNGL; // Enable interrupt
for(unsigned int i = 0; i < 0x3600; i++); // Delay for 1.2V ref startup
}
Regards,
Michal