EmbeddedRelated.com
Forums

Problem measuring voltage with ADC10 MSP430F1232

Started by ravanveenendaal June 3, 2010
Hi all,

I'm trying to measure 12 volt with the ADC of the msp430f1232. I use a voltage divider (10k and 1k resistor), so I see 1.09 volt over the 1k resistor. After I initialize the msp430 for ADC conversion and I connect this voltage to A0 of the ADC it drops to 0.23 volt! Is this normal behavior? I would expect that this voltage would hardly change, because of the high input impedance. Also the result ADCMEM gives a too low value?!

gr. Ralf

Beginning Microcontrollers with the MSP430

You probably forgot to program the pin as input and the function
selected to ADC pin. If it is left as output and has logic state zero
the result is a near 1.2mA flowing to the pin from the 12V and 10K
resistor. Since the output impedance is low, but not zero, you can in
fact measure some voltage in the pin. In the other hand the ADC is
reading what the pin circuit gives to it when the pin is set as
output.
-Augusto
.
On Qui 03/06/10 09:21 , "ravanveenendaal" r...@yahoo.com
sent:
Hi all,
I'm trying to measure 12 volt with the ADC of the msp430f1232. I use
a voltage divider (10k and 1k resistor), so I see 1.09 volt over the
1k resistor. After I initialize the msp430 for ADC conversion and I
connect this voltage to A0 of the ADC it drops to 0.23 volt! Is this
normal behavior? I would expect that this voltage would hardly
change, because of the high input impedance. Also the result ADCMEM
gives a too low value?!
gr. Ralf



That was my first thought too, but I double checked that.

I replaced the microcontroller and now the voltage stays up, so it seems that this microcontroller was a bad one.

Thanks for your help anyway.

gr. Ralf

--- In m..., Augusto Einsfeldt wrote:
>
> You probably forgot to program the pin as input and the function
> selected to ADC pin. If it is left as output and has logic state zero
> the result is a near 1.2mA flowing to the pin from the 12V and 10K
> resistor. Since the output impedance is low, but not zero, you can in
> fact measure some voltage in the pin. In the other hand the ADC is
> reading what the pin circuit gives to it when the pin is set as
> output.
> -Augusto
> .
> On Qui 03/06/10 09:21 , "ravanveenendaal" ravanveenendaal@...
> sent:
> Hi all,
> I'm trying to measure 12 volt with the ADC of the msp430f1232. I use
> a voltage divider (10k and 1k resistor), so I see 1.09 volt over the
> 1k resistor. After I initialize the msp430 for ADC conversion and I
> connect this voltage to A0 of the ADC it drops to 0.23 volt! Is this
> normal behavior? I would expect that this voltage would hardly
> change, because of the high input impedance. Also the result ADCMEM
> gives a too low value?!
> gr. Ralf
>
>
>

may be you shoud first verify if the ADC is conveting or not, this can be
done by first clearing the ADCMEM before you start the conversion. If the
ADCMEM remains cleared after the conversion then you know that there is
sumthin wrong in your initialization.