English
Language : 

HMS87C1808B Datasheet, PDF (51/99 Pages) List of Unclassifed Manufacturers – 8-BIT SINGLE-CHIP MICROCONTROLLERS
HMS87C1X04B/08B/16B
TDR0, TDR1 and then resets to 0000H. The match output gener-
ates Timer 0 interrupt not Timer 1 interrupt.
The clock source of the Timer 0 is selected either internal or ex-
ternal clock by bit T0CK2, T0CK1 and T0SL0.
In 16-bit mode, the bits T1CK1,T1CK0 and 16BIT of TM1
should be set to “1” respectively.
TM0
TM1
-
-
-
-
POL
X
16BIT
1
T0CK[2:0]
Edge Detector
EC0
÷2
÷4
÷8
fxin
÷ 32
÷ 128
÷ 512
÷ 2048
MUX
CAP0
0
PWME
0
1
T0CN
T0CK2 T0CK1 T0CK0 T0CN T0ST
ADDRESS : D0H
RESET VALUE : --00_0000
X
X
X
X
X
CAP1 T1CK1 T1CK0 T1CN T1ST
ADDRESS : D2H
RESET VALUE : 0000_0000
0
1
1
X
X
X: The value “0” or “1” corresponding your operation.
T0ST
0 : Stop
1 : Clear and Start
T1 (8-bit)
T0 (8-bit)
CLEAR
COMPARATOR
TDR1 (8-bit) TDR0 (8-bit)
T0IF
F/F
TIMER 0
INTERRUPT
COMP0 PIN
Figure 12-5 16-bit Timer / Counter Mode
12.3 8-bit Compare Output (16-bit)
The HMS87C1X04B/08B/16B has a function of Timer Compare
Output. To pulse out, the timer match can goes to port
pin(COMP0) as shown in Figure 12-2 and Figure 12-5 . Thus,
pulse out is generated by the timer match. These operation is im-
plemented to pin, RB4/COMP0/PWM.
This pin output the signal having a 50: 50 duty square wave, and
output frequency is same as below equation.
fCOMP = 2-----×-----P---r-O--e---ss--cc--a-i-l-l-l-e-a--r-t-i--Vo---na---l-F-u---er---e-×-q---u-(--eT---n-D--c---yR-----+-----1----)
In this mode, the bit PWMO of RB function register (RBFUNC)
should be set to “1”, and the bit PWME of timer1 mode register
(TM1) should be set to “0”.
In addition, 16-bit Compare output mode is available, also.
12.4 8-bit Capture Mode
The Timer 0 capture mode is set by bit CAP0 of timer mode reg-
ister TM0 (bit CAP1 of timer mode register TM1 for Timer 1) as
shown in Figure 12-6 .
As mentioned above, not only Timer 0 but Timer 1 can also be
used as a capture mode.
The Timer/Counter register is increased in response internal or
external input. This counting function is same with normal timer
mode, and Timer interrupt is generated when timer register T0
(T1) increases and matches TDR0 (TDR1).
In the capture mode, the timer interrupt is very useful when the
pulse width of captured signal is more wider than the maximum
period of Timer.
For example, in Figure 12-8 , the pulse width of captured signal
is wider than the timer data value (FFH) over 2 times. When ex-
ternal interrupt is occurred, the captured value (13H) is more little
than wanted value. It can be obtained correct value by counting
SEP. 2004 Ver 1.03
47