9-2
Seiko Epson Corporation
S1C31D50 TECHNICAL MANUAL
(Rev. 1.00)
9.3.
Operations
9.3.1.
WDT2 Control
Activating WDT2
WDT2 should be initialized and started up with the procedure listed below.
1.
Write 0x0096 to the MSCPROT.PROT[15:0] bits.
(Remove system protection)
2.
Configure the WDT2 operating clock.
3.
Set the WDT2CTL.MOD[1:0] bits.
(Select WDT2 operating mode)
4.
Set the WDT2CMP.CMP[9:0] bits.
(Set NMI/reset generation cycle)
5.
Write 1 to the WDT2CTL.WDTCNTRST bit.
(Reset WDT2 counter)
6.
Write a value other than 0xa to the WDT2CTL.WDTRUN[3:0] bits. (Start up WDT2)
7.
Write a value other than 0x0096 to the MSCPROT.PROT[15:0] bits. (Set system protection)
NMI/reset generation cycle
Use the following equation to calculate the WDT2 NMI/reset generation cycle.
𝑡𝑊𝐷𝑇 =
𝐶𝑀𝑃 + 1
𝐶𝐿𝐾_𝑊𝐷𝑇2
(𝐸𝑞. 9.1)
Where
t
WDT
:
NMI/reset generation cycle [second]
CLK_WDT2:
WDT2 operating clock frequency [Hz]
CMP:
Setting value of the WDT2CMP.CMP[9:0] bits
Example)
t
WDT
= 2.5 seconds when CLK_WDT2 = 256 Hz and the WDT2CMP.CMP[9:0] bits = 639
Resetting WDT2 counter
To prevent an unexpected NMI/reset to be generated by WDT2, its embedded counter must be reset
periodically via software while WDT2 is running.
1.
Write 0x0096 to the MSCPROT.PROT[15:0] bits.
(Remove system protection)
2.
Write 1 to the WDT2CTL.WDTCNTRST bit.
(Reset WDT2 counter)
3.
Write a value other than 0x0096 to the MSCPROT.PROT[15:0] bits. (Set system protection)
A location should be provided for periodically processing this routine. Process this routine within
the t
WDT
cycle. After resetting, WDT2 starts counting with a new NMI/reset generation cycle.
Occurrence of counter compare match
If WDT2 is not reset within the tWDT cycle for any reason and the counter reaches the setting value
of the WDT2CMP.CMP[9:0] bits, a compare match occurs to cause WDT2 to issue an NMI or reset
according to the setting of the WDT2CTL.MOD[1:0] bits.
If an NMI is issued, the WDT2CTL.STATNMI bit is set to 1. This bit can be cleared to 0 by writing 1 to
the WDT2CTL.WDTCNTRST bit. Be sure to clear the WDT2CTL.STATNMI bit in the NMI handler
routine,
If a compare match occurs, the counter is automatically reset to 0 and it continues counting.
Deactivating WDT2
WDT2 should be stopped with the procedure listed below.
1.
Write 0x0096 to the MSCPROT.PROT[15:0] bits.
(Remove system protection)
2.
Write 0xa to the WDT2CTL.WDTRUN[3:0] bits.
(Stop WDT2)
3.
Write a value other than 0x0096 to the MSCPROT.PROT[15:0] bits. (Set system protection)
Summary of Contents for S1C31D50
Page 461: ...25 1 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 25 Package TQFP12 48PIN ...
Page 462: ...25 2 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP13 64PIN ...
Page 463: ...25 3 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 TQFP14 80PIN ...
Page 464: ...25 4 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP15 100PIN ...