• AVR Freaks

Hot!Is the watchdog timer RC truly independent?

Author
neworld
Junior Member
  • Total Posts : 101
  • Reward points : 0
  • Joined: 2011/03/04 14:18:23
  • Location: Calgary, Alberta, Canada
  • Status: offline
2020/09/21 10:31:15 (permalink)
0

Is the watchdog timer RC truly independent?

When the watchdog timer is enabled monitoring code execution, and the main oscillator disrupts or stops running due to clock source failure, does the WDT RC oscillator continue to run? If the WDT runs even when the main oscillator is not running is there a WDT reset generated if the main oscillator fails for a longer period than the WDT period?
#1

14 Replies Related Threads

    dan1138
    Super Member
    • Total Posts : 3918
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Is the watchdog timer RC truly independent? 2020/09/21 11:59:43 (permalink)
    5 (1)
    neworld
    When the watchdog timer is enabled monitoring code execution, and the main oscillator disrupts or stops running due to clock source failure, does the WDT RC oscillator continue to run? If the WDT runs even when the main oscillator is not running is there a WDT reset generated if the main oscillator fails for a longer period than the WDT period?

    Your question is actually about two different things.
     
    The Watchdog timer oscillator is independent but when the Watchdog asserts a reset this action alone will not restart a failed main oscillator. The Watchdog timer is intended to be used to assert a reset when the code fails to run as expected or to wake the controller from sleep.
     
    Most of the Microchip controllers have another feature call the Fail Safe Clock Monitor. This is a circuit that checks that the main oscillator is running and will switch to an internal clock source when a fault is detected.
    #2
    neworld
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2011/03/04 14:18:23
    • Location: Calgary, Alberta, Canada
    • Status: offline
    Re: Is the watchdog timer RC truly independent? 2020/09/21 12:07:47 (permalink)
    0
    Yes, I am aware of the 'Fail-Safe Clock Monitor' but specifically, if the watchdog timer expires during a period of time when the mian oscilator is not running, does the return of code execution not beging with a WDT reset? If not then the watchdog timer must be ANDED with the main oscilator?
    #3
    ric
    Super Member
    • Total Posts : 28677
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Is the watchdog timer RC truly independent? 2020/09/21 13:18:19 (permalink)
    5 (1)
    neworld
    Yes, I am aware of the 'Fail-Safe Clock Monitor' but specifically, if the watchdog timer expires during a period of time when the mian oscilator is not running, does the return of code execution not beging with a WDT reset? If not then the watchdog timer must be ANDED with the main oscilator?


    As Dan said, the WDT timer will NOT restart the clock. It is not a power on reset, so it does not change the clock selection.
    You must use the FSCM to recover from a stopped clock.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    dan1138
    Super Member
    • Total Posts : 3918
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Is the watchdog timer RC truly independent? 2020/09/21 13:31:20 (permalink)
    0
    neworld
    Yes, I am aware of the 'Fail-Safe Clock Monitor' but specifically, if the watchdog timer expires during a period of time when the mian oscilator is not running, does the return of code execution not beging with a WDT reset?

    A general answer to this question cannot be made. What actions the controller will take depends on the part in use.
     
    neworld
    If not then the watchdog timer must be ANDED with the main oscilator?

    You lost me with this question, I have no guess what you are trying to say.
    #5
    neworld
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2011/03/04 14:18:23
    • Location: Calgary, Alberta, Canada
    • Status: offline
    Re: Is the watchdog timer RC truly independent? 2020/09/21 14:02:06 (permalink)
    0
    Device: dsPIC33FJ256MC710A
     
    • No fail-safe clock monitor enabled.
    • WDT set for say 16 seconds.
    • Code stops running due to an external loss of a clock to main oscillator circuit for 30 seconds (longer than period of WDT).
    • Code resumes running; clock source is recovered.
     
    Does or does not the WDT execute a reset on the next instruction. If not then what happens?
    #6
    ric
    Super Member
    • Total Posts : 28677
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Is the watchdog timer RC truly independent? 2020/09/21 14:37:34 (permalink)
    0
    The WDT reset happens as soon as it expires, but it won't do anything else if the clock is not running. What restarts the clock in your scenario?

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #7
    neworld
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2011/03/04 14:18:23
    • Location: Calgary, Alberta, Canada
    • Status: offline
    Re: Is the watchdog timer RC truly independent? 2020/09/21 14:48:19 (permalink)
    4 (1)
    The clock source is intermittent. The board may have bad solder joints.
     
    Running some tests where I physically disconnect/connect the clock input shows the WDT very occasionally performs a reset. Majority of the time the code just continues running. Not a very satisfactory answer.
    post edited by neworld - 2020/09/21 14:51:52
    #8
    ric
    Super Member
    • Total Posts : 28677
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Is the watchdog timer RC truly independent? 2020/09/21 15:18:21 (permalink)
    0
    So in cases where it stops long enough to trigger the WDT, then when it starts running again it will perform the rest of the WDT reset.
    I am not clear on what you want to happen. Naturally your main concern should be fixing the intermittent clock.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #9
    dan1138
    Super Member
    • Total Posts : 3918
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Is the watchdog timer RC truly independent? 2020/09/21 15:31:34 (permalink)
    0
    neworld
    Device: dsPIC33FJ256MC710A
    • No fail-safe clock monitor enabled.
    • WDT set for say 16 seconds.
    • Code stops running due to an external loss of a clock to main oscillator circuit for 30 seconds (longer than period of WDT).
    • Code resumes running; clock source is recovered.
    Does or does not the WDT execute a reset on the next instruction. If not then what happens?

    If you are using the PLL with an external clock or crystal oscillator the kind of fault you described could cause a lot of havoc within the PLL module.
     
    The dsPIC33FJ256MC710A will not work well when the input clock fails to meet the specifications.
     
    I do not recall any specification that allows a PIC to operate with the PLL enabled and a DC clock source.
    #10
    neworld
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2011/03/04 14:18:23
    • Location: Calgary, Alberta, Canada
    • Status: offline
    Re: Is the watchdog timer RC truly independent? 2020/09/21 15:40:06 (permalink)
    0
    Well, that is not what is happening! At least I could only get two occasions that followed that logic. All other times the code simply resumes to execute. Makes no sense.
    This isn't about what I want to happen. I am trying to resolve a failure of a device (two actually) that seems to point to an external crystal on the main oscillator. But I am not able to repeat it. I am getting inconsistent results.
    #11
    ric
    Super Member
    • Total Posts : 28677
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Is the watchdog timer RC truly independent? 2020/09/21 15:46:24 (permalink)
    0
    Just to be clear, are you sure it "resumes", and does not totally restart, like a power-on reset?
    As Dan said, the WDT is not designed to save you from clock problems, and out of spec clock to the PLL could cause anything to happen.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #12
    neworld
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2011/03/04 14:18:23
    • Location: Calgary, Alberta, Canada
    • Status: offline
    Re: Is the watchdog timer RC truly independent? 2020/09/21 16:02:47 (permalink)
    0
    Definitely resumes without a reset. The WDT is not meant to save me from any clock problems. The clock source is in spec.
    #13
    ric
    Super Member
    • Total Posts : 28677
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Is the watchdog timer RC truly independent? 2020/09/21 16:12:43 (permalink)
    5 (1)
    neworld
    ...
    The clock source is in spec.

    A stopped clock (DC) most certainly is NOT in spec for the PLL!
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #14
    NorthGuy
    Super Member
    • Total Posts : 6350
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: Is the watchdog timer RC truly independent? 2020/09/22 07:13:47 (permalink)
    0
    If WDT produces some sort of reset pulse, but the CPU clock is off, the CPU will not see the pulse. Therefore, it is entirely possible that when the clock resumes, the CPU will continue execution without reset.
     
    #15
    Jump to:
    © 2020 APG vNext Commercial Version 4.5