Jump to content
s1ck

Reference voltage for analogRead()

Recommended Posts

Hi!

 

Just a few questions:

 

What is the default reference voltage for the analogRead() function on a msp430 g2553 ? Is it the internal Vcc ?

How can I read the exact reference voltage correctly?

Is there an option to change the reference voltage?

 

Thanks in advance!

 

kind regards,

s1ck

Share this post


Link to post
Share on other sites

s1ck,

 

The default reference voltage for analogRead() is well, DEFAULT (Which is using the internal VCC and VSS). It can be changed by using the function analogReference(). As for reading the exact reference voltage, I don't think that's possible. (Other than setting the ADC10 to output the reference voltage and using a voltmeter to read it)

Share this post


Link to post
Share on other sites

Thank you very much.

Somewhere in the msp430 manual I read, that you can read ADC channel 11 to get the reference voltage (or internal vcc, depends). Is that possible as well?

I would try it, but I dont have a launchpad right now.

 

kind regards,

s1ck

Share this post


Link to post
Share on other sites

Yes it is possible to read the ref voltage, it is useful for calibration of single devices........I think it is ch11 but not sure,

just to remember if you do, you need to read ground too, to get any decent calibration info out of it.

Share this post


Link to post
Share on other sites

Yes it is possible to read the ref voltage, it is useful for calibration of single devices........I think it is ch11 but not sure,

just to remember if you do, you need to read ground too, to get any decent calibration info out of it.

 

Could you please describe how I might analogRead the internal ref voltage (1.5V) on the MSP430G2553 using Energia?

 

Thanks...TinkerJim

Share this post


Link to post
Share on other sites

Could you please describe how I might analogRead the internal ref voltage (1.5V) on the MSP430G2553 using Energia?

 

Thanks...TinkerJim

 

Energia does not directly support reading the internal reference. You might be able to convince it with analogRead(128+10); and some direct tweaking of ADC registers, but in the end it's probably easier to go directly to the metal. Here's a tutorial, it's even a solar cell use case like yours:

http://www.elevendroids.com/2013/06/code-recipe-reading-msp430-power-supply-voltage-level/

 

To figure out what all these code lines mean, get the MSP430x2xxx Family User Guide (slau144j) and study chapter 22 about the ADC10

http://www.ti.com/lit/ug/slau144j/slau144j.pdf

Share this post


Link to post
Share on other sites

Energia does not directly support reading the internal reference. You might be able to convince it with analogRead(128+10); and some direct tweaking of ADC registers, but in the end it's probably easier to go directly to the metal. Here's a tutorial, it's even a solar cell use case like yours:

http://www.elevendroids.com/2013/06/code-recipe-reading-msp430-power-supply-voltage-level/

 

To figure out what all these code lines mean, get the MSP430x2xxx Family User Guide (slau144j) and study chapter 22 about the ADC10

http://www.ti.com/lit/ug/slau144j/slau144j.pdf

 

 

 

 

Thanks, Chicken, for the clear and helpful response !

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...