3.S5PV210中看门狗定时器(WDT)概述

来源:互联网 发布:淘宝发错货买家不寄回 编辑:程序博客网 时间:2024/05/22 13:27
WATCHDOG TIMER(看门狗定时器)
看门狗定时器比较简单,而且很多的说明和PWM定时器类似。

3.1 OVERVIEW OF WATCHDOG TIMER
看门狗概述
The Watchdog Timer (WDT) in S5PV210 is a timing device that resumes the controller operation after
malfunctioning due to noise and system errors. WDT can be used as a normal 16-bit interval timer to request interrupt service. The WDT generates the reset signal.The difference between WDT and PWM timer is that WDT generates the reset signal.
看门狗定时器(WDT)是S5PV210中的一个定时设备,它可以在由于噪音和系统错误等引起的故障后恢复系统操作。看门狗还能被作为一个内部的16位定时器完成请求中断服务。看门狗也能产生一个复位信号。PWM定时器和看门狗定时器不用之处就是PWM定时器可以产生复位信号。


3.2 KEY FEATURES OF WATCHDOG TIMER
* Supports Normal interval timer mode with interrupt request
* Activates Internal reset signal if the timer count value reaches 0 (Time-out).
* Supports Level-triggered Interrupt mechanism

看门狗定时器的关键特性

* 支持正常的内部定时模式并产生中断请求

* 如果内部计数器的值到达0就会激活内部复位信号
* 支持电平触发中断机制



3.3 FUNCTIONAL DESCRIPTION OF WATCHDOG TIMER
看门狗定时器功能描述
3.3.1 WATCHDOG TIMER OPERATION



The watchdog timer uses PCLK as its source clock. The PCLK frequency is prescaled to generate the corresponding watchdog timer clock, and the resulting frequency is divided again.
看门狗定时器使用PCLK信号作为它的时钟源。然后PCLK时钟频率再经过预分频产生相应的定时器时钟,最后再通过分频作为最终结果。
The prescaler value and frequency division factor are specified in the watchdog timer control (WTCON) register.Valid prescaler values range from 0 to 2^8-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 )
预分频器的值和分频器的值通过WTCON寄存器设置。预分频器的有效值范围为0~2^8-1。分频器的值能被设置为16/32/64/128。可以通过下面的方程来计算看门狗定时器的时钟频率和每次定时器的时钟周期。
* t_watchdog = 1/( PCLK / (Prescaler value + 1) / Division_factor )


3.3.2 WTDAT AND WTCNT
Once the watchdog timer is enabled, the value of watchdog timer data (WTDAT) register cannot be automatically reloaded into the timer counter (WTCNT). Therefore, an initial value must be written to the watchdog timer count (WTCNT) register, before the watchdog timer starts.
关于WTDAT和WTCNT:
第一次看门狗定时器被使能时,WTDAT寄存器的值不能自动装载进WTCNT中,所以在我们开始使用开门狗定时器之前,必须给WTCNT寄存器装入初值。


3.3.3 WDT START
To start WDT, set WTCON[0] and WTCON[5] as 1.
开始开门狗,设置WTCON[0] 和 WTCON[5]这两个位为1.

3.3.4 CONSIDERATION OF DEBUGGING ENVIRONMENT
The watchdog timer must not operate if the S5PV210 is in debug mode using Embedded ICE.
The watchdog timer determines from the CPU core signal (DBGACK signal) whether it is currently in the debug mode. Once the DBGACK signal is asserted, the reset output of the watchdog timer is not activated as the watchdog timer expires.
考虑调试的环境
如果S5PV210在使用ICE调试时,看门狗定时器不能运行。看门狗根据CPU内核的信号(DBGACK信号)来确定当前是否为调试模式。一旦出现DBGACK信号,看门狗定时器默认复位输出信号不被激活。
原创粉丝点击