HT46R01/HT46R02/HT46R03
System Architecture
A key factor in the high-performance features of the
Holtek range of microcontrollers is attributed to the inter-
nal system architecture. The range of devices take ad-
vantage of the usual features found within RISC
microcontrollers providing increased speed of operation
and enhanced performance. The pipelining scheme is
implemented in such a way that instruction fetching and
instruction execution are overlapped, hence instructions
are effectively executed in one cycle, with the exception
of branch or call instructions. An 8-bit wide ALU is used
in practically all operations of the instruction set. It car-
ries out arithmetic operations, logic operations, rotation,
increment, decrement, branch decisions, etc. The inter-
nal data path is simplified by moving data through the
Accumulator and the ALU. Certain internal registers are
implemented in the Data Memory and can be directly or
indirectly addressed. The simple addressing methods of
these registers along with additional architectural fea-
tures ensure that a minimum of external components is
required to provide a functional I/O and A/D control sys-
tem with maximum reliability and flexibility. This makes
these devices suitable for low-cost, high-volume pro-
duction for controller applications requiring from 1K up
to 4K words of Program Memory and 64 to 128 bytes of
Data Memory storage.
Clocking and Pipelining
The main system clock, derived from either a Crys-
tal/Resonator or RC oscillator is subdivided into four in-
ternally generated non-overlapping clocks, T1~T4. The
Program Counter is incremented at the beginning of the
T1 clock during which time a new instruction is fetched.
The remaining T2~T4 clocks carry out the decoding and
execution functions. In this way, one T1~T4 clock cycle
forms one instruction cycle. Although the fetching and
execution of instructions takes place in consecutive in-
struction cycles, the pipelining structure of the
microcontroller ensures that instructions are effectively
executed in one instruction cycle. The exception to this
are instructions where the contents of the Program
Counter are changed, such as subroutine calls or
jumps, in which case the instruction will take one more
instruction cycle to execute.
For instructions involving branches, such as jump or call
instructions, two machine cycles are required to com-
plete instruction execution. An extra cycle is required as
the program takes one cycle to first obtain the actual
jump or call address and then another cycle to actually
execute the branch. The requirement for this extra cycle
should be taken into account by programmers in timing
sensitive applications
O
s
c
i
l
l
a
t
o
r
C
l
o
c
k
(
S
y
s
t
e
m
C
l
o
c
k
)
P
h
a
s
e
C
l
o
c
k
T
1
P
h
a
s
e
C
l
o
c
k
T
2
P
h
a
s
e
C
l
o
c
k
T
3
P
h
a
s
e
C
l
o
c
k
T
4
P
r
o
g
r
a
m
C
o
u
n
t
e
r
P
C
P
C
+
1
P
C
+
2
F
e
t
c
h
I
n
s
t
.
(
P
C
)
P
i
p
e
l
i
n
i
n
g
E
x
e
c
u
t
e
I
n
s
t
.
(
P
C
-
1
)
F
e
t
c
h
I
n
s
t
.
(
P
C
+
1
)
E
x
e
c
u
t
e
I
n
s
t
.
(
P
C
)
F
e
t
c
h
I
n
s
t
.
(
P
C
+
2
)
E
x
e
c
u
t
e
I
n
s
t
.
(
P
C
+
1
)
System Clocking and Pipelining
F
e
t
c
h
I
n
s
t
.
1
E
x
e
c
t
u
t
e
I
n
s
t
.
2
1
1
2
3
4
5
6
M
C
C
:
:
N
O
V
A
,
[
E
1
2
H
]
F
e
c
h
I
n
s
t
.
E
x
e
c
u
t
e
I
n
s
t
.
2
A
P
L
L
L
D
L
A
Y
F
e
t
c
h
I
n
s
t
.
3
F
l
u
s
h
P
i
p
e
l
i
n
e
[
1
2
H
]
F
e
t
c
h
I
n
s
t
.
6
E
x
e
c
t
u
t
e
I
n
s
t
.
7
6
F
e
c
h
I
n
s
t
.
D
E
L
A
Y
:
O
P
Instruction Fetching
Rev. 1.00
6
September 21, 2007