This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
MSP430F5359: ADC gets stuck on raw 2048
Part Number: MSP430F5338
Using the internal reference at 2.5V. When I select
//Set ADC12MEM0 conversion to use internal VREF+ as reference ADC12MCTL0 |= ADC12SREF_1;
there is a region of varying input voltages that cause the output counts to stick at mid-range (2048 counts). The ADC12 works fine (and linearly) using AVCC as REF+ (i.e., ADC12SREF_1).
However, this is not an option in my application
For reference, the initialization code is:
//Allow ADC12_A to control Reference (as opposed to control via REF section) REFCTL0 &= ~REFMSTR;
//Turn ON ADC12 ADC12CTL0 |= ADC12ON;
ADC12CTL1 |= (ADC12SSEL0|ADC12SSEL1); //Select SMCLK for ADC12_A Clock Source; no division ADC12CTL1 |= ADC12SHP; //SAMPCON sampling signal sourced from sampling timer
//1K source impedance requires about 1.43 usec for settling to 12 bits //This is about 20 ADC12CLK cycles //Set it to 32 clock cycles ADC12CTL0 |= (ADC12SHT00|ADC12SHT01); //Set sample time at 32 clock cycles
//Turn ON Internal Reference, set it at 2.5 V ADC12CTL0 |= (ADC12REFON|ADC12REF2_5V);
//Reference Buffer always-ON ADC12CTL2 &= ~ADC12REFBURST;
//Configure P6.0 for ADC A0 Input P6SEL |= BIT0;
//Select ADC12 A0 for input ADC12MCTL0 |= ADC12INCH_0;
//Reset Flag ADC12DataReady=0;
//Enable ADC12 A0 Interrupt ADC12IE |= ADC12IE0;
//Enable Conversions (START via ADC12SC bit) ADC12CTL0 |= ADC12ENC;
What is the voltage range you are trying to measure? Anything greater than 2.5V? What is your AVCC?
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Dennis Lehman:
The "dead region" (outputting a constant 2048 counts) seems to occur in an area around 1.25V (+/-0.2V band), using the internal 2.5V reference. Output moves linearly with input for voltages below and above this dead zone. But, inside the zone, adjusting voltage does not change the 2048 count output. In this case, ADC12MCTL0 |= ADC12SREF_1;.
If I switch to ADC12MCTL0 |= ADC12SREF_0;, using REF+ = AVCC at 3.30V, I get expected performance, with no dead zone near mid-range.
An additional issue, maybe related or maybe not, is that with AVCC as REF+, channel A10, the temperature sensor, is putting out indicated voltages that are much higher than expected (say, 1.09V vs. an expected 735 mV at 20C). For reference A12 (VBAT/3) and A11 ([AVCC-AVSS}/2) are indicating properly[quote user="Dennis Lehman"]
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. 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.