Function description
APCIe-040
www.addi-data.com 20
4.4
Watchdog
Using a software function, the 8-bit watchdog can be initialised and enabled.
The watchdog is started by the first trigger command (through software or via the digital input). This
means that the watchdog time is loaded and the watchdog starts to decrement.
In the program loop within the program to be monitored (software tasks), the trigger command has to
be called up in cyclic intervals, which prevents the watchdog time from elapsing. The watchdog time is
reloaded then and the watchdog decrements again. If the program has crashed, the trigger command
is no longer executed and the watchdog runs down. In this case, the configured alarm level is released
(see Fig. 4-1).
The watchdog statuses can be read back through software via status registers. Four units (
μ
s, ms, s,
min) are available as time bases for the watchdog.
4.5
Timer
Independently from the PC clock, the timer provides a time base to synchronise operations, for
example. The timer is a downward counter which can release an interrupt after the programmed cycle
time has elapsed (time-out).
The seven timers of the board
APCIe-040
can be programmed individually. The starting time of the
timer and the selection of the cycle time depend on the execution speed of the computer and on the
time parameters of the program to be monitored.
When the start value (reload value) of the timer is programmed, the timer is started by setting the
gate through software or via the digital input.
The current timer value and the start value (reload value) as well as status and interrupt registers can
be read back through software. Four units (
μ
s, ms, s, min) are available as time bases for the timer.
Example
Reload value = 7
Initialisation with a rising edge
Interrupt enabled
When the timer value is “0”, the reload value “7” will be reloaded with the next valid edge and an
interrupt will be released.
Start
Clock
Timer
Underflow