I'm using the CC430F5135 to take several readings from the ADC12 module on an analog input port. Each of these readings seem fine. Once I'm done, I turn off the ADC and reset all the control registers:
/* Turn off the ADC */ ADC12CTL0 = 0; ADC12CTL1 = 0; ADC12CTL2 = 0;
When I go to take a new ADC reading on another input channel (like Vdd / 2), the ADC outputs 0x0FFF. The only way to get the ADC to output a correct reading is to put the chip into low power mode. Any low power mode LPM0-3 seems to do the trick - if I just add a line putting the chip to sleep for 1 clock cycle, the ADC works fine again.
Anyone have any ideas why I need to put the chip to sleep, and how to avoid this behavior?
It should be sufficient to clear the ENC bit and then the ADCON and REFON bits to turn the ADC off.While ENC is set, some bits must not be changed. ENC must be cleared first, or the internal ADC state machine might get confused and enter some illegal state.
But that's just a guess - I never had this problem myself.
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.