S3C6410硬件WATCHDOG TIMER(看门狗定时器)

先简述看门狗的工作过程,看门狗实际是一个定时器,内部有个计数器,每当时钟信号到来时,计数器寄存器减一。如果减到0,则重新启动系统;如果在减到0之前,系统又设置计数器为一个较大的值,则系统不会重启。系统正常时,就不会重启;当系统发生故障时,不能设置计数寄存器,系统重新启动。

1、OVERVIEW  概述

The 6410 RISC microprocessor watchdog timer is used to resume the controller operation whenever it is disturbed by malfunctions such as noise and system errors. The watchdog timer generates the reset signal. It can beused as a normal 16-bit interval timer to request interrupt service.Advantage in using WDT instead of PWM timer is that WDT generates the reset signal.

当控制器操作被噪音或系统错误等故障打断时,S3C6410 RISC 微处理器的看门狗定时器恢复控制器的操作。它可以产生复位信号。它可以用于16位的间隔定时器来要求中断服务。。用WDT 代替PWM 定时器的优点是WDT 产生复位信号。

2、FEATURES  特性

The Watchdog Timer includes the following features:

• Normal interval timer mode with interrupt request.具有中断请求的正常间隔定时器模式。

• Internal reset signal is activated when the timer count value reaches 0 (time-out).

当定时器计数值达到0(超时),内部复位信号有效。

• Level-triggered Interrupt mechanism.电平触发器中断机制。

3、FUNCTIONAL DESCRIPTION 功能说明

3.1、WATCHDOG TIMER OPERATION 时钟控制

S3C6410硬件WATCHDOG TIMER(看门狗定时器)

S3C6410硬件WATCHDOG TIMER(看门狗定时器)

The watchdog timer uses only PCLK as its source clock. 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 )

看门狗定时器用PCLK为时钟源,通过一个8位预分频器,预分频系数有寄存器WTCON的(8~15)位决定。分频后的频率就相当于PCLK/(WTCON[8-15]+1)。然后,通过一个4项分频器,分频系数分别是16、32、64、128.通过WTCON[4-3]位控制。

控制寄存器的WTCON的第二位为1,则发出一个中断信号;第0位为1,则发出一个复位信号。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/ppsjx.html