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.

MSP430F2012: Vout on output pin does not match expected value

Part Number: MSP430F2012
Other Parts Discussed in Thread: CC1150,

Hi to all,

Had to add temperature reading to an earlier project by reading a voltage from half bridge formed by fixed resistor and NTC. It is battery powered device so I wanted to use P1.1 as output to supply power to R/NTC circuit during the a/d conversion only.  The output will go to Vcc (cca 3.1V Li battery) if not loaded, but even slightest loading (~100k -> 47K+NTC47K) produces drop like on the picture below:

A trace is output on P1.1 pin and B trace is Vcc.

DS values for Vout gives practically Vcc for such a light loading (Vcc-0.25V @ -1.5mA).

To be sure that some part of firmware is not messing up pin configuration I moved pin setup jut before R/NTC reading:

WDTCTL = WDTPW + WDTHOLD;

  P1OUT &= ~BIT1;
  P1SEL &= ~BIT1;
  P1DIR |= BIT1;
  ADC10AE0 = 0x00;

  P1OUT |= BIT1;
  TI_CC_Wait (1000);   // 1000uS wait to allow Uin to stabilize, a/d would go after this
  P1OUT &= ~BIT1;

Any hint/direction would be appreciated

Best

Hrvoje

  • I would personally add a reference voltage IC (reference voltage ~1V) with its enable pin controlled by P1.1.
    Other than that, The load on P1.1 is not just the half-bridge you have but also the current into the ADC. Once you factor that in the voltage drop of the battery when sampling, it might explain what you are noticing.

    Also, remember that NTCs have something called self-heating. This basically means that to be accurate, you would want the minimum current going through them (which is why I suggested a reference voltage ~1V).
  • Thank you Mike,

    Yes additional reference chip would solve this, but it's not to much space  left.. The ADC is not switched on, I have not come to that point and even if it would be on the loading on P1.1 would be very low (see attached circuit). If P1.1 would go to Vcc (3v) current through NTC would be very low (30uA), and it could not change it's temperature much after being only 1ms connected to supply..  

    Anyway the P1.1 should have much less voltage drop than 0.6V I measure..

    Thanks anyway,

    Hrvoje

  • Checking the voltage across R4 while P1.1 is high should give a good idea about the load.
    Page 25 of the data sheet of this chip (www.ti.com/.../msp430f2012.pdf) says that you could see a voltage drop.
  • I checked the voltage over R4 and it's as expected 1.25V, which means loading of P1.1 is very low (1.25V/47k=27uA). On page 25 of DS for observed voltage drop (3.1-2.5=0.6V) a >200 larger current is specified (6mA!).
  • OK. I can't see anything wrong with the circuit from here. But, voltage drop is always associated with current (you could probably also check the current out of P1.1).

    Voltage aside, to calculate the resistance of the NTC, you do not need the value of your bridge voltage (if Vref of the ADC is the same as your bridge voltage). If you work the mathematics,  the equation becomes:

    Rt = [ADC_value / (ADC_full_scale - ADC_value)] * R_bridge

    Here Rt is R3; R_bridge is R4

  • Yes, but as long as voltage drop on P1.1 is not predictable ADC result is useless. To calculate Rt i should use: Rt = [ADC_value / ADC(U_P1.1) - ADC_value)] * R_bridge. But I cant get ADC(U_P1.1). If I had another free ADC capable pin it could be used to read P1.1 voltage, but I hoped to find a way to make P1.1 behave as specified in DS, that would resolve all ..
  • Hi Hrvoje,

    What is the current loading for the other pins on port 1 and port 2? The values in the datasheet are specified including the loading on other pins as well.

    Can you try replacing the MCU on your board?

    Thanks,
    Ryan
  • Hi Ryan

    Thank you for your input. Few posts before I have published a part of schematic, the only part not shown is CC1150 transmitter chip (which is by the way turned off at the time of temperature reading..).

    And that's what is confusing me,  there is practically no loading, even the LED output on P2.7 is turned off. It's not our first MSP project either..

    I was sure (it's few years old project) some dead/forgotten code part is messing with pin setup, so I repeated the pin setup just before ntc readout, still no luck.

    I also ruled out problem with particular chip sample. We produce thousand's of those units so I took several from production and added R/NTC circuit to upgrade and test firmware..

    At the moment I am considering to free Vref input pin P1.4 (now used for CC1150 interface) , connect it to P1.1 and force the ADC to use output from P1.1 as Vref. This way I could get precise ratiometric reading of NTC value without worry how much P1.1 has drifted, but it is major pcb redesign and with rf products it's always a bit tricky (would probably have to repeat all rf compliance measurements..)

    Best regards,

    Hrvoje

  • Hi Hrvoje,

    That does seem very strange the voltage is dropping with so little loading. Can you replace the battery on the board with a bench voltage supply for testing? It might be possible the output current of the battery is limiting the power to the MCU.

    You could also try taking one of your boards and opening the connections between the MCU port pins and other connections on the board one at a time to see if breaking any of them allows P1.1 to drive at full strength. You could try removing power from the other devices on the board as well when it is powered from the battery.

    You can use an MSP-EXP430G2 board with an MSP430F2012 device inserted or other F2012 target board to load your code to ensure that P1.1 is working as expected on known hardware.

    Regards,
    Ryan

  • Hi Ryan, you are right, I'll make a fresh new sw project tomorrow with just P1.1 being pulsed high and loaded with variable load. I do not think battery is problem, actually on one of scope screen grabs I published in this thread there is Vcc recorded in parallel to P1.1 output, but will eliminate that for good too.
    Will be free to report after that.
    Best regards
    Hrvoje
  • Hi Ryan,

    no luck. We soldered only a MSP430F2012 on a bare board, added pull-up 56k on -RST pin, 1uF across Vcc/Vss and a 10k resistor prom P1.1 to gnd (Vss). Also we used external 3V power supply.

    We got exactly the same voltage drop as in fully populated circuit with stable Vcc. The software project was just configuring P1.1 as output and toggling it . I enclosed some pictures and sw project if you find time to take a look.

    Best

    Hrvoje

    MSP_output_pin_voltage_drop.zip

  •  Hi, just saw that circuit jpeg in uploaded zip is broken, s this one is better..

    Best,

    Hrvoje

  • What if you do the same but using P2.7 instead of P1.1?

  • Hi Hrvoje,

    If you toggle the other GPIOs on your test setup with open loads, do they also only reach 2.6V? Can you use a multimeter to measure the resistance at each GPIO? It might be possible there is a weak connection like a small solder bridge that is reducing the load impedance and drawing additional current.

    Thanks,
    Ryan
  • Hi to everyone..

    We managed to solve this issue, so if someone ends in the same dead end here it is. In total despair of not being able to force P1.1 to swing close to Vcc,  we tested the Voh on P2.x pins and they would go close to Vcc as stated in DS. We were just close to decision to give up on P1.x pins as output and redesign our PCB. But when preparing for ADC operational with Vcc as reference we noticed that we did not connect AVcc (and AVss) to anything. Actually our first design 10years ago used MSOP packaged unit which does not have those pins. We switched few years later to QFN part and since ADC was used only with internal reference for battery supervision we thought those pins can be left unconnected (never a good practice..).  Once we connected AVCC to VCC  output of P1.1 would swing to Vcc as expected. I know it's a bit strange but there it is and it solves all of our misery (at the moment).

    Thanks to everybody for input and support.

    Hrvoje

**Attention** This is a public forum