Hi,
We have a board with the K60 processor where we initiate the Watchdog to have one second timeout, and using the LPO Clock Source.
const wdog_config_t config = {
.clockSource = kWDOG_LpoClockSource,
.prescaler = kWDOG_ClockPrescalerDivide1,
.timeoutValue = 1000UL, // 1 sec WD timeout
.enableWindowMode = false,
.windowValue = 0UL,
.enableUpdate = true,
.enableWdog = true,
.workMode = {
.enableWait = true,
.enableStop = false,
.enableDebug = false},
.enableInterrupt = false
};
WDOG_Init(WDOG, &config);
Then we use the NXP function, WDOG_Refresh(WDOG), to reset the watchdog within the timeout.
This doesn't work, the controller enters reset.
If we change the clock source to kWDOG_AlternateClockSource, and update the .timeout Value to 48000000UL, to achieve one second timeout, it works.
Is there any thing we are missing for the LPO Clock Source mode?
Thanks in advance!
Code:
void WDOG_Refresh(WDOG_Type *base)
{
uint32_t primaskValue = 0U;
/* Disable the global interrupt to protect refresh sequence */
primaskValue = DisableGlobalIRQ();
base->REFRESH = WDOG_FIRST_WORD_OF_REFRESH;
base->REFRESH = WDOG_SECOND_WORD_OF_REFRESH;
EnableGlobalIRQ(primaskValue);
}
#define WDOG_FIRST_WORD_OF_REFRESH (0xA602U) /*!< First word of refresh sequence */
#define WDOG_SECOND_WORD_OF_REFRESH (0xB480U) /*!< Second word of refresh sequence */
Then we use the
Best Regards,
Rolf Lien