Rainbow Electronics W90N740 User Manual
Page 169

W90N740
Publication Release Date: November 26, 2004
- 165 -
Revision A4
7.10 TIMER Controller
7.10.1 General Timer Controller
The timer module has two channels, TIMER0 and TIMER1, which allow you to easily implement a
counting scheme for use. The timer can perform functions like frequency measurement, event counting,
interval measurement, pulse generation, delay timing, and so on. The timer possesses features such as
adjustable resolution, programmable counting period, and detailed information. The timer can generate
an interrupt signal upon timeout, or provide the current value of count during operation.
The Features of the TIMER Controller:
• Two programmable 24-bit timers with 8-bit pre-scalar
• One programmable 24-bit Watch-Dog timer
• Independent clock source for each channel
• One-short mode, period mode or toggle mode operation
• Maximum uninterrupted time = (1 / 15 MHz) * (255) * (2^24 - 1), if TCLK = 15 MHz
7.10.2 Watch Dog Timer
The purpose of watchdog timer is to perform a system restart after the software running into a problem.
This prevents system from hanging for an indefinite period of time. It is a free running timer with
programmable time-out intervals. When the specified time internal expires, a system reset can be
generated. If the watchdog timer reset function is enabled and the watchdog timer is not being reset
before timing out, then the watchdog rest is activated after 512 WDT clocks. Setting WTE in the register
WTCR enables the watchdog timer.
The WTR should be set before making use of watchdog timer. This ensures that the watchdog timer
restarts from a know state. The watchdog timer will start counting and time-out after a specified period of
time. The time-out interval is selected by two bits, WTIS1 and WTIS0. The WTR is self-clearing, i.e., after
setting it, the hardware will automatically reset it. When time-out occurs, the watchdog timer interrupt flag
is set. The watchdog timer waits for an additional 512 clocks before issuing a reset signal, if the WTRE is
set. The reset signal will last for two clocks long and the WTRF will be set. When used as a simple timer,
the interrupt and reset functions are disabled. The watchdog timer will set the WTIF each time a time-out
occurs. The WTIF can be polled to check the status, and software can restart the timer by setting the
WTR.