[size=11.818181991577148px]这两天调试了下c8051单片机看门狗,在代码中模拟不及时喂狗或者不喂狗的时候,单片机会完全进入死机状态,重启也没用,一直死机
[size=11.818181991577148px]求解是不是自己哪里配置问题
[size=11.818181991577148px]代码用的是范例程序,代码如下 :
[size=11.818181991577148px]void PCA_Init()
[size=11.818181991577148px]{
[size=11.818181991577148px] PCA0CN = 0x40; // PCA counter enable
[size=11.818181991577148px] PCA0MD &= ~0x40 ; // Watchdog timer disabled-clearing bit 6
[size=11.818181991577148px] PCA0MD &= 0xF1; // timebase selected - System clock / 12
[size=11.818181991577148px] PCA0CPL4 = 100; // Offset value
[size=11.818181991577148px] PCA0MD |= 0x40; // enable the WDT
[size=11.818181991577148px]}
[size=11.818181991577148px]PCA0CPH4 = 0x00; //喂狗
[size=11.818181991577148px]是还要进入看门狗中断里设置么?示例程序里没看到相关函数 |