歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> S3C6410硬件WATCHDOG TIMER(看門狗定時器)

S3C6410硬件WATCHDOG TIMER(看門狗定時器)

日期:2017/3/1 10:22:37   编辑:Linux編程

先簡述看門狗的工作過程,看門狗實際是一個定時器,內部有個計數器,每當時鐘信號到來時,計數器寄存器減一。如果減到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 時鐘控制

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,則發出一個復位信號。

Copyright © Linux教程網 All Rights Reserved