HT45R38
External RC Oscillation Converter
There are six registers related to the RC oscillation con-
verter, i.e., TMRAH, TMRAL, RCOCCR, TMRBH,
TMRBL and RCOCR. The internal timer clock is the in-
put to TMRAH and TMRAL, the external RC oscillation
is the input to TMRBH and TMRBL. The OVB bit, bit 0 of
RCOCR register, decides whether Timer A overflows or
Timer B overflows, then the RCOCF bit is set and an ex-
ternal RC oscillation converter interrupt occurs. When
the RC oscillation converter mode Timer A or Timer B
overflows, the RCOCON bit is reset to ²0² and stops
counting. Writing to TMRAH/TMRBH places the start
value in Timer A/Timer B while reading TMRAH/TMRBH
obtains the contents of Timer A/Timer B. Writing to
TMRAL/TMRBL only writes the data into a low byte
buffer. However writing to TMRAH/TMRBH will write the
An external RC oscillation mode is implemented in the
device. The RC oscillation converter contains two 16-bit
programmable count-up counters and the Timer A clock
source may come from the system clock or system
clock/4. The timer B clock source may come from the
external RC oscillator.
The RC oscillation converter is comprised of the
TMRAL, TMRAH, TMRBL, TMRBH registers when the
RCO bit, bit 1 of RCOCR register, is ²1². The RC oscilla-
tion converter Timer B clock source may come from an
external RC oscillator. The Timer A clock source comes
from the system clock or from the system clock/4, deter-
mined by the RCOCCR register.
Bit No.
Label
¾
Function
0~2
3
Unused bit, read as ²0²
Undefined bit, this bit can read/write
¾
4
RCOCON To enable or disable external RC oscillation converter counting (0= disabled; 1= enabled)
To define the Timer A clock source, RCOM2, RCOM1, RCOM0=
000= System clock
001= System clock/4
RCOM0 010= Unused
RCOM1 011= Unused
RCOM2 100= Unused
101= Unused
5
6
7
110= Unused
111= Unused
RCOCCR (22H) Register
Bit No.
Label
Function
In the RC oscillation converter mode, this bit is used to define the timer/event counter interrupt,
which comes from Timer A overflow or Timer B overflow.
0
OVB
(0= Timer A overflow; 1= Timer B overflow)
Define 16 timer/event counter mode or RC oscillation converter mode.
1
RCO
(0= Disable RC oscillation converter mode; 1= Enable RC oscillation converter mode)
2~3
4~7
¾
Unused bit, read as ²0²
RW
4-bit read/write registers for user defined.
RCOCR (25H) Register
S
S
1
2
S
y
s
t
e
m
C
l
o
c
k
O
V
B
=
0
S
y
s
t
e
m
C
l
o
c
k
/
4
T
i
m
e
r
A
E
x
t
e
r
n
a
l
R
C
O
s
c
i
l
l
a
t
i
o
n
C
o
n
v
e
r
t
e
r
I
n
t
e
r
r
u
p
t
R
C
O
C
O
N
O
V
B
=
1
T
i
m
e
r
B
R
e
s
e
t
R
C
O
C
O
N
R
C
O
S
C
O
u
t
p
u
t
External RC Oscillation Converter
Rev. 1.00
18
December 13, 2006