Chinaunix首页 | 论坛 | 博客
  • 博客访问: 111050
  • 博文数量: 70
  • 博客积分: 25
  • 博客等级: 民兵
  • 技术积分: 361
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-09 12:40
文章分类

全部博文(70)

文章存档

2013年(64)

2012年(4)

2011年(2)

我的朋友

分类: 其他平台

2013-08-21 08:55:10

OVERVIEW
The S3C2440A watchdog timer is used to resume the controller operation whenever it is disturbed by malfunctions(故障 )such a noise and system errors. It can be used as a normal 16-bit interval timer to request interrupt service. The watchdog timer generates the reset signal for 128 PCLK cycles.The watchdog timer uses only PCLK as its source clock.

FEATURES

— Normal interval timer mode with interrupt request
— Internal reset signal is activated for 128 PCLK cycles when the timer count value reaches 0 (time-out).

WATCHDOG TIMER OPERATION

The watchdog timer uses only PCLK as its source clock. The PCLK frequency is prescaled to generate the corresponding watchdog timer clock, and theresulting frequency is divided again.

当看门狗使能时,外围时钟PCLK为看门狗定时器的输入时钟,MINI2440在没有开启时钟时,采用外部晶振(又叫高频振荡器,它每秒钟产生固定频率时钟)提供的12MHz输入时钟频率,PCLK首先进入8位分频器Prescaler,其对PCLK进行分频,可以理解为对PCLK的除法运算,这样PCLK的时钟频率就变成PCLK/Prescaler value,其中分频器Prescaler的值可以在一定范围内自定义,然后经过分频的时钟经过除数因子选择器,这是在分频器的基础上再次对时钟信号进行降频,通过除数因子选择器,选择一个除数因子,然后过MUX复合器,这时输入时钟变成PCLK/ Prescaler value/除数因子,得到我们想要的输入时钟, 每个时钟周期都会将看门狗定时计数器WTCNT里的值减当计数器WTCNT里的值变为0时开始执行超时操作,首先,判断看门狗控制寄存器里bit2 WTCON[2]设置情况,如果为1则产生中断信号,引起系统中断,如果为0不做任何操作,进入复位信号产生器,如果 WTCON[0]位为1,则产生控制器复位信号,否则不做任何操作。每次超时操作之后,看门狗WTCON会自动加载看门狗数据寄存器WTDAT里的用户设置值,继续执行递减操作。


The prescaler(预分频器) value and the frequency division factor(频率除数因子) are specified in the watchdog timer control (WTCON) register. Valid prescaler values range from 0 to 28-1. The frequency division factor can be selected as 16, 32, 64, or 128. Use the following equation to calculate the watchdog timer clock frequency and the duration of each timer clock cycle: 
                    t_watchdog = 1/[ PCLK / (Prescaler value + 1) / Division_factor ] 
        t_watchdog:看门狗控制器递减时间间隔(单位:秒)


WTD 
sepical registers
WTDAT & WTCNT & WTCON
The WTDAT register is used to specify the time-out duration.(WTDAT 用于指定 WTCNT 的计数初值,但如果看门狗已经启动,WTDAT 中的值必须要等到本次计数超时后才会被装入)。
The WTCNT register contains the current count values for the watchdog timer during normal operation.



           
》》http://blog.csdn.net/mr_raptor/article/details/6555704

阅读(1294) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~