Hi...
My question is... does it really make sense to sleep in LPM0 when reading the ADC, or not? Especially when you have a low impedance input and can use the shortest sample and hold period.
I'm using the ADC12 on the MSP430F5535. I am using an external low-power 2.5V reference, with high precision, and it is always on. There is no issue of waiting to power up the reference.
I was using the interrupt to wake up the core after the conversion, but I find I get just fine results with this code:
ADC12CTL0 = ADC12ON; // turn on ADC
ADC12MCTL0 =
BOOST_OUTPUT_SENSE// input channel
+ ADC12SREF_2 // voltage reference VeREF+ for high, GND for low
+ ADC12EOS; // end of sequence
ADC12CTL0 =
ADC12ON
+ ADC12ENC // enable conversion
+ ADC12SC; // start conversion
__delay_cycles(5); // wait for 5 microseconds
BoostVoltage = ADC12MEM0; // save result
ADC12CTL0 = 0; // turn off ADC
You can see that I do not enter LPM0, and I do not enable interrupts. Instead, I just start conversion, then wait for 5+ microseconds, then read result. I don't need super-accurate results, but this is working. And, if the off-time will be < 5 microseconds anyway, then does it make sense for any reason to enter LPM, which will cause the overhead of the interrupt service routine and then re-entering the main program execution?
Please... your comments and thoughts.