Part Number: MSP430FR5994
Tool/software: Code Composer Studio
Hey Community,
I am little perplexed, while using ADC. I am using two channels to measure an individual input for understanding ADC better. Contrary to my imagination and understanding as I looked up in Debuggermode for values of two channels, am getting two different values for the same input out of ADC Memoryregister. ADC12MEM0 = 2720 and ADC12MEM1 = 2000. The correct measured value is stored in ADC12MEM0 which is 2720. I calculated it manually as well. Can you please explain me what point am I missing or did I understand it falsely. Snippet of my code is attached
I'll appreciate your response.
thanks,
Jahangir
ADC12CTL0 &= ~ADC12ENC; ADC12CTL0 |= ADC12SHT0_4 | ADC12ON; // Sampling time, S&H=64 Cycles, ADC12 on ADC12CTL0 |= ADC12MSC; // multiple sample and conversion ADC12CTL1 |= ADC12CONSEQ_2; // Repeat-single-channel ADC12CTL1 |= ADC12SHP; // Use sampling timer ADC12CTL2 |= ADC12RES_2; // 12-bit conversion results ADC12MCTL0 |= ADC12INCH_8; // A8 ADC input select; Vref=AVCC ADC12MCTL1 |= ADC12INCH_8; // A8 ADC input select; Vref=AVCC ADC12CTL0 |= ADC12ENC | ADC12SC; // Start sampling/conversion
