English
Language : 

W921E400A Datasheet, PDF (25/53 Pages) Winbond – 4-BIT MICROCONTROLLER
W921E400A/W921C400
The format of the TM0 control register (TM0CR) is described below:
TM0CR register: (address = 020H, default data = 0H)
b3
b2
b1
b0
Reserved
Reserved
b1 b0 Input frequency (f TM0)
00
fsys/2 Hz
01
fsys/256 Hz
10
fsys/1024 Hz
11
fsys/2048 Hz
The TM0 set register is divided into TM0 MSB data register (TM0MSB register, address = 021H,
default = 0FH) and TM0 LSB data register (TM0LSB register, address = 022H, default = 0FH).
TM0 will underflow when TM0 set register is from 00H to 0FFH and the value in the TM0MSB and
TM0LSB will be auto reloaded to the TM0 set register when the STTM0 bit2 is set. TM0 will decrease
by 1 at the frequency of timer 0 clock after the timer 0 has started.
If at any time the STTM0 bit3 is from 0 to 1 (disable to enable) in the timer mode, the TM0MSB and
TM0LSB will be auto reloaded to the TM0 set register again and restart the timer 0. TM0 will stop
operating while the STTM0 bit3 is reset to 0.
The TM0 starts to count when the STTM0 register bit3 is set. When TM0 underflows, the STTM0 bit3
will be reset by hardware to stop TM0 if the auto-reload is disabled, but the STTM0 bit3 will not be
reset if the auto-reload is enabled.
When the TM0 normal function is performed, the watch-dog timer function will be disabled
automatically.
The format of the TM0 status register (STTM0) is described below:
STTM0 register: (address = 023H, default data = 0H)
b3
b2
b1
b0
0:TM0 normal function selected
1:Watch-dog timer (WDT) selected
0:WDT not underflow
1:WDT underflow
0:TM0 auto-reload disable
1:TM0 auto-reload enable
0:TM0 stop
1:TM0 start
If TM0 works as the watch-dog timer (WDT), the bit1 of the STTM0 register will be set when the WDT
is underflow, in the meanwhile, the system is reset just as with the power on reset except the STTM0
bit1. The WDT (STTM0 bit1) will be reset to zero only with power on reset or RAM write mode.
In the timer mode the time out will be the programming data subtract 1 ([TM0MSB, TM0LSB]-1). TM2
and TM3 are the same as TM0.
- 25 -
Publication Release Date: July 1999
Revision A3