English
Language : 

W742S81A Datasheet, PDF (17/47 Pages) Winbond – 4 BIT MICROCONTROLLER
W742S81A
be used as to output an arbitrary frequency to the MFP pin. The input clock of Timer 1 can be one of three
sources: FOSC/64, FOSC, or Fs. The source can be selected by setting bit 0 and bit 1 of mode register 1
(MR1). At initial reset, the Timer 1 clock input is FOSC. When the MOV TM1L, R or MOV TM1H,R
instruction is executed, the specified data are loaded into the auto-reload buffer; but the TM1 down-
counting will keep going on. If the bit 3 of MR1 is set (MR1.3 = 1), the content of the auto-reload buffer
will be loaded into the TM1 down counter, and Timer 1 starts to down count, and the event flag 7 is reset
(EVF.7=0). When the timer decreases and underflow to FFH, it will generate an underflow (EVF.7 = 1)
and be auto-reloaded with the specified data, after which it will continue to count down. Then, if interrupt
enable flag 7 has been set to 1 (IEF.7 = 1), an interrupt is executed; if hold mode release enable flag 7 is set
to 1 (HEF.7 = 1), the hold state is terminated. The specified frequency of Timer 1 can be delivered to the
MFP output pin by programming bit 2 of MR1. Bit 3 of MR1 can be used to make Timer 1 stop or start
counting.
In a case where Timer 1 clock input is FT:
Desired Timer 1 interval = (preset value +1) / FT
Desired frequency for MFP output pin = FT ÷ (preset value + 1) ÷ 2 (Hz)
Preset value: Decimal number of Timer 1 preset value
FOSC: Clock oscillation frequency
Fs
Fosc/64
Fosc
MR1.0
MOV TM1H,R
MOV TM1L,R
MR1.1
MR1.3
4
4
Auto-reload buffer
Enable
8 bits
FT
8-Bit Binary
Down Counter
(Timer 1)
Disable
8 bits
Reset
MOV WR,TM1
S
Q
R
Underflow signal
EVF.7
1. Reset
2. INT7 accept
3. CLR EVF, #80H
4. Set MR1.3 to 1
2
circuit
Reset
MFP
signal
MFP
output pin
BUZCR.0
Set
MR1.3 to 1
Figure 6-7 Organization of Timer 1
For example, when FT equals 32768 Hz, depending on the preset value of TM1, the MFP pin will output a
single tone signal in the tone frequency range from 64 Hz to 16384 Hz. The relation between the tone
frequency and the preset value of TM1 is shown in the table below.
MOV WR,TM1 can read back the content of TM1, It will save the TM1 MSB to WR and the TM1 LSB to
ACC.
Publication Release Date: March 2003
- 17 -
Revision A1