4.13.3.1 Inactivity Watchdog
The device includes an inactivity watchdog timer that can be used to automatically command the device into the SLEEP state. The inactivity watchdog can be used to allow the system to reduce its power consumption when no activity is present on the network. It can also be used to detect when the controller has malfunctions and is no longer managing the device; in this case, the watchdog can be used to force the device into the SLEEP state to prevent the malfunctioning node from consuming power on an inactive network segment.
The inactivity watchdog can be configured to trigger on inactivity of three sources: no receive packets from the network, no transmit packets from the MAC, and no SMI access by the controller. Each of these three inactivity sources may be enabled separately or together in any combination. Once enabled, the watchdog timer will be reset upon detected activity on any of the selected watchdog sources. When the watchdog expires, the Inactivity Watchdog Timeout (IWDTO) bit in the Status 2 (STS2) register will be set commanding the transition to the SLEEP state and initiating the Sleep Inhibit Delay timer. The Inactivity Watchdog Timeout Interrupt Mask (IWDTOM) bit in the Interrupt Mask 2 (IMSK2) register should be set to assert the IRQ_N pin to immediately notify the host controller when the inactivity watchdog expiration occurs. Once the Inactivity Watchdog Timeout status bit is set, the controller may halt the pending SLEEP transition by clearing the Inactivity Watchdog Timeout status bit any time before the Sleep Inhibit Delay expires.
Before enabling the inactivity watchdog timer, the inactivity sources to be used for resetting the watchdog timer when activity occurs must be configured by setting the appropriate bits within the Port Management 2 (PRTMGMT2) register:
- Network packet receive inactivity - Media Interface Receive Watchdog Enable (MIRXWDEN)
- MAC packet transmit inactivity - Media Interface Transmit Watchdog Enable (MITXWDEN)
- SMI access inactivity - PHY Register Inactivity Watchdog Enable (PRIWDEN)
The 32-bit Inactivity Watchdog Timeout (TIMEOUT) field in the Inactivity Watchdog Timeout High/Low (IWDTOH/IWDTOL) registers configures how long the enabled inactivity sources must show no activity before the watchdog timer expires. The default setting for the Inactivity Watchdog Timeout yields an inactivity timeout of 2 seconds. When activity is detected on the inactivity sources, the watchdog timer is reset to the value in the TIMEOUT field. The watchdog timer then decrements every 200 ns. Should the watchdog timer decrement to zero, the Inactivity Watchdog Timer expires causing the Inactivity Watchdog Timeout (IWDTO) status bit to become set.
The watchdog is enabled by setting the Inactivity Watchdog Enable (IWDE) bit in the Control 1 (CTRL1) register after configuring the inactivity sources, the watchdog timeout, and enabling the Inactivity Watchdog Timeout Interrupt Mask.