- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I enable the window watchdog in INIT state and it can move to NORMAL state. Then, when I make an overflow and restart the program to initialize the IC, it stuck/returns/stops in INIT state.
However, when I disable watchdog once, then the IC wouldn't be stuck in INIT state.
I set INITERR = 11111100 to clear the failure flag. And read the status flags from 1A to 1F, there is no error.
If I don't want to disable the watchdog once in INIT, what should I do? Or What mistake did I make?
Best Regards,
Leon
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Leon,
There are only two ways to avoid the window watchdog failure. One is by disabling the watchdog and the other one is having a proper trigger from the microcontroller. As soon as the device is in the init state, it opens a long window period and expects a trigger from the microcontroller. The trigger can be provided by setting WWDSCMD:bit0 from 1 to 0. Each open window expects a trigger. A valid triggering pattern is also given below.
Please try the triggering and let me know the update.
Regards
Vishnu Nambrath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Leon,
The window watchdog will become active in INIT state as soon as reset output pin ROT turns from low to high.
After activation, the watchdog opens a so called “Long Open Window” (LOW) of duration of t_LOW. During the ”Long
Open Window” the window watchdog expects a valid triggering, which has to be provided via SPI in case the
default configuration is kept, since any signal to watchdog trigger pin WDI is ignored. This is to avoid wrong
triggering at pin WDI due to glitches at the microcontroller outputs during startup and initialization. Each open window expects a trigger and each closed window does not expect a trigger from the microcontroller.
I have given an example here for the valid triggering pattern. You can see here, each open window has a trigger and the closed window doesn't have a trigger.
One of the fault operation of the Window watchdog is given below. You can see, no trigger in the first open window.
Multiple fault operations are given in the datasheet section "15.2.1 Timing Diagrams"
Coming to your question related to INITERR. Failure bits are logged into this register for the INIT state. Address of this register is 1B and default value is 00. You can read this register to check if there any failures logged in the INIT state. I am sorry, I didn't understand your statement "I set INITERR = 11111100 to clear the failure flag. And read the status flags from 1A to 1F, there is no error".
Regards
Vishnu N
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your answer, but I'm trying to ask how to reset the watchdog.
INITERR is the name of register 1B on the datasheet, I'm trying to clear the fault by writing 1.
After making an overflow, I try to reload the program:
1. read the Failure register 1A to 1F.
2. clear the Failure register.
3. read the Failure register.
4. init chip->NORMAL.
The Failure register is 00 in step 3. The problem is that step 4 is fail, then I reload it and I find the failure register hasn't been clear in step 2.
However, when I disable the watchdog in 4, then reload and enable watchdog, there is no error.
Best Regards,
Leon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Leon,
There are only two ways to avoid the window watchdog failure. One is by disabling the watchdog and the other one is having a proper trigger from the microcontroller. As soon as the device is in the init state, it opens a long window period and expects a trigger from the microcontroller. The trigger can be provided by setting WWDSCMD:bit0 from 1 to 0. Each open window expects a trigger. A valid triggering pattern is also given below.
Please try the triggering and let me know the update.
Regards
Vishnu Nambrath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.
The problem is solved. I enable watchdog in the NORMAL state and trigger WDI by an interrupt.
However, I meet another problem that I don't understand.
When I set the watchdog error threshold below 3, then I make a watchdog error and read the flag 1B, 1C, and 1D. The 1B show there is an overflow error, but 1C and 1D did not show the error.
However, when the watchdog error threshold >= 3, 1C and 1D will show the error. Why?
Best regards,
Leon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Leon,
Thank you for the acknowledgment of the first issue.
How you are setting the watchdog error count? Which register you are using?
Can you please let me know value of IB, IC, ID after power on reset and during each watchdog failure till the watchdog overflow in both cases?
Regards
Vishnu N
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Vishnu,
Do you mean the WDCFG0 & 1? WDCFG0=0xX9 (X is the threshold), WDCFG1= 0x0f.
when the X is set >=3:
watchdog failusre: 1B = 0x00 1C =0x81 1D = 0x02.
watchdog overflow: 1B = 0x08 1C =0x81 1D = 0x02
power-on reset: 1B = 0x08 1C =0x81 1D = 0x02
when the X is set <3, When watchdog overflow
watchdog overflow: 1B = 0x08 1C =0x00 1D = 0x00
power-on reset: 1B = 0x08 1C =0x00 1D = 0x00
it seem the chip directly jump to INIT state, then the 1D and 1C isn't triggered.
Best Regards,
Leon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Leon,
I have one doubt regarding the register settings WDCFG0. You are enabling the window watchdog, disabling the functional watchdog, and triggering via WDI Pin. It's supposed to be via SPI right?
So WWDTSEL should be '1' right?
WDCFG0=0xX9 = 0011 1001 (X is considered as '3')
Please read the registers just after the power on reset, while reading it supposed to be the reset values given in the datasheet. For example 1B should be '00' after power on reset. But it different from your reading. Can you please check this as well
After this please change the error threshold and read the registers as mentioned previously.
Regards
Vishnu N