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.

Software reset doesn't work

Hi,

I'm trying to make a software reset using the watchdogs interrupt. First of all, I set up the registers as below (I tried to follow the TI example):

//PieVectTable.WAKEINT = &WAKEINT_ISR;
PieVectTable.WAKEINT = &wakeint_isr;
EDIS; // This is needed to disable write to EALLOW protected registers
EALLOW;
SysCtrlRegs.SCSR = BIT1;
EDIS;
// Reset the watchdog counter
ServiceDog();

WakeCount=0;

// Enable the watchdog
EALLOW;
SysCtrlRegs.WDCR = 0x0038;
EDIS;

Besides this, I define the interrupt function:

interrupt void wakeint_isr(void)
{
WakeCount++;

// Acknowledge this interrupt to get more from group 1
// PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
if(WakeCount>=1500)
{
EALLOW;
SysCtrlRegs.WDCR=0x0038;//reset
EDIS;
}
// Acknowledge this interrupt to get more from group 1
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}

What is the problem? I see as WakeCount stops to increase, but SysCtrlRegs.WDCR=0x0038; doesn’t make a reset (at least I can’t see in my device).

Any idea? Thank you in advance.

  • Sorry, 

    I am using the following:

    CCSv53 (version 3.3)
    Blackhawk USB 2000 Emulator
    TSM320F28016 on our custom board

  • Could anyone from TI answer my question? In order to clarify my question, I copy my code (It'i quite similar to wathdog example code). Thank you.

    void main(void)
    {


    InitSysCtrl();

    // Step 2. Initalize GPIO:
    // This example function is found in the DSP280x_Gpio.c file and
    // illustrates how to set the GPIO to it's default state.
    // InitGpio(); // Skipped for this example

    // Step 3. Clear all interrupts and initialize PIE vector table:
    // Disable CPU interrupts
    DINT;

    // Initialize PIE control registers to their default state.
    // The default state is all PIE interrupts disabled and flags
    // are cleared.
    // This function is found in the DSP280x_PieCtrl.c file.
    InitPieCtrl();

    // Disable CPU interrupts and clear all CPU interrupt flags:
    IER = 0x0000;
    IFR = 0x0000;

    // Initialize the PIE vector table with pointers to the shell Interrupt
    // Service Routines (ISR).
    // This will populate the entire table, even if the interrupt
    // is not used in this example. This is useful for debug purposes.
    // The shell ISR routines are found in DSP280x_DefaultIsr.c.
    // This function is found in DSP280x_PieVect.c.
    InitPieVectTable();

    // Interrupts that are used in this example are re-mapped to
    // ISR functions found within this file.
    EALLOW; // This is needed to write to EALLOW protected registers
    PieVectTable.WAKEINT = &wakeint_isr;
    EDIS; // This is needed to disable write to EALLOW protected registers

    // Step 4. Initialize all the Device Peripherals:
    // This function is found in DSP280x_InitPeripherals.c
    // InitPeripherals(); // Not required for this example

    // Step 5. User specific code, enable interrupts:

    // Clear the counters
    WakeCount = 0; // Count interrupts
    LoopCount = 0; // Count times through idle loop

    // Connect the watchdog to the WAKEINT interrupt of the PIE
    // Write to the whole SCSR register to avoid clearing WDOVERRIDE bit
    EALLOW;
    SysCtrlRegs.SCSR = BIT1;
    EDIS;

    // Enable WAKEINT in the PIE: Group 1 interrupt 8
    // Enable INT1 which is connected to WAKEINT:
    PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block
    PieCtrlRegs.PIEIER1.bit.INTx8 = 1; // Enable PIE Gropu 1 INT8
    IER |= M_INT1; // Enable CPU INT1
    EINT; // Enable Global Interrupts

    // Reset the watchdog counter
    ServiceDog();

    // Enable the watchdog
    EALLOW;
    SysCtrlRegs.WDCR = 0x0028;
    EDIS;

    // Step 6. IDLE loop. Just sit and loop forever (optional):
    for(;;)
    {
    LoopCount++;

    // Uncomment ServiceDog to just loop here
    // Comment ServiceDog to take the WAKEINT instead
    // ServiceDog();
    }

    }


    // Step 7. Insert all local Interrupt Service Routines (ISRs) and functions here:
    // If local ISRs are used, reassign vector addresses in vector table as
    // shown in Step 5

    interrupt void wakeint_isr(void)
    {
    WakeCount++;

    if (WakeCount > 300)
    {
    WakeCount = WakeCount;
    EALLOW;
    // Enable the Watchdog
    SysCtrlRegs.WDCR = 0x0028;
    // Force a reset
    SysCtrlRegs.WDCR = 0x00;
    //EDIS;
    }

    // Acknowledge this interrupt to get more from group 1
    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;}

    //===========================================================================
    // No more.
    //===========================================================================