微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 深入理解ARM体系架构(S3C6410)---S3C6410看门狗源码实例

深入理解ARM体系架构(S3C6410)---S3C6410看门狗源码实例

时间:11-09 来源:互联网 点击:

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.

定义寄存器:

  1. //watchdog
  2. #defineWTCON(*(volatileunsigned*)(0x7E004000))
  3. #defineWTDAT(*(volatileunsigned*)(0x7E004004))
  4. #defineWTCNT(*(volatileunsigned*)(0x7E004008))


初始化函数:

  1. voidinit_watchdog()
  2. {
  3. WTDAT=0xff;
  4. WTCNT=0x8000;
  5. WTCON=0XC021;//Prescalervalue为6,16分频
  6. }

在mian函数中调用:

  1. init_watchdog();
  2. while(1);


Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top