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);
}
}