@Hello Daniel,
Thank you for your support.
could you please share your complete tested source code.
I tried with toggling the LED while refreshing the watchdog , but LED is not toggling.
directly flashed the code and checked.
EVAL board has PS32K144HFVLL 0N77P controller chip.
PCC-> PCCn[PCC_PORTD_INDEX] = PCC_PCCn_CGC_MASK; /* Enable clock for PORT D */
PTD->PDDR |= 1<<0; /* Port D0: Data Direction= output */
PORTD->PCR[0] = 0x00000100; /* Port D0: MUX = ALT1, GPIO (to blue LED on EVB) */ WDOG->CNT = 0xD928C520; //unlock watchdog
DISABLE_INTERRUPTS();
while(((WDOG->CS & WDOG_CS_ULK_MASK) >> WDOG_CS_ULK_SHIFT) == 0); //wait until registers are unlocked
WDOG->TOVAL = 0x1E8480; // used the default clock configuration , not configured clock in the code //set the count to 2000000
WDOG->CS = WDOG_CS_EN(1) | WDOG_CS_CLK(1) | WDOG_CS_INT(0) |
WDOG_CS_WIN(0) | WDOG_CS_UPDATE(0);
while(((WDOG->CS & WDOG_CS_RCS_MASK ) >> WDOG_CS_RCS_SHIFT) == 0); //wait until new configuration takes effect
ENABLE_INTERRUPTS(); //enable global interrupt
while(1)
{
//PTD->PDDR = 1;
if(WDOG->CNT >= 0xF4240) //if count is equal or greater 1000000
{
DISABLE_INTERRUPTS(); // disable global interrupt
WDOG->CNT = 0xB480A602; // refresh watchdog
ENABLE_INTERRUPTS(); //
PTD->PTOR |= 1<<0;
}
}
Thanks,
Ambarish