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.

MSP430G2553: Current sampling problem with 10bit adc

Part Number: MSP430G2553


Hello,

I am trying to sample current with the 10bit adc of the msp430g2553 mcu by converting it to voltage.

I have a simple photo diode which outputs current.

I connect its output to ground through a resistor of 50k ohm. I then measure the voltage drop on the resistor using the adc. It doesn't work. When the resistor is connected to the adc pin then I measure a voltage of around 2.75V using my multimeter. When I disconnect the adc pin then I measure 100mv on the resistor which makes sense.

Why does connecting the resistor to the adc pin create this problem?

What am I missing?

I am using one of the code examples in CCS for 10bit ADCs using 1.5v reference voltage with interrupt and DTC.

By the way, if I connect to the same adc pin a voltage source then the measurement is fine and isn't altered.

Thanks,

David

  • David Gerber said:
    When the resistor is connected to the adc pin then I measure a voltage of around 2.75V using my multimeter. When I disconnect the adc pin then I measure 100mv on the resistor which makes sense.

    Seems like you are connecting resistor/diode to wrong pin. Please doublecheck that pin you configure for ADC input is actually one you connect diode to, check that ADC10AE0 bit is set correctly for pin in question. If still no luck - try another ADC input (pin). Change software accordingly, try. 

    David Gerber said:
    I am using one of the code examples in CCS

    Which one exactly? What did you change in it? Any chance to show it? - together with circuit information.

    p.s. Please don't say that you sample current with ADC. It is still voltage (drop) on the resistor which is measured, not current.

  • Hi,

    I have resolved the issues. Apparently I made some changes to the code (that I didn't remember doing) that had affected the ADC. I configured everything again like in the example and it now works fine.

    The example that I used by the way was: msp430g2x33_adc10_02.c (which is also suitable for the MSP430G2553).

    Regards,
    David

**Attention** This is a public forum