infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 3 of 3

Thread: Diferenciating PORST pin and power on reset for watchdog test

  1. #1
    Beginner Beginner Jorge66 is on a distinguished road Jorge66's Avatar
    Join Date
    Jun 2016
    Location
    Geneva
    Posts
    28
    Points
    114.375

    Diferenciating PORST pin and power on reset for watchdog test

    Hello,

    We are using an XMC4500 in a safety critical application.
    We have an external Watchdog connected to PORST pin which will pull PORST down
    and perform a PORST reset if we do not service it periodically.

    So far so good...
    Now we need to test the Watchdog hardware at power on to make sure it works.

    To do that, we store a flag in some non volatile RAM, I was hopping to use GPR registers.
    But they are cleared by PORST.
    It is therefore impossible to differentiate a PORST from a Watchdog test puling down PORST pin.

    Does someone suggest me another Non volatile memory area that would persist to PORST ?
    ABM?
    Hibernate mode registers ?
    Has someone some experience or an idea on how to test an external WD circuit.

    Thanks a lot for your suggestions or ideas.

    Jorge
    Last edited by Jorge66; Nov 12th, 2018 at 02:24 AM.

  2. #2

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    441
    Hi,

    You cannot differentiate them because both events, power on reset and porst going down, triggers a PORST reset and the GPRs are reset by PORST
    A solution could be to connect the external WDT output to another pin and react on the rising edge or falling edge depending on your configuration executing a SystemReset() in the ISR of the external pin IRQ using the ERUs.
    Additionally maybe using something similar to the program below if VBAT is not connected to VDDP and uses its own supply.
    After the first power on reset the hibernate domain will be enabled. If you the external WDT pulls the PORST pin down, a PORST will happen but the Hibernate domain is kept enabled. Therefore we will write to the retention memory. This will be detected later on switching the LED on

    Code:
    int main(void)
    {
      XMC_GPIO_SetOutputHigh(LED1);
      XMC_GPIO_SetMode(LED1, XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN);
    
      if (XMC_SCU_HIB_IsHibernateDomainEnabled() == true)
      {
        if ((XMC_SCU_RESET_GetDeviceResetReason() & XMC_SCU_RESET_REASON_PORST) != 0)
        {
    	  XMC_SCU_WriteToRetentionMemory(0, 0xDEADBEEF);
    	}
      }
      else
      {
        XMC_SCU_HIB_EnableHibernateDomain();
        XMC_SCU_WriteToRetentionMemory(0, 0);
      }
    
      XMC_SCU_RESET_ClearDeviceResetReason();
    
      if (XMC_SCU_ReadFromRetentionMemory(0) == 0xDEADBEEF)
      {
        // PORST reset
        XMC_GPIO_SetOutputLow(LED1);
        XMC_SCU_WriteToRetentionMemory(0, 0);
      }
    
      /* Placeholder for user application code. The while loop below can be replaced with user application code. */
      while(1U)
      {
    
      }
    }
    Regards,
    Jesus
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    Beginner Beginner Jorge66 is on a distinguished road Jorge66's Avatar
    Join Date
    Jun 2016
    Location
    Geneva
    Posts
    28
    Points
    114.375

    PORST Watchdog test solution

    Hello Jesus,

    Good suggestion. In our custom board, the VBat is connected to 3V3, so it does not loose supply during reset.
    So I finally implemented something similar to what you suggest,
    it is a bit slow, but on power on we don't care much.
    And it works just fine !



    Thank you!
    Jorge

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.