User guide

150 Additional Features
Watchdog Timer
For Series 3100 devices, the watchdog timer times out within a range of 0.21
seconds to 0.42 seconds with a 40 MHz input clock. This value scales inversely
with the input clock. The hardware timer has a period of 0.21 seconds, but a
timeout occurs at the end of the current period only if the watchdog timer has not
been retriggered since the beginning of the current period. Because the timer
retrigger in software is asynchronous with the timeout period in hardware, from
a software perspective the minimum time from retriggering to timeout is a single
period, or 0.21 seconds, and the maximum time from retriggering to timeout is
two periods, or 0.42 seconds.
For Series 5000 devices, the watchdog timer period is fixed at 840 ms (1.19 Hz)
for all system clock rates. The actual timeout range is between 0.8 s and 1.7 s.
The intention of the watchdog timer is to reset the device within a nominal value
of one second should it experience a software failure, such as an unterminated
loop or other fault, that prevents the software from retriggering the timer.
Normally, the scheduler ensures that the watchdog timer is reset periodically,
and the application program need not be concerned about the watchdog timer. If
a program enters a very long task, however, the watchdog timer could expire,
which causes a device reset.
To ensure that the watchdog timer does not expire, you can call the
watchdog_update( ) function periodically within long tasks (or when in bypass
mode). The post_events( ), msg_receive( ), and resp_receive( ) functions also
update the watchdog timer, as well as use of the io_out( ) function with the
pulsecount output object, and the io_in( ) function with the magcard, magtrack1,
neurowire slave, and wiegand input objects.
Notes:
Use the watchdog_update( ) function with care, and, if possible, not
within any loops. A software or hardware malfunction that prevents the
loop from being terminated could cause a device not to respond; and, it
would be unable to recover from this symptom by means of a watchdog
timer reset, because the loop body would continuously re-trigger the
watchdog timer.
Firmware functions that write to EEPROM do not automatically update
the watchdog timer.
An example of using the watchdog_update( ) function is shown below:
when (TRUE)
{
post_events();
if (nv_update_occurs(nviA)){
...
} else if (nv_update_occurs(nviB)){
... // long task
watchdog_update();
... // more long task
}
}