Jump to content
Sign in to follow this  
Nisarg

Can I use analogReference() with TM4C123G?

Recommended Posts

Hi,
I am just learning to use TM4C123G launchpad with energia. I wanted to use one of my old codes (which used MSP430G2553) on it. The only problem is that the compiler doesnt allow me to use analogReference. The datasheet of the controller doesnt mention any internal voltage reference.

Will it be fine if i generate required VREFP on any other GPIO via analogWrite and then connect it with VREFP pin externally?

Help!

Share this post


Link to post
Share on other sites

I don't belive so. Pin 6 on J1 can be ADCREF for the G2553 but because of the following, is not implemented on the Tiva LP:

 

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

 

Page 809-

"13.3.4.1 Voltage Reference

The ADC uses internal signals VREFP and VREFN as references to produce a conversion value from the selected analog input. VREFP is connected to VDDA and VREFN is connected to GNDA, as shown in Figure 13-8."

 

So, VREFP and VREFN are within the chip and not brought out. Also, the LP board has VDDA tied to VDD so will always be 3.3v; VDDA tied to GND so will always be 0v.

 

Page 851 shows the Voltage Reference Select bit can take two values: 0x0 and 0x1. Ox0 = VDDA and GNDA are the voltage reference for all ADC modules; 0x1 is Reserved. So it may change in the future to allow an alternative reference but for now it's hard-wired unless you build your own board and supply VDDA/GNDA with different voltages... or are real talented and can lift the VDDA pin from the board.

Share this post


Link to post
Share on other sites

I don't belive so. Pin 6 on J1 can be ADCREF for the G2553 but because of the following, is not implemented on the Tiva LP:

 

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

 

Page 809-

"13.3.4.1 Voltage Reference

The ADC uses internal signals VREFP and VREFN as references to produce a conversion value from the selected analog input. VREFP is connected to VDDA and VREFN is connected to GNDA, as shown in Figure 13-8."

 

So, VREFP and VREFN are within the chip and not brought out. Also, the LP board has VDDA tied to VDD so will always be 3.3v; VDDA tied to GND so will always be 0v.

 

Page 851 shows the Voltage Reference Select bit can take two values: 0x0 and 0x1. Ox0 = VDDA and GNDA are the voltage reference for all ADC modules; 0x1 is Reserved. So it may change in the future to allow an alternative reference but for now it's hard-wired unless you build your own board and supply VDDA/GNDA with different voltages... or are real talented and can lift the VDDA pin from the board.

I get it! hopefully the 12bit ADC instead of 10bit (on 2553) will help. Thanks!

 

The TM4C123G has a single reference and therefor the analogReference() function is an empty function to make sure that Sketches that call analogReference() compile.

I am using Energia 0101E0011, and analogReference() or analogReference(EXTERNAL) or analogReference(INTERNAL) doesn't compile.

Moreover, SPMU296 lists analog pins as AINx (x = 0 to 11), but the code doesnt compile with it! It compiles with Ax (as used in 2553), but I dont have any idea about the corresponding pins on J3 and J4 column on launchpad.

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.

Sign in to follow this  

×
×
  • Create New...