
ML62Q1000 Series User's Manual
Chapter 10 Watchdog Timer
FEUL62Q1000
10-10
10.3.1 How to Clear WDT Counter
The WDT counter can be cleared by writing "0x5A" to the WDTCON register with the WDP bit set to "0", then writing
"0xA5" to the WDTCON register with the WDP bit set to "1" while WDT counter clearing is enabled.
The WDP bit is reset to "0" when the system is reset as well as when the WDT counter overflows. It is reversed every
time data is written to the WDTCON register.
The following diagram shows the WDT counter clearing timing chart.
Figure 10-3 WDT Counter Clearing Timing Chart
The following description shows a sample program script of the watchdog timer.
void wdt_clear( void )
{
unsigned char pswval;
if(WDTCLR1 == 1) {
// Checking presence of pending clearing process
return;
};
if(WDTCLR2== 1) {
// Checking whether clearing process is pending or completed
return;
};
pswval = s_drvcommon_getPSW();
// Saving PSW
_DI();
// Interrupt disabled (clearing MIE bit)
do {
WDTCON = 0x5A;
// WDT counter clearing
} while (WDP != 1 );
WDTCON = 0xA5;
if ((pswval & 0x08) != 0) {
// Confirming MIE bit
_EI();
// Interrupt enabled (setting MIE bit)
}
static unsigned char s_drvcommon_getPSW( void ){
#pragma asm
mov r0,psw
rt
#pragma endasm
}
Figure 10-4 Sample Program Script of Watchdog Timer
Writing of "0xA5"
System clock
WDTCON Write
WDTCLR1
WDT counter
WDP bit
WDTCLR2
WDT clock
0
n
n-1
n-2
Writing of "0x5A"
Содержание ML62Q1000 Series
Страница 17: ...Chapter 1 Overview...
Страница 112: ...Chapter 2 CPU and Memory Space...
Страница 154: ...Chapter 3 Reset Function...
Страница 166: ...Chapter 4 Power Management...
Страница 196: ...Chapter 5 Interrupts...
Страница 248: ...Chapter 6 Clock generation Circuit...
Страница 274: ...Chapter 7 Low Speed Time Base Counter...
Страница 291: ...Chapter 8 16 Bit Timer...
Страница 320: ...Chapter 9 Functional Timer FTM...
Страница 382: ...Chapter 10 Watchdog Timer...
Страница 402: ...Chapter 11 Serial Communication Unit...
Страница 456: ...Chapter 12 I2 C Bus Unit...
Страница 491: ...Chapter 13 I2 C Master...
Страница 512: ...Chapter 14 DMA Controller...
Страница 531: ...Chapter 15 Buzzer...
Страница 550: ...Chapter 16 Simplified RTC...
Страница 559: ...Chapter 17 GPIO...
Страница 594: ...Chapter 18 External Interrupt Function...
Страница 612: ...Chapter 19 CRC Generator...
Страница 632: ...Chapter 20 Analog Comparator...
Страница 644: ...Chapter 21 D A Converter...
Страница 655: ...Chapter 22 Voltage Level Supervisor...
Страница 676: ...Chapter 23 Successive Approximation Type A D Converter...
Страница 709: ...Chapter 24 Regulator...
Страница 714: ...Chapter 25 Flash Memory...
Страница 743: ...Chapter 26 Code Option...
Страница 750: ...Chapter 27 LCD Driver...
Страница 788: ...Chapter 28 On Chip Debug Function...
Страница 795: ...Chapter 29 Safety Function...
Страница 813: ...Appendix A...
Страница 881: ...Revision History...