深入理解ARM体系架构(S3C6410)---S3C6410看门狗源码实例
S3C6410看门狗定时器的功能:
The S3C6410XRISC microprocessor watchdog timer is used to resume the controller operation wheneverit is disturbed by malfunctions such as noise and system errors. The watchdogtimer generates the reset signal.
It can be usedas a normal 16-bit interval timer to request interrupt service.Advantagein using WDT instead of PWM timer is that WDT generates the reset signal.
FEATURES
The WatchdogTimer includes the following features:
• Normal interval timer mode with interruptrequest.
• Internal reset signal is activated when thetimer count value reaches 0 (time-out).
• Level-triggered Interrupt mechanism.
看门狗模块包括一个8位预分频器,一个分频器,一个16bit计数器。它的8位预分频器把PCLK分频后,再被分频得到4种频率,16分频,32分频,64分频,128分频。WatchDog可以选择工作于哪种频率下。S3C2440用3个寄存器对WatchDog进行操作:
看门狗定时器计数寄存器(WTCNT)
Figure 34-1shows the functional block diagram of the watchdog timer. The watchdog timeruses only PCLK as its source clock. The PCLK frequency is prescaled to generatethe corresponding watchdog timer clock, and the resulting frequency is dividedagain.
The prescalervalue and the frequency division factor are specified in the watchdog timercontrol (WTCON)register. Valid prescaler values range from 0 to 28-1. Thefrequency division factor can be selected as 16, 32, 64,or 128.
Use thefollowing equation to calculate the watchdog timer clock frequency and theduration of each timer clock cycle:
t_watchdog = 1/( PCLK / (Prescaler value + 1) / Division_factor )
注意:
1、Once the watchdog timer is enabled, the value ofwatchdog timer data (WTDAT) register cannot be automatically reloaded into thetimer counter (WTCNT). For this reason, an initial value must be written to thewatchdog timer count (WTCNT) register, before the watchdog timer starts.
2、When the S3C6410 is in debug mode using EmbeddedICE, the watchdog timer must not operate.The watchdog timer can determinewhether or not it is currently in the debug mode from the CPU coresignal(DBGACK signal). Once the DBGACK signal is asserted, the reset output ofthe watchdog timer is not activated as the watchdog timer is expired.
看门狗寄存器映射:
1、WATCHDOG TIMER CONTROL(WTCON) REGISTER
WTCON允许用户使能看门狗定时器,从不同四个源选择时钟,使能中断,使能看门狗定时器输出。S3C6410看门狗定时器用于系统故障后复位。如果不希望复位,则使能定时器无效。
The WTCONregister allows the user to enable/disable the watchdog timer, select the clocksignal from 4 different sources, enable/disable interrupts, and enable/disablethe watchdog timer output.
The Watchdogtimer is used to resume the S3C6410 restart on mal-function after its power on.At this time,disable the interrupt generation and enable the Watchdog timeroutput for reset signal.
If controllerrestart is not desired and if the user wants to use the normal timer only,which is provid
ARM体系架构S3C6410看门 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)