欢迎访问ic37.com |
会员登录 免费注册
发布采购

C8051F016 参数 Datasheet PDF下载

C8051F016图片预览
型号: C8051F016
PDF下载: 下载PDF文件 查看货源
内容描述: 混合信号32KB ISP功能的Flash MCU系列 [Mixed-Signal 32KB ISP FLASH MCU Family]
分类和应用:
文件页数/大小: 171 页 / 5235 K
品牌: SILABS [ SILICON LABORATORIES ]
 浏览型号C8051F016的Datasheet PDF文件第92页浏览型号C8051F016的Datasheet PDF文件第93页浏览型号C8051F016的Datasheet PDF文件第94页浏览型号C8051F016的Datasheet PDF文件第95页浏览型号C8051F016的Datasheet PDF文件第97页浏览型号C8051F016的Datasheet PDF文件第98页浏览型号C8051F016的Datasheet PDF文件第99页浏览型号C8051F016的Datasheet PDF文件第100页  
C8051F000/1/2/5/6/7
C8051F010/1/2/5/6/7
13.8.1. Watchdog Usage
The WDT consists of a 21-bit timer running from the programmed system clock. The timer measures the period
between specific writes to its control register. If this period exceeds the programmed limit, a WDT reset is
generated. The WDT can be enabled and disabled as needed in software, or can be permanently enabled if desired.
Watchdog features are controlled via the Watchdog Timer Control Register (WDTCN) shown in Figure 13.3.
Enable/Reset WDT
The watchdog timer is both enabled and the countdown restarted by writing 0xA5 to the WDTCN register. The
user’s application software should include periodic writes of 0xA5 to WDTCN as needed to prevent a watchdog
timer overflow. The WDT is enabled and restarted as a result of any system reset.
Disable WDT
Writing 0xDE followed by 0xAD to the WDTCN register disables the WDT. The following code segment
illustrates disabling the WDT.
CLR
EA
; disable all interrupts
MOV
WDTCN,#0DEh ; disable software
MOV
WDTCN,#0ADh ; watchdog timer
SETB EA
; re-enable interrupts
The writes of 0xDE and 0xAD must occur within 4 clock cycles of each other, or the disable operation is ignored.
Interrupts should be disabled during this procedure to avoid delay between the two writes.
Disable WDT Lockout
Writing 0xFF to WDTCN locks out the disable feature. Once locked out, the disable operation is ignored until the
next system reset. Writing 0xFF does not enable or reset the watchdog timer. Applications always intending to use
the watchdog should write 0xFF to WDTCN in their initialization code.
Setting WDT Interval
WDTCN.[2:0] control the watchdog timeout interval. The interval is given by the following equation:
4
3+WDTCN[2:0]
x T
SYSCLK
, (where T
SYSCLK
is the system clock period).
For a 2MHz system clock, this provides an interval range of 0.032msec to 524msec. WDTCN.7 must be a 0 when
setting this interval. Reading WDTCN returns the programmed interval. WDTCN.[2:0] is 111b after a system
reset.
Figure 13.3. WDTCN: Watchdog Timer Control Register
R/W
Bit7
R/W
Bit6
R/W
Bit5
R/W
Bit4
R/W
Bit3
R/W
Bit2
R/W
Bit1
R/W
Bit0
Reset Value
xxxxx111
SFR Address:
0xFF
Bits7-0: WDT Control
Writing 0xA5 both enables and reloads the WDT.
Writing 0xDE followed within 4 clocks by 0xAD disables the WDT.
Writing 0xFF locks out the disable feature.
Bit4:
Watchdog Status Bit (when Read)
Reading the WDTCN.[4] bit indicates the Watchdog Timer Status.
0: WDT is inactive
1: WDT is active
Bits2-0: Watchdog Timeout Interval Bits
The WDTCN.[2:0] bits set the Watchdog Timeout Interval. When writing these bits,
WDTCN.7 must be set to 0.
Rev. 1.7
96