深入理解ARM体系架构(S3C6410)---S3C6410看门狗源码实例
ed by the Watchdog timer, enable the interrupt generation anddisable the Watchdog timer output for reset signal.
注意:Initial state of ‘Reset enable/disable’ is 1(reset enable). If user do notdisable this bit, S3C6410 will be rebooted in about 5.63sec (In the case ofPCLK is 12MHz). So at boot loader, this bit should be disabled before undercontrol of Operating System, or Firmware.
2、WATCHDOG TIMER DATA (WTDAT) REGISTER
WTDAT用于确定超时期限。WTDAT的内容在最初的定时器操作时不能自动加载到定时器计数其中。但使用0x8000将驱使第一次超时,在这种情况下,WTDAT的值将自动载入WTCNT。
The WTDATregister is used to specify the time-out duration. The content of WTDAT cannotbe automatically loaded into the timer counter at initial watchdog timeroperation. However, using 0x8000 (initial value of WTCNT)will drive the firsttime-out. Then, the value of WTDAT will be automatically reloaded into WTCNT.
3、WATCHDOG TIMER COUNT(WTCNT) REGISTER
The WTCNT register contains the current count values for the watchdogtimer during normal operation.
注意:The content of the WTDAT register cannot be automatically loaded into thetimer count register when the watchdog timer is enabled initially, so the WTCNTregister must be set to an initial value before enabling it.
定义寄存器:
- //watchdog
- #define
WTCON (*(volatile unsigned *)(0x7E004000)) - #define
WTDAT (*(volatile unsigned *)(0x7E004004)) - #define
WTCNT (*(volatile unsigned *)(0x7E004008))
初始化函数:
- void
init_watchdog() - {
WTDAT = 0xff; WTCNT = 0x8000; WTCON = 0XC021;//Prescaler value为6,16分频 - }
在mian函数中调用:
- init_watchdog();
- while(1);
ARM体系架构S3C6410看门 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)