Yulri's profile曾经的… 现在的… 未来的……PhotosBlogListsMore Tools Help

Blog


    October 06

    看门狗电路的概念和作用

      一般看门狗电路用来监视MCU内部程序运行状态,在程序跑飞或死锁情况下,可以自动复位。不过由于厂家、型号不同可能有些差别。  
        
       看门狗电路的工作原理是:当系统工作正常时,CPU将每隔一定时间输出一个脉冲给看门狗,即“喂狗”,若程序运行出现问题或硬件出现故障时而无法按时“喂狗”时,看门狗电路将迫使系统自动复位而重新运行程序。   主要作用是防止程序跑飞或死锁  

       看门狗电路其实是一个独立的定时器,有一个定时器控制寄存器,可以设定时间(开狗),到达时间后要置位(喂狗),如果没有的话,就认为是程序跑飞,就会发出RESET指令.

       看门狗实际上是一个计数器,一般给看门狗一个大数,程序开始运行后看门狗开始倒计数。如果程序运行正常,过一段时间CPU应发出指令让看门狗复位,重新开始倒计数。如果看门狗减到0就认为程序没有正常工作,强制整个系统复位。

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://yulri.spaces.live.com/blog/cns!BA395EEC9BAECA7A!990.trak
    Weblogs that reference this entry
    • None