KL82 Watchdog Refresh

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KL82 Watchdog Refresh

Jump to solution
1,546 Views
rtoma
Contributor III

Section 28.10, page 613 of the KL82 Reference manual has the following, vague, statement:

You must take care not only to refresh the watchdog within the watchdog timer's actual time-out period, but also provide enough allowance for the time it takes for the refresh sequence to be detected by the watchdog timer, on the watchdog clock.

Can someone give me some details here on how long does it take to refresh the watchdog?

The reason for asking this question is that I have used the Low Power Oscillator Clock (1kHz) as a clock source for the watchdog. However I've noticed that I need to wait at least 1 LPO clock cycle (1ms) in order for the watchdog to refresh. However I have failed to see anything mentioned about it in the Reference Manual, except in a previous section (28.4.3):

A valid refresh makes the watchdog timer restart on the next bus clock.

But this does not seem to hold when the LPO clock is selected. 

Thank you!

Labels (1)
Tags (2)
0 Kudos
1 Solution
1,378 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Radu Toma,

     About the watchdog refresh minimum  data, I have test it in our K series in the last year, it should be the same as the KL series.

    Yes, the time is not given in the reference manual, but I have test our K series about this data before, at last, I find the time is about 1.02 watchdog time, this is just my test result.

    From your test result, it also demonstrate that data.

    So, to ensure safety, I suggest you to use 2 watchdog time, if you are using LPO, I suggest you write the refresh operation at least 2ms.

Wish it helps you!

Have a great day,
Kerry

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!

View solution in original post

7 Replies
1,379 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Radu Toma,

     About the watchdog refresh minimum  data, I have test it in our K series in the last year, it should be the same as the KL series.

    Yes, the time is not given in the reference manual, but I have test our K series about this data before, at last, I find the time is about 1.02 watchdog time, this is just my test result.

    From your test result, it also demonstrate that data.

    So, to ensure safety, I suggest you to use 2 watchdog time, if you are using LPO, I suggest you write the refresh operation at least 2ms.

Wish it helps you!

Have a great day,
Kerry

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!

1,328 Views
m4l490n
Contributor V

@kerryzhou what do you mean by

write the refresh operation at least 2ms

At least every 2ms? or at least 2ms apart?

I ask because I'm having problems with the watchdog. It doesn't want to refresh. I'm also clocking it with the LPO with preescaler = 1 and a timeout period of 1000 ticks (1 second).

I'm just starting with the peripheral tests on a new project using the MK10DN512VLQ10 and the only code I have is main with this:

int main(void)
{

    /* Init board hardware. */
    BOARD_InitBootPins ();
    BOARD_InitBootClocks ();
    BOARD_InitBootPeripherals ();

#ifndef BOARD_INIT_DEBUG_CONSOLE_PERIPHERAL
    /* Init FSL debug console. */
    BOARD_InitDebugConsole ();
#endif

    PRINTF ("\n\nHello World\n");

    /* Force the counter to be placed into memory. */
    volatile static uint32_t i = 0;
    /* Enter an infinite loop, just incrementing a counter. */
    while (1)
    {
        WDOG_Refresh(WATCHDOG_PERIPHERAL);
        PRINTF ("i = %lu\n", (uint32_t)i);
        i++;
        /* 'Dummy' NOP to allow source level single stepping of
         tight while() loop */
        __asm volatile ("nop");
    }
    return 0;
}

 

I have single-stepped through the code and made sure that WDOG_Init(WATCHDOG_PERIPHERAL, &Watchdog_config); in peripherals.h is indeed being executed and the watchdog being initialized.

These are my watchdog peripheral configurations generated with the peripherals config tool:

const wdog_config_t Watchdog_config = {
  .clockSource = kWDOG_LpoClockSource,
  .prescaler = kWDOG_ClockPrescalerDivide1,
  .timeoutValue = 1000UL,
  .enableWindowMode = false,
  .windowValue = 0UL,
  .enableUpdate = true,
  .enableWdog = true,
  .workMode = {
    .enableWait = true,
    .enableStop = false,
    .enableDebug = false
  }, 
  .enableInterrupt = false
};

 

 Do you know what would be the problem? Am I refreshing the watchdog too frequently?

 

Thanks!!

0 Kudos
1,312 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi m4l490n

  Any new questions, please create the new question post, then our kinetis engineer will help you in your own case. Just don't follow the old resolved post, create your own new question.

  Thanks a lot for your understanding.

Best Regards,

Kerry

0 Kudos
1,306 Views
m4l490n
Contributor V

@kerryzhou 

I created a new question about a week ago and nobody has helped, that's why I started searching for a solution and stumbled upon this thread. I know it is closed, but I don't know what else to do.

0 Kudos
1,300 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi m4l490n

  Give me your created question link.

 

Best Regards,

Kerry

0 Kudos
1,293 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi m4l490n,

  Thanks for your sharing.

   I checked your post, you didn't create your question in the kinetis community, do you could you please create your question in the kinetis community again?

https://community.nxp.com/t5/Kinetis-Microcontrollers/bd-p/kinetis

  In the question content, please also add your chip partnumber, your SDK version, your IDE, etc.

 Then we will help you to check more details.

 

Best Regards,

Kerry

0 Kudos