3 timer, 4 watchdog timer, Timer – Kontron COMe-bP5020 User Manual
Page 16: Watchdog timer

www.kontron.com
16
User Guide
COMe-bP5020
2.3 Timer
The COMe-bP5020 is equipped with the following timer:
» Real-Time Clock (RTC)
The onboard high-precision real-time clock RV-8564-C2 (RTC) is register-compatible with the PCF8564A RTC from Philips/NXP.
In addition, it provides a very rigid frequency tolerance at low power consumption. The COMe-bP5020 does not include a 3 V
lithium battery or a GoldCap power source for RTC backup. Power for the RTC is supplied by the carrier via the VCC_RTC pin.
2.4 Watchdog Timer
The COMe-bP5020 provides a Watchdog timer that is programmable for a timeout period ranging from 125 ms to 4096 s in 16
steps. Failure to trigger the Watchdog timer in time results in a interrupt or a system reset or both. In dual-stage mode, it re-
sults in a combination of both interrupt and reset if the Watchdog is not serviced. A hardware status flag will be provided to
determine if the Watchdog timer generated the reset. Refer to the Watchdog Timer Control Register (WTIM) in Chapter 3 for
further information.
There are four possible modes of operation involving the Watchdog timer:
» Timer only mode
» Reset mode
» Interrupt mode
» Dual stage mode
At power on the Watchdog is not enabled. If required, the appropriate bits of the Watchdog Timer Control Register must be set
according to the application requirements. To operate the Watchdog, the mode and time period required must first be set and
then the Watchdog enabled. Once enabled, the Watchdog can only be disabled or the mode changed by powering down and then
up again. To prevent a Watchdog timeout, the Watchdog must be retriggered before timing out. This is done by writing a ‘1’ to
the WTR bit. In the event a Watchdog timeout does occur, the WTE bit is set to ‘1’. What transpires after this depends on the
mode selected.
The four operational Watchdog timer modes can be configured by the WMD[1:0] bits, and are described as follows:
Timer only mode - In this mode the Watchdog is enabled using the required timeout period. Normally, the Watchdog is retrig-
gered by writing a ‘1’ to the WTR bit. In the event a timeout occurs, the WTE bit is set to ‘1’. This bit can then be polled by the
application and handled accordingly. To continue using the Watchdog, write a ‘1’ to the WTE bit, and then retrigger the Watch-
dog using WTR. The WTE bit retains its setting as long as power is not cycled (off - on). Therefore, this bit may be used to verify
the status of the Watchdog.
Reset mode - This mode is used to force a hard reset in the event of a Watchdog timeout. In addition, the WTE bit is not reset
by the hard reset, which makes it available if necessary to determine the status of the Watchdog prior to the reset.
Interrupt mode - This mode causes the generation of an interrupt in the event of a Watchdog timeout. The interrupt handling
is a function of the application. If required, the WTE bit can be used to determine if a Watchdog timeout has occurred.
Dual stage mode - This is a complex mode where in the event of a timeout two things occur: 1) an interrupt is generated, and
2) the Watchdog is retriggered automatically. In the event a second timeout occurs following the first timeout, a hard reset
will be generated. The second timeout period is the same as the first. If the Watchdog is retriggered normally as specified
above, operation continues. The interrupt generated at the first timeout is available to the application to handle the first time-
out if required. As with all of the other modes, the WTE bit is available for application use.
Pin B27 on the COM Express® J1 connector offers a signal that can be asserted when a Watchdog timer has not been triggered
within time. It can be configured to any of the 2 stages. Deassertion of the signal is automatically done after reset. If deasser-
tion during runtime is necessary please contact Kontron for further assistance.