English
Language : 

W921E400A Datasheet, PDF (27/53 Pages) Winbond – 4-BIT MICROCONTROLLER
W921E400A/W921C400
The TM2 set register is divided into TM2 MSB data register (TM2MSB register, address = 02BH,
default = 0FH) and TM2 LSB data register (TM2LSB register, address = 02CH, default = 0FH).
The TM2 read register is divided into TM2 read only MSB data register (TM2RM register, address =
01EH, default = 0FH) and TM2 read only LSB data register (TM2RL register, address = 01FH, default
= 0FH).
The format of the status of TM2 register (STTM2) is described below:
STTM2 register: (address = 02DH, default data = 0H)
b3
b2
b1
b0
Reserved
0: TM2 normal function selected
1: Special function selected
0: TM2 auto-reload disable
1: TM2 auto-reload enable
0: TM2 stop
1: TM2 start
If the TM2 is in the timer mode, divider will underflow when it is from 00H to 0FFH and the value in
the TM2MSB and TM2LSB will be auto reloaded to the TM2 set register. The TM2 will decrease by 1
at the frequency of timer 2 clock after the timer 2 has started.
If at any time the STTM2 bit3 is from 0 to 1 (disable to enable) the TM2MSB and TM2LSB will be
auto reloaded to the TM2 set register again and restart the TM2. The TM2 will stop operating when
the STTM2 bit3 is reset to 0.
The TM2 starts to count when the STTM2 register bit3 is set. When TM2 underflows, the STTM2 bit3
will be reset by hardware to stop TM2 if the auto-reload is disabled, but the STTM2 bit3 will not be
reset if the auto-reload is enabled.
When the TM2 normal function is performed, the special function will be disabled automatically.
The format of the TM2 trigger condition register (TGTM2) is shown below:
TGTM2 register: (address = 02EH, default data = 0H)
b3
b2
b1
b0
b1 b0
00
01
10
11
Trigger
Rising
Falling
Both
0: Special function work as pulse/period
width measurement
1: Special function work as arbitrary
waveform generator
0: Arbitrary waveform type 0
1: Arbitrary waveform type 1
- 27 -
Publication Release Date: July 1999
Revision A3