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.

MSP430 Watchdog Reset does not reset all registers (PUC & POR)

Other Parts Discussed in Thread: MSP430FG437

Greetings,

I know that all the MSP430 devices that I have ever used only do a partial reset (called a PUC) for watchdog and other signals, and only do a full reset (called a POR) for power on & reset pin. The PUC reset leaves a few register bits unchanged, and the only way of finding out which is to review each register description in the data sheet.

What was the rationale behind this behaviour? Other processors treat a watchdog reset just like any other reset, and reset all registers the same way.

 

TomH

  • Hi Tom,

    PUC or power-up clear is triggered by either a POR or WDT timer expiration in watch dog mode or WDT/flash/PMM password violations or an invalid fetch from a peripheral area. The default values after a PUC are indicated by -0 or -1 in the respective register definitions in the users guide.

    One of the ways to determine if a PUC occured is to use the SYSRSTIV (reset interrupt vector) present on the F5xx/F6xx devices which can be used to determine the cause of the last reset that happened - BOR/POR/PUC.

    Regards,

    Bhargavi

     

  • Tom Harris said:
    The PUC reset leaves a few register bits unchanged, and the only way of finding out which is to review each register description in the data sheet.

    Indeed, some people have stubmled into this pit. Mostly because the small table telling you that the default values in teh register descritions can have more than one meaning, is place behind the typical preface blabla nobody wants to read, so it is easily missed.

    Tom Harris said:
    What was the rationale behind this behaviour?

    I can only guess, bu tthe main reason might be to separate resets caused by internal (software) failure from those caused by external influence (power fail, hard reset). A spftware failure may reset the device but will not reset soem hardware configurations. This includes part of the timer settings (so you can continue with uninterrupted timing, if you write your application properly), teh voltage supervisor and others.

    Basically, the WDT reset as well as others are aused by irregular software adn this is a CPU-only issue. So only peripherals that depend on program flow should be reset (USCIs etc.).
    Possibly on the very first MSP implementations more than jsut a few parts were unaffected by a WDT reset. But then it turned out that this behavior was too unexpected for most (expecting all in startup condition when their (C-)program starts.)

    Well unfortunately, older revisions of TI documents are removed when a new version is released.. I'm curious what was written in the first (preliminary) version of SLAU049 (I only have version C from 2003 and later)

  • Jens-Michael,

     

    Good answer, it looks like the MSP430 designers have tried to separate hardware errors (which require a full hardware reset) from software "faults" (which do not need a reset). However this does not look optimal to me, as suppose you get a runaway program which can potentially do anything before it gets stuck and triggers the watchdog. To recover from the error you really have to review the datasheet register listing very carefully and make sure that you set all the registers bits to the correct state.

     

  • Tom Harris said:
    However this does not look optimal to me, as suppose you get a runaway program which can potentially do anything before it gets stuck and triggers the watchdog. To recover from the error you really have to review the datasheet register listing very carefully and make sure that you set all the registers bits to the correct state.

    Yep. However, not being able to separate the two cases by design is the worse option.

    It's like with the watchdog. If you don't disable it at the beginning of your program, you might encounter unexplainable resets. Unexplainable until you discover teh WDT and handle it properly.

    However, the MSPGCC was disabling the WDT on default during startup (to avoid a WDT reset while initializing the variables on devices with much ram). This was worse, because there was no way for plain C users to have the WDT on all the time (for ESD based crashes in harsh environment,). I had to write my own version of the startup code in assembly, which isn't for everybody. If it were disabled as default in hardware, there would have been nothing I could have done at all.

    And I agree, yes, a good program should init all parts of the MSP (including those not really used or not specifically used) which may not be in default ocndition after a software (but not hardware) reset. On newer MSPs, there is even a way to force the different reset types. So you can simply check what the cause of the last restart was, and then force a BOR, resetting everything.

  • Hi Bhargavi,

                          These is use full to me. I have Some doubt in MSP430FG437 BASED PULSE OXIMETER PROGRAM. Please clear it.

     

    1) In SaO2 Look table

                // SaO2 Look - up Table

                const unsigned int Lookup [43] = { 100, 100, 100, 100, 99, 99, 99, 99, 99, 99, 98, 98 98 98, 98, 97, 97, 97
                                                                               97, 97, 97, 96, 96, 96, 96, 96, 96, 95, 95, 95, 95, 95, 95, 94, 94, 94,
                                                                                94,94, 93, 93, 93, 93, 93};

               What value of input will we get 100 as output in the lookup table? So also for 93 - 99 in the lookup table. what is the panic alarm that we may get if output of the Pulsoximeter source abnormal value?

    2) In FIR filter

    //FIR filter coefficient for removing 50/60Hz and 100/120Hz from the signals
    #if 0
    static const int16_t coeffs[9] =
    {
        5225,
        5175,
        7255,
        9453,
        11595,
        13507,
        15016,
        15983,
        16315
    };
    #else
    static const int16_t coeffs[12] =
    {
        688,
        1283,
        2316,
        3709,
        5439,
        7431,
        9561,
        11666,
        13563,
        15074,
        16047,
        16384
    };
    #endif

    What is referred to by the value 0 and these filter coefficient details?

     

             Regards

           Arun Prasad, M.D.,

       Silicon Technologies.

  • Hi Arun,

    #1

    The SaO2 is computed as the log ratios of the infrared and visible red ac signals measured in the pulsox set-up. And this log ratio is subtracted by the offset in order to correlate to the lookup table values.

     

    As mentioned in slaa458 - SaO2 look-up table defines the relationship between the ratio R and %SaO2 values and was first generated by extrapolating values from the “Empirical and Theoretical Ratio (R) to SaO2” curve, and then verified by taking two sets of readings of few subjects – first the correct SaO2 values from an actual pulsoximeter equipment (a Masimo instrument) and then the Ratio values (R) from the pulsox board.

    The companies who sell pulsoximeters as their end products develop their own SaO2 look-up table and the SaO2 look-up table used in the app note is a very simple implementation and is used for demo purposes only.

    #2

    Shall have to take a look at this and get back to you.

    Regards,

    Bhargavi

  • Hello Bhargavi, have you answered the #2 question somewhere else??,  i've been having difficulties trying to understand the whole thing about the  FIR filter coefficients. I read that  #if 0 ;  is used to disable certain parts of code in a programme so the coefficients to be used would be those after #else  ,but when I checked the frequency response, it doesn't look like a LPF of 6 Hz passband with an attenuated band of 50 Hz and above .

    Thanks in advance

**Attention** This is a public forum