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.

  • Resolved

MSP430FR5949 operation

Prodigy 240 points

Replies: 9

Views: 82

Hi all,

I want know if we can use this MCU (MSP430FR5949) in comparator mode. If yes, what is the voltage value range that can be compared? and what is the value of the current required at the input to make the comparison ?

I read the the datasheet but I did not understand it well.
I apologize for my english level

Best regards,

Sidya

  • Hi all,

    I already asked the question yesterday, if someone has an explanation to give me I am a note taker.

    I want know if we can use this MCU (MSP430FR5949) in comparator mode. If yes, what is the voltage value range that can be compared? and what is the value of the current required at the input to make the comparison ? I read the datasheet but i didn't understand it well.

    Best regards

    Sidya

  • In reply to Sidya DRAME:

    Hi Sidya,

    I recommend to take a look into the user guide to the Comparator E chapter. There is a simple block diagram which gives a good overview.

    Regarding comparison voltages it depends if you use positive or negative inputs from external via the input multiplexer or if you use the predefined internal reference voltages which are specified in the datasheet. Input range goes from 0V to DVCC-1V means if you supply with 3.6V you can go up to 2.6V.

    The input resistance is specified up to 3kOhm which defines the current which is required depending on the voltage you apply.

    Again strongly recommend to read the user guide chapter on CompE.


    Best regards,
    Dietmar Walther

  • In reply to Dietmar Walther:

    Dietmar Walther, thanks for your reply !

    So i want know if i can put a nother value of resistor to have an input current of 50µA ?

  • In reply to Sidya DRAME:

    Yes you can depends what input voltage you apply if it is larger than 150mV you will be ok otherwise the input resistance of the comparative input might be to large.

    You always need to consider the sampling time as described in the user guide:

    Best regards,
    Dietmar Walther

  • In reply to Dietmar Walther:

    Okay, thanks Dietmar

  • In reply to Sidya DRAME:

    HI Sidya,

    was it possible to resolve your problem with the information provided. If yes please press the resolved button to close this thread.

    Best regards,
    Dietmar Walther

  • In reply to Dietmar Walther:

    Hi Dietmar,

    I want know how can i tell the  MCU that it is such voltage that i want to choose as high level or low level voltage ? I use 2V for supply voltage.

    Thanks youy for your reply

    Best regards,

    Sidya

  • In reply to Sidya DRAME:

    Sidya,

    take the following code example this should exactly do what you want.

    //******************************************************************************

    // MSP430FR5x9x Demo - COMPE output Toggle in LPM4; input channel C1;
    //                     Vcompare is compared against internal 2.0V reference
    //
    // Description: Use CompE and internal reference to determine if input'Vcompare'
    // is high or low.  When Vcompare exceeds 2.0V COUT goes high and when Vcompare
    // is less than 2.0V then CEOUT goes low.
    //
    //                MSP430FR5994
    //             ------------------
    //         /|\|                  |
    //          | |                  |
    //          --|RST        P1.1/C1|<--Vcompare
    //            |                  |
    //            |         P1.2/COUT|----> 'high'(Vcompare>2.0V); 'low'(Vcompare<2.0V)
    //            |                  |
    //
    //   William Goh
    //   Texas Instruments Inc.
    //   October 2015
    //   Built with IAR Embedded Workbench V6.30 & Code Composer Studio V6.1
    //******************************************************************************
    #include <msp430.h>

    int main(void)
    {
        WDTCTL = WDTPW | WDTHOLD;               // Stop WDT

        // Configure P1.1 as C1 and P1.2 as COUT
        P1SEL0 |= BIT1;
        P1SEL0 &= ~(BIT2);
        P1SEL1 |= BIT1 | BIT2;
        P1DIR |= BIT2;

        // Disable the GPIO power-on default high-impedance mode to activate
        // previously configured port settings
        PM5CTL0 &= ~LOCKLPM5;

        // Setup Comparator_E
        CECTL0 = CEIPEN | CEIPSEL_1;            // Enable V+, input channel CE1
        CECTL1 = CEPWRMD_1;                     // normal power mode
        CECTL2 = CEREFL_2 | CERS_3 | CERSEL;    // VREF is applied to -terminal
                                                // R-ladder off; bandgap ref voltage
                                                // supplied to ref amplifier to get Vcref=2.0V
        CECTL3 = BIT1;                          // Input Buffer Disable @P1.1/CE1
        CECTL1 |= CEON;                         // Turn On Comparator_E

        __delay_cycles(75);                     // delay for the reference to settle

        __bis_SR_register(LPM4_bits);           // Enter LPM4
        __no_operation();                       // For debug
    }

    Best regards,
    Dietmar Walther

  • In reply to Dietmar Walther:

    Dietmar, thanks you vey much !

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.