Datasheet

Section 14 Watchdog Timer (WDT)
Rev. 4.00 Jun 06, 2006 page 386 of 1004
REJ09B0301-0400
14.5.5 OVF Flag Clear Condition
To clear OVF flag in WOVI handling routine, read TCSR when OVF=1, then write with 0 to
OVF, as stated above. When WOVI is masked and OVF flag is poling, if contention between OVF
flag set and TCSR read is occurred, OVF=1 is read but OVF can not be cleared by writing with 0
to OVF.
In this case, reading TCSR when OVF=1 two times meet the requirements of OVF clear condition.
Please read TCSR when OVF=1 two times before writing with 0 to OVF.
LOOP BTST.B #7,@TCSR ; OVF flag read
BEQ LOOP ; if OVF=1, exit from loop
MOV.B @TCSR,R0L ; OVF=1 read again
MOV.W #H’A521,R0 ; OVF flag clear
MOV.W R0,@TCSR ; :