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.

TMS320F28335: 看门狗上电复位

Part Number: TMS320F28335

在运行如下看门狗上电复位的程序时,连接仿真器在线烧录每次运行的结果都不一样,这一次进入了if循环成功复位,下一次就会进入else循环,没有复位成功。当断掉仿真器,烧到flash中进行离线操作时,一样的程序和在线时运行的结果不同。我是通过数码管来判断其是否复位成功,在线烧录和离线烧录时数码管显示都不一样,请问这是什么原因?如何解决?

  • 你好,你的意思是,每次上电复位的运行结果都是if和else交替的?在线的时候有没有观测此时WDCR寄存器中的值是多少?

  • 你好,遇到同样的问题,并不是每次Power Up程序都会进入if条件,怀疑WDCR寄存器的FLAG位不准确。请问楼主解决了吗?

  • 您好,请问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.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    void SoftWDReset(void)
    {
    if((SysCtrlRegs.WDCR&0x0080) == 0)//
    {
    EALLOW;
    // 使
    GpioDataRegs.GPBCLEAR.bit.GPIO49 = 1;
    while(Conut2<200)
    {
    Conut2++;
    }
    //GPIO49400us
    SysCtrlRegs.WDCR= 0x00B8; //0xB8//使
    EDIS;
    // SysCtrlRegs.WDCR= 0x0000; //
    // DELAY_US(50);
    }
    else
    {
    EALLOW;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX