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.

TMS570LC4357: Need to read RTICLK to Kick the Dog

Part Number: TMS570LC4357


The technical reference PDF says:

The expiration time of the DWD down counter can be determined with the following equation:
texp = (DWDPRLD + 1) × 213/RTICLK
where
DWDPRLD = 0...4095

How do you read the RTICLK?

If I set a 100 percent window, I don't seem to need a pause of any kind:

    /* Initialize DWD Expiration Period. */
    dwwdInit(rtiREG1, Generate_Reset, 4095, Size_100_Percent);

    // This function will Enable the DWD counter.
    dwdCounterEnable(rtiREG1);

    // 100 percent window
    int count = 0;
    while(1)
    {
        dwdReset(rtiREG1);
        count++;
    }

The reason I am looking for a value for RTICLK is because when I use FreeRTOS and try to "Kick the Dog" from a Task, I get a "EndTime_Window_Violation".

	// main...

    /* Initialize DWD Expiration Period. */
    dwwdInit(rtiREG1, Generate_Reset, 4095, Size_100_Percent);

    // This function will Enable the DWD counter.
    dwdCounterEnable(rtiREG1);

    /* Create Task 1 */
    if (xTaskCreate(vTask1, "Task1", configMINIMAL_STACK_SIZE, NULL, 1, &xTask1Handle) != pdTRUE)
    {
        /* Task could not be created */
        while (1);
    }

void vTask1(void *pvParameters)
{
    while (1)
    {
        vTaskDelay(200 / portTICK_PERIOD_MS);
        dwdReset(rtiREG1);
    }
}        
  • The watchdog counter used the RTICLK domain clock, hence it appears in the formula for the counter expiry time. In the formula you referenced "RTICLK" in the denominator means the RTICLK domain frequency, which defaults to the VCLK domain frequency.

  • Figure 17-9 DWD Operation -- in the technical reference manual shows a timeline, at the beginning is the preload value (0 - 4095) -- what is this value's unit of measure? And what is the Y axis value? (0 to 0x1FFFFFF)

  • The DWD counter gets loaded with the DWDPRLD value each time the DWD is serviced. This defines the counter expiry time period based on the RTICLK domain frequency.

    The Y-axis in this figure shows the DWD counter value, which starts counting down as soon as the DWD is enabled, and gets loaded with the preload value when the DWD is serviced. If this counter reaches zero it generates a system reset or NMI.