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.

MSP430G2313: The comparator will not work after watchdog reset

Part Number: MSP430G2313


Hi Team,

Here's an issue from the customer may need your help:

When working normally, the comparator outputs a square wave. 

The watchdog will reset the MCU after 1 second if the comparator output does not change. Use an oscilloscope to see that the watchdog keeps resetting. The comparator will work normally after hardware reset(short reset pin to ground). 

The source of interference is caused by another circuit board starting the motor. 

The probability of the problem is one in a few tenths to one in a few hundredths.

How to resolve this issue?

Thanks & Regards,

Yale Li

  • A watchdog reset issues a PUC, not a POR. The Comparator registers are only reset on a POR. [Ref F2 User Guide (SLAU144J) Table 21-1]

    It might be worth checking the Comparator initialization to see if any of it relies on the reset values of the registers. (Typically this suggests using "=" rather than "|=" to set them.)

  • Hi,

    Agree with Bruce's point. You might need to check initialization code here. 

    Best regards,

    Cash Hao

  • Hi All,

    Thanks for your help!

    My customer open Comparator in ISR of Timer:

    TA1CCTL0 &= ~CCIE ;
    if( ch == 0 )
    {
    
        EnableRxB;
        
        
        CACTL2 = P2CA4 + P2CA0 + P2CA3 + P2CA1 + CAF; //P1.2P1.5
    }
    else
    {
    
        EnableRxA;
        
        CACTL2 = P2CA4 + P2CA3 + P2CA1 + CAF;
    }
    CACTL1 = CAON ;
    
    EnableCap;

    The waveform was generated during ISR of Timer. He believe that the setting of Comparator is correct. And he suspect that the Comparator was "die".

    Thanks & Regards,

    Yale Li

  • Hi,

    In your title, you said the comparator will not work after a watchdog reset. And in the code, the comparator is configured in the ISR of timer. I found one known bug in the errata TAB22, which indicates that unwanted modification of the timer registers after watchdog timer PUC. If the timer is not working correctly, it could cause the comparator works wrong.

    Best regards,

    Cash Hao 

**Attention** This is a public forum