Sign in

username:

password:



Not a member?

Search msp430



Search tips

Subscribe to msp430



Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | MSP430 | ADC wrong digital count


Advertise Here

The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.

ADC wrong digital count - embedded2k - Aug 16 8:22:46 2009

I'm using ADC12 in MSP430F248. I'm getting improper digital counts for analog voltage inputs.

For example, for a constant voltage input of 1.25 volts and with VR+ -> AVCC -> 3.3V, VR- -> AVSS -> 0V, I'm getting a digital count around 2000 which ideally should have been around 1550. However, for a input of 0V I'm getting a 0 count.

Interestingly, with the REFON i.e VR+ - 2.5V or VR+ 1.5V the digital count is accurate.

Please share your thoughts on the same. Thanks.

------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )


Re: ADC wrong digital count - old_cow_yellow - Aug 16 9:25:41 2009

You probably used |=something where you should have used =something_else. Also, you might have used this instead of that.

--- In m...@yahoogroups.com, "embedded2k" wrote:
>
> I'm using ADC12 in MSP430F248. I'm getting improper digital counts for analog voltage inputs.
>
> For example, for a constant voltage input of 1.25 volts and with VR+ -> AVCC -> 3.3V, VR- -> AVSS -> 0V, I'm getting a digital count around 2000 which ideally should have been around 1550. However, for a input of 0V I'm getting a 0 count.
>
> Interestingly, with the REFON i.e VR+ - 2.5V or VR+ 1.5V the digital count is accurate.
>
> Please share your thoughts on the same. Thanks.
>
------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: ADC wrong digital count - embedded2k - Aug 16 10:01:41 2009

--- In m...@yahoogroups.com, "old_cow_yellow" wrote:
>
> You probably used |=something where you should have used =something_else. Also, you might have used this instead of that.
>
> --- In m...@yahoogroups.com, "embedded2k" wrote:
> >
> > I'm using ADC12 in MSP430F248. I'm getting improper digital counts for analog voltage inputs.
> >
> > For example, for a constant voltage input of 1.25 volts and with VR+ -> AVCC -> 3.3V, VR- -> AVSS -> 0V, I'm getting a digital count around 2000 which ideally should have been around 1550. However, for a input of 0V I'm getting a 0 count.
> >
> > Interestingly, with the REFON i.e VR+ - 2.5V or VR+ 1.5V the digital count is accurate.
> >
> > Please share your thoughts on the same. Thanks.
> pardon me, I don't get that. Moreover, it works fine with REFON!!!

------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: ADC wrong digital count - old_cow_yellow - Aug 16 10:48:43 2009

In that case, use it with REFON.

--- In m...@yahoogroups.com, "embedded2k" wrote:
>
> --- In m...@yahoogroups.com, "old_cow_yellow" wrote:
> >
> > You probably used |=something where you should have used =something_else. Also, you might have used this instead of that.
> >
> > --- In m...@yahoogroups.com, "embedded2k" wrote:
> > >
> > > I'm using ADC12 in MSP430F248. I'm getting improper digital counts for analog voltage inputs.
> > >
> > > For example, for a constant voltage input of 1.25 volts and with VR+ -> AVCC -> 3.3V, VR- -> AVSS -> 0V, I'm getting a digital count around 2000 which ideally should have been around 1550. However, for a input of 0V I'm getting a 0 count.
> > >
> > > Interestingly, with the REFON i.e VR+ - 2.5V or VR+ 1.5V the digital count is accurate.
> > >
> > > Please share your thoughts on the same. Thanks.
> > >
> >
> pardon me, I don't get that. Moreover, it works fine with REFON!!!
>
------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: ADC wrong digital count - embedded2k - Aug 16 10:56:12 2009

Unfortunately, my input voltage is more than that of 2.5 volts it can go upto 3.3v. So, I have the option only to use AVcc - 3.3V.

--- In m...@yahoogroups.com, "old_cow_yellow" wrote:
>
> In that case, use it with REFON.
>
> --- In m...@yahoogroups.com, "embedded2k" wrote:
> >
> > --- In m...@yahoogroups.com, "old_cow_yellow" wrote:
> > >
> > > You probably used |=something where you should have used =something_else. Also, you might have used this instead of that.
> > >
> > > --- In m...@yahoogroups.com, "embedded2k" wrote:
> > > >
> > > > I'm using ADC12 in MSP430F248. I'm getting improper digital counts for analog voltage inputs.
> > > >
> > > > For example, for a constant voltage input of 1.25 volts and with VR+ -> AVCC -> 3.3V, VR- -> AVSS -> 0V, I'm getting a digital count around 2000 which ideally should have been around 1550. However, for a input of 0V I'm getting a 0 count.
> > > >
> > > > Interestingly, with the REFON i.e VR+ - 2.5V or VR+ 1.5V the digital count is accurate.
> > > >
> > > > Please share your thoughts on the same. Thanks.
> > > >
> > >
> > pardon me, I don't get that. Moreover, it works fine with REFON!!!
>

------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: ADC wrong digital count - old_cow_yellow - Aug 16 11:45:18 2009

Either the hardware or the software is causing the wrong reading.

The ADC12 of F248 is designed to work with any Vref+ up to AVcc and any Vref- down to AVss. But individual chips may malfunction or get damaged. When used in an actual circuit board, that circuit may be incorrect too. But most likely the problem is caused by incorrect software code.

Like all other uC, MSP430 does not always do what the programmer intend to do. It will only do what the program told it to do, which is not always what the programmer intended.

I have no idea what you did. But base on code posted here by others, most are written in c. And one of the most common mistakes is improper use of |= (vs. =). Another common problem is these programmers do not understand that when the code appear to work under one condition does not mean the code is correct under all other conditions.

--- In m...@yahoogroups.com, "embedded2k" wrote:
>
> Unfortunately, my input voltage is more than that of 2.5 volts it can go upto 3.3v. So, I have the option only to use AVcc - 3.3V.
>
> --- In m...@yahoogroups.com, "old_cow_yellow" wrote:
> >
> > In that case, use it with REFON.
> >
> > --- In m...@yahoogroups.com, "embedded2k" wrote:
> > >
> > > --- In m...@yahoogroups.com, "old_cow_yellow" wrote:
> > > >
> > > > You probably used |=something where you should have used =something_else. Also, you might have used this instead of that.
> > > >
> > > > --- In m...@yahoogroups.com, "embedded2k" wrote:
> > > > >
> > > > > I'm using ADC12 in MSP430F248. I'm getting improper digital counts for analog voltage inputs.
> > > > >
> > > > > For example, for a constant voltage input of 1.25 volts and with VR+ -> AVCC -> 3.3V, VR- -> AVSS -> 0V, I'm getting a digital count around 2000 which ideally should have been around 1550. However, for a input of 0V I'm getting a 0 count.
> > > > >
> > > > > Interestingly, with the REFON i.e VR+ - 2.5V or VR+ 1.5V the digital count is accurate.
> > > > >
> > > > > Please share your thoughts on the same. Thanks.
> > > > >
> > > >
> > > pardon me, I don't get that. Moreover, it works fine with REFON!!!
> > >
>

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: Re: ADC wrong digital count - Augusto Einsfeldt - Aug 16 13:08:06 2009


Other possible causes:
1) Vref selected still the internal (check SREF0 & SREF1). It may be the case since the OP says it
just switch the REFON bit to get the correct reading for internal Vref.
2) External Vref cannot deliver the necessary current. ADC demands around 200uA from Vref. It
doesn't mean a direct connection to the 3V3 rail would be enough. There must be a 10uF low ESR
capacitor next to the +Vref pin to be sure the proper amount of current will be supplied without
dips in the Avcc.

-Augusto
On Dom 16/08/09 12:45 , "old_cow_yellow" o...@yahoo.com sent:
> Either the hardware or the software is causing the wrong reading.
> The ADC12 of F248 is designed to work with any Vref+ up to AVcc and
> any Vref- down to AVss. But individual chips may malfunction or get
> damaged. When used in an actual circuit board, that circuit may be
> incorrect too. But most likely the problem is caused by incorrect
> software code.
> Like all other uC, MSP430 does not always do what the programmer
> intend to do. It will only do what the program told it to do, which
> is not always what the programmer intended.
> I have no idea what you did. But base on code posted here by others,
> most are written in c. And one of the most common mistakes is improper
> use of |= (vs. =). Another common problem is these programmers do not
> understand that when the code appear to work under one condition does
> not mean the code is correct under all other conditions.
> --- In m...@yahoogroups.com, "embedded2k" wrote:
> >
> > Unfortunately, my input voltage is more than that of 2.5 volts it
> can go upto 3.3v. So, I have the option only to use AVcc - 3.3V.
> >
> > --- In m...@yahoogroups.com, "old_cow_yellow" wrote:
> > >
> > > In that case, use it with REFON.
> > >
> > > --- In m...@yahoogroups.com, "embedded2k" wrote:
> > > >
> > > > --- In m...@yahoogroups.com, "old_cow_yellow" wrote:
> > > > >
> > > > > You probably used |=something where you should have used
> =something_else. Also, you might have used this instead of that.
> > > > >
> > > > > --- In m...@yahoogroups.com, "embedded2k" wrote:
> > > > > >
> > > > > > I'm using ADC12 in MSP430F248. I'm getting improper
> digital counts for analog voltage inputs.
> > > > > >
> > > > > > For example, for a constant voltage input of 1.25 volts
> and with VR+ -> AVCC -> 3.3V, VR- -> AVSS -> 0V, I'm getting a
> digital count around 2000 which ideally should have been around 1550.
> However, for a input of 0V I'm getting a 0 count.
> > > > > >
> > > > > > Interestingly, with the REFON i.e VR+ - 2.5V or VR+ 1.5V
> the digital count is accurate.
> > > > > >
> > > > > > Please share your thoughts on the same. Thanks.
> > > > > >
> > > > >
> > > > pardon me, I don't get that. Moreover, it works fine with
> REFON!!!
> > > >
> > >
> >
>
>

------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: Re: ADC wrong digital count - OneStone - Aug 16 13:32:19 2009

Your input voltage doesn't matter much. I keep track of 30V systems
using the internal Vref, a divider using 1% resistors and a spare opamp.

Have you correctly laid out your circuit? AVCC routed separately from
VCC all the way from the supply input and separately bypassed at the
micro? Is AVSS routed similarly, and not simply linked off of VSS close
to the micro. is your AVCC track wide enough to carry the required
current without loss. have you tried having the ADC report what it
thinks VCC and VCC/2 are. Have you suitably bypassed the Vref pins.

I also find it highly suspicious that the value in error corresponds to
an actual Vref of 2.5V. Try changing the input voltage and making a few
more measurements and see if this correlates, then check what voltage is
on Vref+ out.

Al

embedded2k wrote:
> Unfortunately, my input voltage is more than that of 2.5 volts it can
> go upto 3.3v. So, I have the option only to use AVcc - 3.3V.
>
> --- In m...@yahoogroups.com, "old_cow_yellow"
> wrote:
>> In that case, use it with REFON.
>>
>> --- In m...@yahoogroups.com, "embedded2k" wrote:
>>> --- In m...@yahoogroups.com, "old_cow_yellow"
>>> wrote:
>>>> You probably used |=something where you should have used
>>>> =something_else. Also, you might have used this instead of
>>>> that.
>>>>
>>>> --- In m...@yahoogroups.com, "embedded2k"
>>>> wrote:
>>>>> I'm using ADC12 in MSP430F248. I'm getting improper digital
>>>>> counts for analog voltage inputs.
>>>>>
>>>>> For example, for a constant voltage input of 1.25 volts and
>>>>> with VR+ -> AVCC -> 3.3V, VR- -> AVSS -> 0V, I'm getting a
>>>>> digital count around 2000 which ideally should have been
>>>>> around 1550. However, for a input of 0V I'm getting a 0
>>>>> count.
>>>>>
>>>>> Interestingly, with the REFON i.e VR+ - 2.5V or VR+ 1.5V the
>>>>> digital count is accurate.
>>>>>
>>>>> Please share your thoughts on the same. Thanks.
>>>>>
>>> pardon me, I don't get that. Moreover, it works fine with
>>> REFON!!!
>>>
> ------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: ADC wrong digital count - Hugh Molesworth - Aug 17 11:50:06 2009

Actually you have to do a little more than just turn on or off REFON
to use the internal or external reference. In ADC12MCTLn you have to
select the correct reference for each channel n that you wish to
measure via the SREFx bits (bits 6-0).
Hugh

At 05:22 AM 8/16/2009, you wrote:
>I'm using ADC12 in MSP430F248. I'm getting improper digital counts
>for analog voltage inputs.
>
>For example, for a constant voltage input of 1.25 volts and with VR+
>-> AVCC -> 3.3V, VR- -> AVSS -> 0V, I'm getting a digital count
>around 2000 which ideally should have been around 1550. However, for
>a input of 0V I'm getting a 0 count.
>
>Interestingly, with the REFON i.e VR+ - 2.5V or VR+ 1.5V the digital
>count is accurate.
>
>Please share your thoughts on the same. Thanks.
------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )