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.

MSP430FR6989: Constant voltage reference for NTC sensor

Part Number: MSP430FR6989
Other Parts Discussed in Thread: ENERGIA, MSP430FR5989

Hello Sir,

I want to purchase MSP430FR6989 Launchpad.Before purchasing I want to ask below query.

In our project,MSP430 MCU will work on coin cell.

So,we need a constant voltage for NTC because when voltage decreasing then temperature value also decreasing.

So,issue here is in MSP430FR6989 provide constant voltage pin who give us static independent voltage. 

Regards,

Pratik

  • Hi Pratik

    on-chip shared reference module that supplies three selectable voltage levels of 1.2 V, 2.0 V, and 2.5 V to supply VR+ and VR-. These reference voltages may be used internally and externally on pin VREF+ if REFOUT=1. For example the P1.1.

    One thing you should take care is the accuracy as below:

  • Hello,

    I'm use Energia IDE.I want a static Vref constant internal voltage for NTC and NTC working on coin cell.

    I refer link : energia.nu/.../. But on physical P1.1 pin didn't get any reference voltages.

    So,How could I generate Internal reference and check physically on reference pin P1.1(Vref+) ?

    and Internal reference means it generate internal reference for ADC or we can check voltage physically on respective pin P1.1? Please clarify this confusion.

    Thank you.

  • Hi PRATIK

    For the GPIO configuration you can refer to the datasheet of msp430fr5989 (www.ti.com/.../msp430fr6989.pdf) on page 96. We can see, when we want to output the vref+ we should configure DIR to 1 and SEL1 to 1.
    And we should use" while(!(REFCTL0 & REFGENRDY)); " // Wait for reference generator to settle
  • Hi Gary,

    Thanks for responce.

    Now, on pin P1.1 I got a 1.19V through code part but I got an one issue here :

    void Vref_ON()
    
    {
    
    while(REFCTL0 & REFGENBUSY);                                     // If ref generator busy, WAIT
    
    REFCTL0 |= REFVSEL_0 + REFON + REFOUT;             // Enable internal 1.2V reference
    
    while(!(REFCTL0 & REFGENRDY));            // Wait for reference generator
    
                                                                                   // to settle
    
    }
    
    void Vref_Off()
    
    {
    
    REFCTL0=1;
    
    }
    
    void setup()
    
    {
    
    Vref_ON();
    
    Serial.begin(9600);
    
    }
    
    void loop()
    
    {
    
     // int val = analogRead(A11);    //**** When comment this portion then on P1.1 Vref+  get voltage (1.19V), uncomment then get voltage 0V ****
    
     Serial.println(val);
    
    delay(500);
    
    }

    Please mention above comment and code.

    Why this issue happen ?

    Regards,

    Pratik

  • Hi Pratik

    How do you configured the ADC? What's the operation in the function of "analogRead"?

    Gary
  • I am generate +Vref voltage from P1.1(As per MSP430FR6989 launchpad).

    and applied +Vref in NTC and measure ADC value on A11 pin.

    Thanks & Regards,

    Pratik

  • Does the software problem solved now?
  • No,Still not solve the issue but here I am try some modifications:

    #define MY_INTERNAL2V0 (ADC12VRSEL_1 | REFON | REFVSEL_0 | REFOUT)

    Same issue happen, without RFCTL0 and With analogread() can not get 1.19V on physical pin.

    #define MY_INTERNAL2V0 (REFCTL0|=ADC12VRSEL_1 | REFON | REFVSEL_0 | REFOUT) // Here generate 1.19V but with analogread() not generate.

    I also did modification in wiring_analog.c and change #define REF_MAP(x) (x & 0x31) to #define REF_MAP(x) (x & 0x33).

    Please suggest me alternative of analogread() function using registers of MSP430FR6989.

    Thank you.
  • Hi
    What's the operation in the analogread() function?
  • Hello Gary,

     Consider MSP430FR6989 launchapad. pin P1.1(+Vref) and P9.3 (A11) 

    #define MY_INTERNAL2V0 (REFCTL0|= ADC12VRSEL_1 | REFON | REFVSEL_0 | REFOUT)  //<--- Without REFCTL0 not generate 1.2V
    #define ANALOG_RES 12
    
    void setup()
    {
      analogReadResolution(ANALOG_RES);
      analogReference(MY_INTERNAL2V0);
      Serial.begin(115200);
    }
    void loop()
    {
      int val = analogRead(A11);  //<--- This function is responsible for this issue.
      /* 
       * Note that the default resolution for the FR6989 is 12 bit. 
       * This can be changed with analogReadResolution(resolution in bits)
       */
      
      float voltage = val * (1.2 / (1 << ANALOG_RES));
      Serial.print(voltage * 1000);
      Serial.println(" mV");
      delay(500);
    }

    Regards,

    Pratik

  • Hi
    I can't find the define of analogRead() function in the code you have upload above. Can you show me that?
  • Hello Gary,

    P1.1(+Vref) external and P9.3(A11) mention in MSP430FR6989.

    Please look below Energia code snipet :

    #define MY_INTERNAL2V0 (REFCTL0|= ADC12VRSEL_1 | REFON | REFVSEL_0 | REFOUT)  //<--- Without REFCTL0 not generate 1.2V
    #define ANALOG_RES 12
    
    void setup()
    {
      analogReadResolution(ANALOG_RES);
      analogReference(MY_INTERNAL2V0);
      Serial.begin(115200);
    }
    void loop()
    {
      int val = analogRead(A11);  //<--- This function is responsible for this issue.
      /* 
       * Note that the default resolution for the FR6989 is 12 bit. 
       * This can be changed with analogReadResolution(resolution in bits)
       */
      
      float voltage = val * (1.2 / (1 << ANALOG_RES));
      Serial.print(voltage * 1000);
      Serial.println(" mV");
      delay(500);
    }

    Please mention above comments.

    If possible please suggest me sample code logic with respect to Register of MSP430FR6989.

    Thank you.

    Regards,

    Pratik

  • Hi Pratik

    So far, you can out put the 1.2 v voltage normally now? And what's the problem of your logic now? What's the logic you want to change?
  • Hello,

    I already mention in above code comment.

    I sucessfully get 1.2v using Vref+ on pin.

    I have a one issue only if I'm call analogread() in void loop() . Then on Vref+ I got a 0v.

    So,Please suggest me alternative of analogread() like using Register.

    Regards,
    Pratik
  • Hi

    The function analogread() is API from the TI's LIB? I have not used the function before. You can just read the ADC result from the ADC12MEM register if you have configured the ADC properly before.

    Gary
  • Hi

    What's the reference voltage for the ADC? you can try use VCC as the reference voltage for ADC.

    Gary
  • Hello Gary,

    My MCU working on coin cell and it will provide 3.3V.

    But coin cell will be consuming voltage.

    So,I need a constant reference voltage for NTC.

    Should VCC change according to coin cell voltage if I try VCC as the reference voltage ? 

    Thank you.

    Regards,

    Pratik

  • Hi Pratik

    I just want to verify whether the use of internal reference voltage will affect the external one.

    Gary
  • Hi Pratik

    If you can't offer the operation code about analogread(), I will close this thread fisrt. If you have even more question you can open a new post.
    Thanks
    Gary
  • Ok...please close my thread.

    Thanks for TI support.

    Thanks Gary.

    Regards,

    Pratik

**Attention** This is a public forum