DIAG_WDT_SimpleTimer()

void DIAG_WDT_SimpleTimer (void )

WATCHDOG_SIMPLE_TIMER_TEST is a functional test based on Defintition H.2.16.5 in the IEC-60370.

This API checks the WDT reset within the configured Timeout. This test should not be called from main(). The test will be executed before the main() and diag_wdt_simple_timer.h/.c is included in the compilation. Description:This is the simple-timer based watchdog timer (WDT) self-diagnostic test. The test will first test that the WDT resets the device when the WDT counter is not cleared. The next step tests that the WDT counter can be cleared without resetting the device. Once this is confirmed the device will again be reset by the WDT. This function tests the following:
  1. 1.

    WDT issues a system reset after timeout.

  2. 2.

    WDT timing and that it can be cleared.

The expected (error-free) execution flow is as follows:
  1. 1.

    Power-on or external reset has occurred.

  2. 2.

    Check that WDT can issue a system reset. Set test state to simple timer and system reset.

  3. 3.

    Check that WDT can be cleared.

  4. 4.

    Set test state "ok" and continue to main().

Timer0 (TMR0) is used as an independent clock source to the WDT clock, which is used to check the timing of the oscillator used by the WDT. If the device and WDT was reset correctly in each step of the test, then the diag_wdt_simple_teststate is set to DIAG_WDT_SIMPLE_FSM_OK and diag_simple_wdt_status is set to DIAG_WDT_SIMPLE_PASS, otherwise the diag_wdt_simple_teststate is set to DIAG_WDT_SIMPLE_FAULT and diag_simple_wdt_status is set to DIAG_WDT_SIMPLE_FAIL thereby indicating fault.

Error reporting: DIAG_WDT_SimpleTimer_GetStatus() should be called from main to know the status of Simple Timer WDT diagnosis

Parameters:
None
Returns:

See DIAG_WDT_SimpleTimer_GetStatus()