This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在运行如下看门狗上电复位的程序时,连接仿真器在线烧录每次运行的结果都不一样,这一次进入了if循环成功复位,下一次就会进入else循环,没有复位成功。当断掉仿真器,烧到flash中进行离线操作时,一样的程序和在线时运行的结果不同。我是通过数码管来判断其是否复位成功,在线烧录和离线烧录时数码管显示都不一样,请问这是什么原因?如何解决?
您好,请问28335的看门狗模块,在POWER Up的时候 WDCR寄存器中FLAG的值确定是0吗?我测试的时候,上电(POWER UP)时FLAG得值有时是1有时是0. 请问为什么?
POWER UP 后RST引脚变高,WDRST信号也会变高,WDRST有个上升沿,此时FLAG是0还是1?按照《TMS320x2833x System Control and
Interrupts Reference Guide》文件(Literature Number: SPRUFB0)3.4.5节的描述,此时FLAG可能是1?那这样是不是错的?
When the XRS line is low, the WDFLAG bit is forced low. The WDFLAG bit is only set if a rising edge on
WDRST signal is detected (after synch and an 8192 SYSCLKOUT cycle delay) and the XRS signal is
high. If the XRS signal is low when WDRST goes high, then the WDFLAG bit remains at 0. In a typical
application, the WDRST signal connects to the XRS input. Hence to distinguish between a watchdog reset
and an external device reset, an external reset must be longer in duration then the watchdog pulse.
void SoftWDReset(void) { if((SysCtrlRegs.WDCR&0x0080) == 0)//硬件复位或者上电 { EALLOW; //刚上电 使能看门狗 GpioDataRegs.GPBCLEAR.bit.GPIO49 = 1; while(Conut2<200) { Conut2++; } //从GPIO49变低到发出复位信号400us SysCtrlRegs.WDCR= 0x00B8; //0xB8//使能看门狗 触发软件复位 清除硬件复位标志 EDIS; // SysCtrlRegs.WDCR= 0x0000; //触发软件复位 // DELAY_US(50); } else { EALLOW; //清除软件复位标志 //关闭看门狗 SysCtrlRegs.WDCR = 0x00E8; GpioDataRegs.GPBCLEAR.bit.GPIO48 = 1; //SysCtrlRegs.WDCR = 0x0068; EDIS; //关闭看门狗 // SysCtrlRegs.WDCR = 0x0068; //0x0068 清除FLAG 关闭使能 } }