您的位置: OpenADSP社区论坛 -> SHARC/TigerSHARC专区 -> 新手上路 -> 21489处理器上的看门狗代码
本帖共有508个阅读者
发表帖子 发表投票 回复主题
21489处理器上的看门狗代码
尊贵身份标志
OpenADSP(管理员)
OpenADSP
头衔:社区公民
帮派:无帮无派
帖数:5187
金钱:34761
积分:6369
注册时间:2011/6/7
楼主信息 | 留言 | Email | 主页 | 编辑 | 管理 | 离线
21489处理器上的看门狗代码
问题:21489开发板上看门狗的相关代码有吗?

我是OP...
等级:管理员 参考IP地址:*.*.*.*
2016/5/9 18:35:04
尊贵身份标志
OpenADSP(管理员)
OpenADSP
头衔:社区公民
帮派:无帮无派
帖数:5187
金钱:34761
积分:6369
注册时间:2011/6/7
1信息 | 留言 | Email | 主页 | 编辑 | 管理 | 离线
答:不好意思,我也没有例子,下面是ezone上的一段代码,你可以看看有没有帮助


void Init_WDT(void)

{

      int n=0;


     *pWDTUNLOCK = 0xAD21AD21;               // Before writing to the WDT configuration space, UNLOCK WDT by writing the command value 0xAD21AD21


     *pWDTCLKSEL = WDT_CLK_SRC_CER_RESO;     // Selects an external clock (0x0000000)


     *pWDTTRIP = 0x7;                         // number of times that the WDT can expire before /WDTRSTO pin is continually asserted until the next time hardware reset is                                   applied


     *pWDTCNT = 0x3FFFFF;                    // 32-bit unsigned count value - 2MHz external clock ---> T=500ns

    

     // 0x3FFFFF = (d)4194303

      // 500ns * 4194303 = 2.09 sec

      // Wait before enable Watchdog timer

     // WDT effect latency - 2.5 WDTCLK cycles at 2 MHz


     for(n = 0; n < 50000; n++ )          //**** Was 500

      {

      asm("nop;");

      }


     *pWDTCTL = WDT_EN;                         // Enable the Watchdog timer

      *pWDTUNLOCK = 0;                         // After configuring the WDT registers, the core needs to LOCK it again by writing any value other than the command value

}

我是OP...
等级:管理员 参考IP地址:*.*.*.*
2016/5/9 18:35:33
Powered by OpenADSP Copyright © 2010 www.Openadsp.com. All rights reserved.154146 Call, 1 Queries, Processed in 0.015625 second(s),