Part Number: MSP-EXPCC430RFX
The problem I have is that I have a peak in the measurement (voltage in a temperature probe (NTC)) equivalent to the ambient light sensor.
I have verified that voltage peaks are generated in Vref, which distorts the measurement.
How can I make sure I do not have any variation in Vref voltage?
It may be due to some interruption (for I2C with memories, with SMPL_ with radio link (868), serial port communication, watchdog, pushbuttons, timer ...).
I put the code in which I enable the tension, and then I read of the adc
HalAdcStartRead();
__bis_SR_register(LPM0_bits + GIE);
HalAdcConvertTempVcc();
void HalAdcStartRead(void)
{
ADC12IFG = 0x00; // Clear all ADC12 channel int flags
REFCTL0 |= REFON; // Turn on ADC12 reference
__delay_cycles(12000); // delay for reference to settle
ADC12IE = BIT2; // Enable channel A2 interrupt
ADC12CTL0 |= ADC12ENC | ADC12SC ; // Start conversion
}
void HalAdcConvertTempVcc(c)
{
unsigned char i;
IntDegF = 10*(SavedADC12MEM3*m + c)*((float)9/5) + 320;
for (i=0;i<110;i++) //tamaño tabla
if(TablaTemp[i]<SavedADC12MEM1)
break;
IntDegCS1 = i-32;
for (i=0;i<110;i++)
if(TablaTemp[i]<SavedADC12MEM0)
break;
IntDegCS2 = i-32;
Vcc = (SavedADC12MEM4 * 30) >> 12;
Vbat= (SavedADC12MEM2 * 30) >> 12;
}