Our application reads 5 inputs in single sequence, manually triggered in main(). We are not using an interrupts.
4 inputs are stored into 3 ADC memory segments, and 1 is stored into 1 ADC memory segment.
3 inputs use the shared reference, and 2 use the VCCS- reference.
Configuration is presented below:
// Enable VREF=2.5V shared reference, disable temperature sensor REFCTL0 |= REFMSTR+REFVSEL_2+REFON+REFTCOFF; // Configure for sequence of A5-A7, A12 and A 13 ADC12CTL0 = ADC12ON+ADC12MSC+ADC12SHT0_2; // Turn on ADC12, set sampling time ADC12CTL1 = ADC12SHP + ADC12CONSEQ_1; // Use sampling timer, single sequence ADC12MCTL3 = ADC12INCH_5 + ADC12SREF_1; // Ref=VREF, channel = A5 ADC12MCTL4 = ADC12INCH_5 + ADC12SREF_1; // Ref=VREF, channel = A5 ADC12MCTL5 = ADC12INCH_5 + ADC12SREF_1; // Ref=VREF, channel = A5 ADC12MCTL6 = ADC12INCH_6 + ADC12SREF_1; // Ref=VREF, channel = A6 ADC12MCTL7 = ADC12INCH_6 + ADC12SREF_1; // Ref=VREF, channel = A6 ADC12MCTL8 = ADC12INCH_6 + ADC12SREF_1; // Ref=VREF, channel = A6 ADC12MCTL9 = ADC12INCH_7 + ADC12SREF_1; // Ref=VREF, channel = A7 ADC12MCTL10 = ADC12INCH_7 + ADC12SREF_1; // Ref=VREF, channel = A7 ADC12MCTL11 = ADC12INCH_7 + ADC12SREF_1; // Ref=VREF, channel = A7 ADC12MCTL12 = ADC12INCH_12; // Ref=Vcc, channel = A12 ADC12MCTL13 = ADC12INCH_12; // Ref=Vcc, channel = A12 ADC12MCTL14 = ADC12INCH_12; // Ref=Vcc, channel = A12 ADC12MCTL15 = ADC12INCH_13 + ADC12EOS; // Ref=Vcc, channel = A13, end seq. ADC12CTL0 |= ADC12ENC; // Enable conversions
The conversion and memory read is presented below:
ADC12IFG = 0x00; // Clear flags ADC12CTL0 |= ADC12SC; // Start conversion while (!(ADC12IFG & 0x4000)); // Wait for conversion to complete Input1 = ADC12MEM3 + ADC12MEM4 + ADC12MEM5; Input1 = ANALOG_IBAT / 3; Input2 = ADC12MEM6 + ADC12MEM7 + ADC12MEM8; Input2 = ANALOG_ILAMP / 3; Input3 = ADC12MEM9 + ADC12MEM10 + ADC12MEM11; Input3 = ANALOG_VBAT / 3; Input4 = ADC12MEM0 + ADC12MEM1 + ADC12MEM2; Input4 = ANALOG_LIGHT / 3; Input5 = ADC12MEM15;
The first conversion is always successful. After the second conversion however, the application hangs. Viewing the Register in Debug mode, values are not written to memory and the interrupt flags are not set following the second conversion request.
We resolved this problem by commenting out the line "ADC12IFG = 0x00" and re-allocating the memory segments from ADC12MEM[12-14] to ADC12MEM[0-3]. In other words - separating the two inputs that use the VCCS- reference.
It's important to note that out of the 1500 boards that were manufactured, only 20 are exhibiting this behavior. We have done extensive circuit tracing and (nearly) ruled out external factors, particularly with the VCC- line.
Any help would be appreciation. Thank you.