<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > s3c6410硬件WATCHDOG TIMER看門(mén)狗定時(shí)器

          s3c6410硬件WATCHDOG TIMER看門(mén)狗定時(shí)器

          作者: 時(shí)間:2016-11-19 來(lái)源:網(wǎng)絡(luò) 收藏
          先簡(jiǎn)述看門(mén)狗的工作過(guò)程,看門(mén)狗實(shí)際是一個(gè)定時(shí)器,內(nèi)部有個(gè)計(jì)數(shù)器,每當(dāng)時(shí)鐘信號(hào)到來(lái)時(shí),計(jì)數(shù)器寄存器減一。如果減到0,則重新啟動(dòng)系統(tǒng);如果在減到0之前,系統(tǒng)又設(shè)置計(jì)數(shù)器為一個(gè)較大的值,則系統(tǒng)不會(huì)重啟。系統(tǒng)正常時(shí),就不會(huì)重啟;當(dāng)系統(tǒng)發(fā)生故障時(shí),不能設(shè)置計(jì)數(shù)寄存器,系統(tǒng)重新啟動(dòng)。

          1、OVERVIEW 概述

          本文引用地址:http://www.ex-cimer.com/article/201611/318177.htm

          The 6410 RISC microprocessor watchdog timer is used to resume the controller operation whenever it is disturbedby 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.

          當(dāng)控制器操作被噪音或系統(tǒng)錯(cuò)誤等故障打斷時(shí),S3C6410 RISC 微處理器的看門(mén)狗定時(shí)器恢復(fù)控制器的操作。它可以產(chǎn)生復(fù)位信號(hào)。它可以用于16位的間隔定時(shí)器來(lái)要求中斷服務(wù)。。用WDT 代替PWM 定時(shí)器的優(yōu)點(diǎn)是WDT 產(chǎn)生復(fù)位信號(hào)。

          2、FEATURES 特性

          The Watchdog Timer includes the following features:
          • Normal interval timer mode with interrupt request.具有中斷請(qǐng)求的正常間隔定時(shí)器模式。
          • Internal reset signal is activated when the timer count value reaches 0 (time-out).

          當(dāng)定時(shí)器計(jì)數(shù)值達(dá)到0(超時(shí)),內(nèi)部復(fù)位信號(hào)有效。
          • Level-triggered Interrupt mechanism.電平觸發(fā)器中斷機(jī)制。

          3、FUNCTIONAL DESCRIPTION 功能說(shuō)明

          3.1、WATCHDOG TIMER OPERATION 時(shí)鐘控制



          The watchdog timer uses only PCLK as itssource 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 clockcycle:

          t_watchdog = 1/( PCLK / (Prescaler value + 1) / Division_factor )

          看門(mén)狗定時(shí)器用PCLK為時(shí)鐘源,通過(guò)一個(gè)8位預(yù)分頻器,預(yù)分頻系數(shù)有寄存器WTCON的(8~15)位決定。分頻后的頻率就相當(dāng)于PCLK/(WTCON[8-15]+1)。然后,通過(guò)一個(gè)4項(xiàng)分頻器,分頻系數(shù)分別是16、32、64、128.通過(guò)WTCON[4-3]位控制。

          控制寄存器的WTCON的第二位為1,則發(fā)出一個(gè)中斷信號(hào);第0位為1,則發(fā)出一個(gè)復(fù)位信號(hào)。

          3.2、WTDAT & WTCNT

          Once the watchdog timer is enabled, the value of watchdog timer data (WTDAT) register cannot be automaticallyreloaded into the timer counter (WTCNT). For this reason, an initial value must be written to the watchdog timercount (WTCNT) register, before the watchdog timer starts.

          一旦看門(mén)狗定時(shí)器有效,看門(mén)狗定時(shí)器數(shù)據(jù)(WTDAT)寄存器的值將不能被自動(dòng)重新載入定時(shí)器數(shù)(WTCNT)。在看門(mén)狗定時(shí)器開(kāi)始前,一個(gè)初始值必須寫(xiě)入看門(mén)狗定時(shí)器計(jì)數(shù)(WTDAT)寄存器。

          3.3、CONSIDERATION OF DEBUGGING ENVIRONMENT

          When the 6410 is in debug mode using Embedded ICE, the watchdog timer must not operate.

          當(dāng)S3C6410在調(diào)試模式(使用嵌入的ICE)時(shí),看門(mén)狗定時(shí)器不能進(jìn)行操作。

          4、寄存器:



          (1)、WTCON 寄存器允許用戶啟動(dòng)/禁止看門(mén)狗定時(shí)器,從四個(gè)不同的時(shí)鐘源選擇時(shí)鐘信號(hào),啟動(dòng)/禁止看門(mén)狗定時(shí)器輸出。

          (2)、WTDAT寄存器用于指定超時(shí)時(shí)間。當(dāng)看門(mén)狗作為定時(shí)器使用時(shí),當(dāng)計(jì)數(shù)器WTCNT的值到0時(shí),WTDAT寄存器的值會(huì)被自動(dòng)裝入WTCNT,并不會(huì)發(fā)出復(fù)位信號(hào)。

          (3)、正常操作情況下,WTCNT 寄存器包含看門(mén)狗定時(shí)器的當(dāng)前計(jì)數(shù)值。

          (4)、WTCLRINT 寄存器用于清除中斷。中斷服務(wù)完成后,中斷服務(wù)程序清除相關(guān)中斷。

          注:我的理解,其實(shí)看門(mén)狗定時(shí)器,包含兩個(gè)功能,一個(gè)是看門(mén)狗,另一個(gè)是定時(shí)器。

          當(dāng)不用于系統(tǒng)復(fù)位,只用于定時(shí)器功能,這時(shí)它的WTDAT寄存器才是有用的。

          當(dāng)它作為看門(mén)狗使用時(shí),WTDAT寄存器沒(méi)意義,你想一下,當(dāng)不能喂狗,系統(tǒng)復(fù)位時(shí),以前設(shè)置的參數(shù)還有意義嗎?所以只有用于定時(shí)器時(shí),發(fā)生中斷后,WTDAT寄存器的值自動(dòng)裝入WTCNT,開(kāi)始下一輪的定時(shí)。

          s3c6410在linux下的WATCHDOG TIMER(看門(mén)狗定時(shí)器)驅(qū)動(dòng)(1)的鏈接地址



          評(píng)論


          技術(shù)專(zhuān)區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();