English
Language : 

HMS87C1808B Datasheet, PDF (50/99 Pages) List of Unclassifed Manufacturers – 8-BIT SINGLE-CHIP MICROCONTROLLERS
HMS87C1X04B/08B/16B
put. The internal clock has a prescaler divide ratio option of 2, 4,
8, 32,128, 512, 2048 (selected by control bits T0CK2, T0CK1
and T0CK0 of register TM0) and 1, 2, 8 (selected by control bits
T1CK1 and T1CK0 of register TM1). In the Timer 0, timer reg-
ister T0 increases from 00H until it matches TDR0 and then reset
to 00H. The match output of Timer 0 generates Timer 0 interrupt
(latched in T0F bit). As TDRx and Tx register are in same ad-
dress, when reading it as a Tx, written to TDRx.
In counter function, the counter is increased every 0-to 1 (rising
edge) transition of EC0 pin. In order to use counter function, the
bit RA0 of the RA Direction Register RAIO is set to “0”. The
Timer 0 can be used as a counter by pin EC0 input, but Timer 1
can not.
TDR1
Timer 1 (T1IF)
Interrupt
n
n-1
~~
~~
up-count
9
8
7
6
5
4
3
2
1
0
PCP
~~
Interrupt period
= PCP x (n+1)
Occur interrupt
Occur interrupt
Occur interrupt
Figure 12-3 Counting Example of Timer Data Registers
TIME
TDR1
Timer 1 (T1IF)
Interrupt
T1ST
Start & Stop
T1CN
Control count
clear & start
stop
~~
disable enable
~~
up-count
Occur interrupt
Occur interrupt
T1ST = 0
T1ST = 1
T1CN = 0
T1CN = 1
TIME
Figure 12-4 Timer Count Operation
12.2 16-bit Timer/Counter Mode
The Timer register is being run with 16 bits. A 16-bit timer/coun-
ter register T0, T1 are increased from 0000H until it matches
46
SEP. 2004 Ver 1.03