Professional Documents
Culture Documents
Features
· Operating voltage: · 16-bit table read instructions for any bank/page read
3.6V~5.5V (HT37A70/60) · Support 16 to 28 bidirectional I/O lines
3.3V~5.5V (HT37A50/40) · Integrated 2-ch stereo or 1-ch mono 16-bit DAC
2.4V~5.5V (HT37A30/20)
converter
· Operating frequency: 11.059MHz
· Integrated power Amplifier
· Oscillation modes for the Oscillator clock
· Integrated 8-channel 12-bit A/D converter
fOSC: Crystal (11.059MHz)
· Eight channel polyphonic synthesizer
1-pin RC oscillation typ. 11.059MHz
· Low voltage reset (Tolerance ± 10%)
· Built-in 8-bit MCU (HT-8) with 320´8 bits RAM
· External interrupt INT
· Built-in 32K´16-bits to 256K´16-bits ROM for
· External 2 Timer clock input
program/data shared
· Eight-level subroutine nesting · 4 or 8 touch switch input
General Description
The device is an 8-bit high performance RISC architec- tegrated 8-bit micro controller which controls the syn-
ture microcontroller specifically designed for various thesizer to generate the melody by setting the special
Music and ADPCM applications. It provides an 8-bit register. A Power-down function is included to reduce
MCU and 8-channel Wavetable synthesizer. It has a in- power consumption.
Selection Table
Most features are common to all devices, the main feature distinguishing them are Program Memory capacity, I/O
count, A/D resolution, DAC output, R2F input and package types. The following table summarizes the main features of
each device.
2.2V/
HT37A20 32K´16bit 16 1ch-mono ¾ 4 ¾ 20/28SOP
2.4V~ 3.3V
5.5V 2.2V/ 28SOP,
HT37A30 64K´16bit 20 2ch-Stereo Ö 8 ¾
3.3V 48SSOP
11.059
HT37A40 6+2 96K´16bit 320´8bit 28 2ch-Stereo Ö 8
3.3V~ MHz
3.0V
HT37A50 5.5V 128K´16bit 28 2ch-Stereo Ö 8 28SOP,
12-bit´8 64QFP,
HT37A60 3.6V~ 192K´16bit 28 2ch-Stereo Ö 8 80LQFP
3.3V
HT37A70 5.5V 256K´16bit 28 2ch-Stereo Ö 8
Block Diagram
M id i A D P C M W a tc h d o g T im e r
E n g in e O s c illa to r
R O M P ro g ra m R A M D a ta A /D D /A C o d e C o d e
S ta c k
M e m o ry M e m o ry C o n v e rts C o n v e rts
www.datasheet4u.com W a tc h d o g
T im e r
8 - b it
R IS C C o re L o w V o lta g e
R e s e t
I/O 1 6 /8 - b it In te g ra te d R C /C ry s ta l In te rru p t
C R /F
P o rts T im e r s P o w e r A m p lifie r O s c illa to r C o n tr o lle r
Pin Assignment
N C 1 2 8 N C P D 2 1 2 8 P D 0 P C 0 1 2 8 P A 7
O S C 2 2 2 7 N C O S C 2 2 2 7 P D 1 P C 1 2 2 7 P A 6
O S C 1 3 2 6 P A 7 O S C 1 3 2 6 P A 7 P C 2 3 2 6 P A 5
R E S 4 2 5 P A 6 R E S 4 2 5 P A 6 P C 3 4 2 5 P A 4
P C 0 1 2 0 P A 7 V S S 5 2 4 P A 5 V S S 5 2 4 P A 5 P D 0 5 2 4 P A 3
P C 1 2 1 9 P A 6 V D D 6 2 3 P A 4 V D D 6 2 3 P A 4 P D 1 6 2 3 P A 2
P C 2 3 1 8 P A 5 V S S _ D A C 7 2 2 P A 3 V S S _ D A C 7 2 2 P A 3 P D 2 7 2 2 P A 1
P C 3 4 1 7 P A 4 V D D _ D A C 8 2 1 P A 2 V D D _ D A C 8 2 1 P A 2 P D 3 8 2 1 P A 0
O S C 2 5 1 6 P A 3 L C H 9 2 0 P A 1 L C H 9 2 0 P A 1 O S C 2 9 2 0 N C
O S C 1 6 1 5 P A 2 R C H 1 0 1 9 P A 0 R C H 1 0 1 9 P A 0 O S C 1 1 0 1 9 N C
R E S 7 1 4 P A 1 A U D _ IN 1 1 1 8 N C A U D _ IN 1 1 1 8 N C R E S 1 1 1 8 N C
V S S 8 1 3 P A 0 V B IA S 1 2 1 7 N C V B IA S 1 2 1 7 N C V S S 1 2 1 7 N C
V D D 9 1 2 R C H S P 1 1 3 1 6 S P 0 S P 1 1 3 1 6 S P 0 V D D 1 3 1 6 R C H
V S S _ D A C 1 0 1 1 V D D _ D A C V S S _ A M P 1 4 1 5 V D D _ A M P V S S _ A M P 1 4 1 5 V D D _ A M P V S S _ D A C 1 4 1 5 V D D _ D A C
H T 3 7 A 2 0 H T 3 7 A 7 0 /6 0 /5 0 /4 0 H T 3 7 A 3 0 H T 3 7 A 2 0
2 0 S O P -A 2 8 S O P -A 2 8 S O P -A 2 8 S O P -A
P D 0 1 4 8 P C 7
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
P D 1 2 4 7 P C 6
P D 2 3 4 6 P C 5 6 4 6 3 6 2 6 1 6 0 5 9 5 8 5 7 5 6 5 5 5 4 5 3 5 2
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
N C
P D 3 P C 4 N C 1 5 1 P D 3
4 4 5
N C P C 3 N C 2 5 0 P D 2 8 0 7 9 7 8 7 7 7 6 7 5 7 4 7 3 7 2 7 1 7 0 6 9 6 8 6 7 6 6 6 5 6 4 6 3 6 2 6 1
5 4 4 N C 1 6 0 P D 3
N C P C 2 N C 3 4 9 P D 1
6 4 3 N C 2 5 9 P D 2
N C P C 1 N C 4 4 8 P D 0 N C 3 5 8 P D 1
7 4 2
N C 5 4 7 P C 7 N C 4 5 7 P D 0
O S C 2 8 4 1 P C 0
P C 6 N C 5 5 6 P C 7
O S C 1 P A 7 N C 6 4 6
9 4 0 N C 6 5 5 P C 6
R E S P A 6 O S C 2 7 4 5 P C 5 N C 7 5 4 P C 5
1 0 3 9
N C P A 5 O S C 1 8 4 4 P C 4 N C 8 5 3 P C 4
1 1 3 8
R E S 9 4 3 P C 3 N C 9 5 2 P C 3
N C 1 2 3 7 P A 4 H T 3 7 A 7 0 /6 0 /5 0 /4 0 N C 1 0 H T 3 7 A 7 0 /6 0 /5 0 /4 0 5 1 P C 2
V S S 1 0 4 2 P C 2 N C 8 0 L Q F P -A
N C 1 3 3 6 P A 3 6 4 Q F P -A 1 1 4 0 P C 1
V D D 1 1 4 1 P C 1 O S C 2 1 2 4 9 P C 0
V S S 1 4 3 5 P A 2
V S S _ D A C 1 2 4 0 P C 0 O S C 1 1 3 4 8 P A 7
V D D 1 5 3 4 P A 1 R E S 4 7 P A 6
1 4
V D D _ D A C 1 3 3 9 P A 7
V S S _ D A C 1 6 3 3 P A 0 V S S 1 5 4 6 P A 5
L C H 1 4 3 8 P A 6 V D D 1 6 4 5 P A 4
V D D _ D A C 1 7 3 2 N C
R C H 1 5 3 7 P A 5 V S S _ D A C 1 7 4 4 P A 3
L C H 1 8 3 1 N C V D D _ D A C
A U D _ IN P A 4 1 8 4 3 P A 2
R C H N C 1 6 3 6 L C H
1 9 3 0 1 9 4 2 P A 1
V B IA S 1 7 3 5 P A 3 R C H 4 1 P A 0
A U D _ IN 2 0 2 9 N C 2 0
S P 1 P A 2 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 0
V B IA S N C 1 8 3 4
2 1 2 8
V S S _ A M P 1 9 3 3 P A 1
A U D
V B IA
S P 1
V S S
V D D
S P 0
N C
N C
N C
N C
P B 0
P B 1
P B 2
P B 3
P B 4
P B 5
P B 6
P B 7
V D D
V S S
S P 1 2 2 2 7 N C
2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2
V S S _ A M P 2 3 2 6 N C
_ A M P
_ A D C
_ IN
_ A M P
_ A D C
S
V D D _ A M P
S P 0
P B 0
P B 1
P B 2
P B 3
P B 4
P B 5
P B 6
P B 7
V D D _ A D C
V S S _ A D C
P A 0
V D D _ A M P 2 4 2 5 S P 0
H T 3 7 A 3 0
4 8 S S O P -A
HT37A70/60
www.datasheet4u.com
(0 ,0 )
5 0 P D 3
O S C 2 1
4 9 P D 2
O S C 1 2
4 8 P D 1
R E S 3
4 7 P D 0
N C 4 4 6 P C 7
N C 5 4 5 P C 6
N C 6 4 4 P C 5
V S S 7 4 3 P C 4
V D D 8 4 2 P C 3
9 4 1 P C 2
V S S _ D A C
4 0 P C 1
V D D _ D A C 1 0 3 9 P C 0
L C H 1 1 3 8 P A 7
R C H 1 2 3 7 P A 6
3 6 P A 5
3 5 P A 4
3 4 P A 3
3 3 P A 2
3 2 P A 1
1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 9 3 0 3 1 P A 0
2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8
A U D _ IN
V B IA S
S P 1
V S S _ A M P
V D D _ A M P
V D D _ A M P
V S S _ A M P
S P 0
P B 0
P B 1
P B 2
P B 3
P B 4
P B 5
P B 6
P B 7
V D D _ A D C
V S S _ A D C
HT37A50/40
www.datasheet4u.com
(0 ,0 ) P D 3
O S C 2 1 5 0
O S C 1 2 4 9 P D 2
R E S 3 4 8 P D 1
4 7 P D 0
N C 4 4 6 P C 7
N C 5 4 5 P C 6
N C 6 4 4 P C 5
V S S 7 4 3 P C 4
V D D 8 4 2 P C 3
V S S _ D A C 9 4 1 P C 2
4 0 P C 1
V D D _ D A C 1 0 3 9 P C 0
L C H 1 1 3 8 P A 7
R C H 1 2 3 7 P A 6
3 6 P A 5
3 5 P A 4
3 4 P A 3
3 3 P A 2
3 2 P A 1
1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 9 3 0 3 1 P A 0
2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8
A U D _ IN
V B IA S
S P 1
V S S _ A M P
V D D _ A M P
V D D _ A M P
V S S _ A M P
S P 0
P B 0
P B 1
P B 2
P B 3
P B 4
P B 5
P B 6
P B 7
V D D _ A D C
V S S _ A D C
HT37A30
P D 3
P D 2
P D 1
P D 0
P C 7
P C 6
P C 5
P C 4
4 0 3 9 3 8 3 7 3 6 3 5 3 4 3 3 3 2 P C 3
www.datasheet4u.com 3 1 P C 2
3 0 P C 1
2 9 P C 0
2 8 P A 7
2 7 P A 6
2 6 P A 5
2 5 P A 4
2 4 P A 3
2 3 P A 2
2 2 P A 1
2 1 P A 0
O S C 2 1
O S C 1 2
R E S 3
(0 ,0 )
N C 4
N C 5
N C 6
V S S 7
V D D 8
V S S _ D A C 9
V D D _ D A C 1 0
L C H 1 1
R C H 1 2
1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0
A U D _ IN
V B IA S
S P 1
V S S _ A M P
V D D _ A M P
V D D _ A M P
V S S _ A M P
S P 0
HT37A20
P D 0
P C 3
P C 2
P C 1
P C 0
P A 7
P A 6
P A 5
1 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 P A 4
www.datasheet4u.com
1 9 P A 3
1 8 P A 2
P D 1 2
1 7 P A 1
P D 2 3
1 6 P A 0
P D 3 4
(0 ,0 )
O S C 2 5
O S C 1 6
R E S 7
N C 8
N C 9
N C 1 0
V S S 1 1 1 2 1 3 1 4
1 5
V S S _ D A C
V D D _ D A C
V D D
R C H
Pad Coordinates
HT37A70/60 Unit: mm
HT37A50/40 Unit: mm
HT37A30 Unit: mm
HT37A20 Unit: mm
Pad Description
HT37A70, HT37A60, HT37A50, HT37A40
Configuration
Pad Name I/O Function
Option
www.datasheet4u.com
VDD ¾ ¾ Positive digital power supply
Note: 1. Each pin on PA can be programmed through a configuration option to have a wake-up function.
HT37A30
Configuration
Pad Name I/O Function
Option
VDD ¾ ¾ Positive digital power supply
VDD_DAC
www.datasheet4u.com ¾ ¾ Positive DAC circuit power supply
Note: 1. Each pin on PA can be programmed through a configuration option to have a wake-up function.
HT37A20
Configuration
Pad Name I/O Function
Option
VDD ¾ ¾ Positive digital power supply
VDD_DAC
www.datasheet4u.com ¾ ¾ Positive DAC circuit power supply
Note: 1. Each pin on PA can be programmed through a configuration option to have a wake-up function.
Note: These are stress ratings only. Stresses exceeding the range specified under ²Absolute Maximum Ratings² may
cause substantial damage to the device. Functional operation of this device at other conditions beyond those listed
in the specification is not implied and prolonged exposure to extreme conditions may affect device reliability.
Test Conditions
Symbol Parameter Min. Typ. Max. Unit
VDD Conditions
fOSC=11.059MHz for
2.4 3.0 5.5 V
www.datasheet4u.com HT37A30/20
fOSC=11.059MHz for
VDD Operating Voltage ¾ 3.3 4.5 5.5 V
HT37A50/40
fOSC=11.059MHz for
3.6 4.5 5.5 V
HT37A70/60
3V No load, ¾ 2 8 mA
Operating Current
IDD fOSC=8MHz~12.8MHz,
(Crystal OSC or RC OSC) 5V DAC disable ¾ 8 16 mA
Test Conditions
Symbol Parameter Min. Typ. Max. Unit
VDD Conditions
2.4V~5.5V 8000 11059 12800 kHz
www.datasheet4u.com Oscillator Clock
fOSC ¾ 3.3V~5.5V 8000 11059 12800 kHz
(Crystal OSC/RC OSC)
3.6V~5.5V 8000 11059 12800 kHz
3V ¾ 45 90 180 ms
tWDTOSC Watchdog Oscillator Period
5V ¾ 32 65 130 ms
tRES External Reset Low Pulse Width ¾ ¾ 1 ¾ ¾ ms
Power-up or wake-up from
tSST System Start-up Timer Period ¾ ¾ 1024 ¾ tSYS
HALT
tLVR Low Voltage Width to Reset ¾ ¾ 0.25 1.00 2.00 ms
Note: tSYS= 1/fSYS
fSYS=fOSC/2
Characteristics Curves
R v s . F C h a rt
1 6
1 4
F re q u e n c y (M H z )
1 2
1 0
3 .0 V
8
4 .5 V
6
4
8 2 9 1 1 0 0 1 1 5 1 2 0 1 5 0 1 8 0
R (k W )
V v s . F C h a r t (F o r 3 .0 V & 4 .5 V )
1 6
1 5
1 4
F re q u e n c y (M H z )
1 3
1 1 .0 5 9 M H z /1 0 0 k W (4 .5 V )
1 2
1 1
1 1 .0 5 9 M H z /1 1 5 k W (3 V )
1 0
9
8
2 .4 2 .6 2 .8 3 .0 3 .2 3 .4 3 .8 4 .0
3 .6 4 .2 4 .4 4 .6 4 .8 5 .0 5 .2
V D D (V )
www.datasheet4u.com
5 0
2 0
1 0
0 .5
0 .2
0 .1
0 .0 5
0 .0 2
0 .0 1
1 m 2 m 5 m 1 0 m 2 0 m 5 0 m 1 0 0 m 2 0 0 m 5 0 0 m 1 2 5
O u tp u t P o w e r (W )
%
1 0 0
5 0
2 0
1 0
0 .5
0 .2
0 .1
0 .0 5
0 .0 2
0 .0 1
1 m 2 m 5 m 1 0 m 2 0 m 5 0 m 1 0 0 m 2 0 0 m 5 0 0 m 1 2 5
O u tp u t P o w e r (W )
System Architecture
A key factor in the high-performance features of the instruction cycle. Although the fetching and execution of
Holtek range of Music Type microcontrollers is attrib- instructions takes place in consecutive instruction cy-
uted to the internal system architecture. The range of cles, the pipelining structure of the microcontroller en-
devices take advantage of the usual features found sures that instructions are effectively executed in one
www.datasheet4u.com
within RISC microcontrollers providing increased speed instruction cycle. The exception to this are instructions
of operation and enhanced performance. The pipelining where the contents of the Program Counter are
scheme is implemented in such a way that instruction changed, such as subroutine calls or jumps, in which
fetching and instruction execution are overlapped, case the instruction will take one more instruction cycle
hence instructions are effectively executed in one cycle, to execute. When the RC oscillator is used, OSC2 is
with the exception of branch or call instructions. An 8-bit freed for use as a T1 phase clock synchronizing pin.
wide ALU is used in practically all operations of the in- This T1 phase clock has a frequency of fOSC/8 with a 1:3
struction set. It carries out arithmetic operations, logic high/low duty cycle. For instructions involving branches,
operations, rotation, increment, decrement, branch de- such as jump or call instructions, two machine cycles
cisions, etc. The internal data path is simplified by mov- are required to complete instruction execution. An extra
ing data through the Accumulator and the ALU. Certain cycle is required as the program takes one cycle to first
internal registers are implemented in the Data Memory obtain the actual jump or call address and then another
and can be directly or indirectly addressed. The simple cycle to actually execute the branch. The requirement
addressing methods of these registers along with addi- for this extra cycle should be taken into account by pro-
tional architectural features ensure that a minimum of grammers in timing sensitive applications.
external components is required to provide a functional
I/O and A/D control system with maximum reliability and Program Counter
flexibility. During program execution, the Program Counter is used
to keep track of the address of the next instruction to be
Clocking and Pipelining
executed. It is automatically incremented by one each
The main system clock, derived from either a Crys- time an instruction is executed except for instructions,
tal/Resonator or RC oscillator. The oscillator frequency such as ²JMP² or ²CALL², that demand a jump to a
divided by 2 is subdivided into four internally generated non-consecutive Program Memory address. Note that
non-overlapping clocks, T1~T4. The Program Counter the Program Counter width varies with the Program
is incremented at the beginning of the T1 clock during Memory capacity depending upon which device is se-
which time a new instruction is fetched. The remaining lected. However, it must be noted that only the lower 8
T2~T4 clocks carry out the decoding and execution bits, known as the Program Counter Low Register, are
functions. In this way, one T1~T4 clock cycle forms one directly addressable by user.
T 1 T 2 T 3 T 4 T 1 T 2 T 3 T 4 T 1 T 2 T 3 T 4
S y s te m C lo c k o f M C U
(fS Y S = fO S C /2 )
P ro g ra m C o u n te r P C P C + 1 P C + 2
F e tc h In s t. (P C )
P ip e lin in g
E x e c u te In s t. (P C -1 ) F e tc h In s t. (P C + 1 )
E x e c u te In s t. (P C ) F e tc h In s t. (P C + 2 )
E x e c u te In s t. (P C + 1 )
1 M O V A ,[1 2 H ] F e tc h In s t. 1 E x e c u te In s t. 1
2 C A L L D E L A Y F e tc h In s t. 2 E x e c u te In s t. 2
3 C P L [1 2 H ] F e tc h In s t. 3 F lu s h P ip e lin e
4 : F e tc h In s t. 6 E x e c u te In s t. 6
5 : F e tc h In s t. 7
6 D E L A Y : N O P
Instruction Fetching
When executing instructions requiring jumps to The lower byte of the Program Counter is fully accessi-
non-consecutive addresses such as a jump instruction, ble under program control. Manipulating the PCL might
a subroutine call, interrupt or reset, etc., the cause program branching, so an extra cycle is needed
microcontroller manages program control by loading the to pre-fetch. Further information on the PCL register can
required address into the Program Counter. For condi- be found in the Special Function Register section.
tional skip instructions, once the condition has been
www.datasheet4u.com
met, the next instruction, which has already been Stack
fetched during the present instruction execution, is dis- This is a special part of the memory which is used to
carded and a dummy cycle takes its place while the cor- save the contents of the Program Counter only. The
rect instruction is obtained. stack can have 8 levels depending upon which option is
The lower byte of the Program Counter, known as the selected and is neither part of the data nor part of the
Program Counter Low register or PCL, is available for program space, and is neither readable nor writable.
program control and is a readable and writable register. The activated level is indexed by the Stack Pointer, SP,
By transferring data directly into this register, a short and is neither readable nor writable. At a subroutine call
program jump can be executed directly, however, as or interrupt acknowledge signal, the contents of the Pro-
only this low byte is available for manipulation, the gram Counter are pushed onto the stack. At the end of a
jumps are limited to the present page of memory, that is subroutine or an interrupt routine, signaled by a return
256 locations. When such program jumps are executed instruction, RET or RETI, the Program Counter is re-
it should also be noted that a dummy cycle will be in- stored to its previous value from the stack. After a de-
serted. vice reset, the Stack Pointer will point to the top of the
stack.
Program Counter
Mode
b17~b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Initial Reset 00000 0 0 0 0 0 0 0 0 0 0 0 0 0
Timer/Event Counter 0
00000 0 0 0 0 0 0 0 0 0 1 0 0 0
Overflow
Timer/Event Counter 1
00000 0 0 0 0 0 0 0 0 0 1 1 0 0
Overflow
Timer Counter 2
00000 0 0 0 0 0 0 0 0 1 0 0 0 0
Overflow
ERCOCI Interrupt 00000 0 0 0 0 0 0 0 0 1 0 1 0 0
ADPCM Interrupt 00000 0 0 0 0 0 0 0 0 1 1 0 0 0
Skip Program Counter + 2 (Within Current Bank)
Loading PCL P17~P13 P12 P11 P10 P9 P8 @7 @6 @5 @4 @3 @2 @1 @0
Jump, Call Branch BP1.4~BP1.0 #12 #11 #10 #9 #8 #7 #6 #5 #4 #3 #2 #1 #0
Return from Subroutine S17~S13 S12 S11 S10 S9 S8 S7 S6 S5 S4 S3 S2 S1 S0
Program Counter
The arithmetic-logic unit or ALU is a critical area of the This vector is reserved for the Timer/Event Counter 0
interrupt service program. If a timer interrupt results
microcontroller that carries out arithmetic and logic op-
from a Timer/Event Counter 0 overflow, and if the in-
erations of the instruction set. Connected to the main
terrupt is enabled and the stack is not full, the program
microcontroller data bus, the ALU receives related in- begins execution at location 008H.
struction codes and performs the required arithmetic or
· Location 00CH
logical operations after which the result will be placed in
the specified register. As these ALU calculation or oper- This vector is reserved for the Timer/Event Counter 1
interrupt service program. If a timer interrupt results
ations may result in carry, borrow or other status
from a Timer/Event Counter 1 overflow, and if the in-
changes, the status register will be correspondingly up-
terrupt is enabled and the stack is not full, the program
dated to reflect these changes. The ALU supports the begins execution at location 00CH.
following functions:
· Location 010H
· Arithmetic operations: ADD, ADDM, ADC, ADCM,
This vector is reserved for the Timer Counter 2 inter-
SUB, SUBM, SBC, SBCM, DAA
rupt service program. If a timer interrupt results from a
· Logic operations: AND, OR, XOR, ANDM, ORM, Timer Counter 2 overflow, and if the interrupt is en-
XORM, CPL, CPLA abled and the stack is not full, the program begins ex-
· Rotation RRA, RR, RRCA, RRC, RLA, RL, RLCA, ecution at location 0010H.
RLC
· Location 014H
· Increment and Decrement INCA, INC, DECA, DEC This vector is reserved for the ERCOCI interrupt ser-
· Branch decision, JMP, SZ, SZA, SNZ, SIZ, SDZ, vice program. If an external RC oscillation converter
SIZA, SDZA, CALL, RET, RETI interrupt results from an external RC oscillation con-
verter interrupt is activated, and the stack is not full,
the program begins execution at location 0014H.
Program Memory
· Location 018H
The Program Memory is the location where the user
This vector is reserved for the Adpcm interrupt service
code or program is stored. The type of memory is the program. If a Adpcm interrupt results, and if the inter-
mask ROM memory. It offer the most cost effective solu- rupt is enabled and the stack is not full, the program
tions for high volume products. begins execution at location 0018H.
Structure
The Program Memory has a capacity of 256K by 16,
192K by 16, 128K by 16, 96K by 16, 64K by 16 or 32K by
H T 3 7 A 7 0 H T 3 7 A 6 0 H T 3 7 A 5 0
0 0 0 H 0 0 0 H 0 0 0 H
In itia lis a tio n In itia lis a tio n In itia lis a tio n
V e c to r V e c to r V e c to r
0 0 4 H 0 0 4 H 0 0 4 H
E x te rn a l E x te rn a l E x te rn a l
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
www.datasheet4u.com 0 0 8 H 0 0 8 H 0 0 8 H
T im e r /E v e n t C o u n te r 0 T im e r /E v e n t C o u n te r 0 T im e r /E v e n t C o u n te r 0
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 0 C H 0 0 C H 0 0 C H
T im e r /E v e n t C o u n te r 1 T im e r /E v e n t C o u n te r 1 T im e r /E v e n t C o u n te r 1
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 1 0 H 0 1 0 H 0 1 0 H
T im e r /E v e n t C o u n te r 2 T im e r /E v e n t C o u n te r 2 T im e r /E v e n t C o u n te r 2
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 1 4 H 0 1 4 H 0 1 4 H
E R C O C I E R C O C I E R C O C I
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 1 8 H 0 1 8 H 0 1 8 H
A D P C M A D P C M A D P C M
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 1 C H 0 1 C H 0 1 C H
1 F F F H 1 F F F H 1 F F F H
B a n k 1 ~ 2 3 B a n k 1 ~ 1 5
B a n k 1 ~ 3 1 (B P 1 [4 :0 ]= [1 ]~ [1 7 H ]) (B P 1 [3 :0 ]= [1 ]~ [0 F H ])
(B P 1 [4 :0 ]= [1 ]~ [1 F H ])
1 F F F F H
2 F F F F H
1 6 b its
3 F F F F H 1 6 b its
1 6 b its
H T 3 7 A 4 0 H T 3 7 A 3 0 H T 3 7 A 2 0
0 0 0 H 0 0 0 H 0 0 0 H
In itia lis a tio n In itia lis a tio n In itia lis a tio n
V e c to r V e c to r V e c to r
0 0 4 H 0 0 4 H 0 0 4 H
E x te rn a l E x te rn a l E x te rn a l
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 0 8 H 0 0 8 H 0 0 8 H
T im e r /E v e n t C o u n te r 0 T im e r /E v e n t C o u n te r 0 T im e r /E v e n t C o u n te r 0
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 0 C H 0 0 C H 0 0 C H
T im e r /E v e n t C o u n te r 1 T im e r /E v e n t C o u n te r 1 T im e r /E v e n t C o u n te r 1
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 1 0 H 0 1 0 H 0 1 0 H
T im e r /E v e n t C o u n te r 2 T im e r /E v e n t C o u n te r 2 T im e r /E v e n t C o u n te r 2
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 1 4 H 0 1 4 H 0 1 4 H
E R C O C I E R C O C I E R C O C I
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 1 8 H 0 1 8 H 0 1 8 H
A D P C M A D P C M A D P C M
In te rru p t V e c to r In te rru p t V e c to r In te rru p t V e c to r
0 1 C H 0 1 C H 0 1 C H
1 F F F H 1 F F F H 1 F F F H
B a n k 1 ~ 3
B a n k 1 ~ 1 1 B a n k 1 ~ 7
7 F F F H (B P 1 [1 :0 ]= [1 ]~ [3 ])
(B P 1 [3 :0 ]= [1 ]~ [0 B H ]) (B P 1 [2 :0 ]= [1 ]~ [7 ])
F F F F H 1 6 b its
1 7 F F F H
1 6 b its
1 6 b its
Program Memory Structure
Table Location
Note: For the HT37A70/60, the ROM bank point register is 5 bits wide effectively, i.e. from b4~b0.
For the HT37A50/40, the ROM bank point register is 4 bits wide effectively, i.e. from b3~b0.
For the HT37A30, the ROM bank point register is 3 bits wide effectively, i.e. from b2~b0.
For the HT37A20, the ROM bank point register is 2 bits wide effectively, i.e. from b1~b0.
0 F F H
General Purpose Data Memory
B a n k 0 B a n k 1 All microcontroller programs require an area of
Bank 0~Bank 1 RAM Data Memory Structure read/write memory where temporary data can be stored
and retrieved for use later. It is this area of RAM memory
that is known as General Purpose Data Memory. This
Structure area of Data Memory is fully accessible by the user pro-
The RAM Data Memory is subdivided into 2 banks, gram for both read and write operations. The bank 0
known as Bank 0 and Bank 1, all of which are imple- data memory areas can handle arithmetic, logic, incre-
mented in 8-bit wide RAM. Most of the RAM Data Mem- ment, decrement and rotate operations directly. By us-
ory is located in Bank 0 which is also subdivided into two ing the ²SET [m].i² and ²CLR [m].i² instructions
sections, the Special Purpose Data Memory and the individual bits can be set or reset under program control
General Purpose Data Memory. The start address of the giving the user a large range of flexibility for bit manipu-
Data Memory is the address ²00H². Registers which are lation in the Data Memory.
Special Purpose Data Memory the details of which are located under the relevant Spe-
This area of Data Memory is where registers, necessary cial Function Register section. Note that for locations
for the correct operation of the microcontroller, are that are unused, any read instruction to these addresses
stored. such as timers, interrupts, etc., as well as exter- will return the value ²00H². Although the Special Pur-
nal functions such as I/O data control and A/D converter pose Data Memory registers are located in Bank 0, they
www.datasheet4u.com
operation. Most of the registers are both readable and will still be accessible even if the Bank Pointer has se-
writable but some are protected and are readable only, lected Bank 1.
H T 3 7 A 7 0 /6 0 H T 3 7 A 7 0 /6 0
H T 3 7 A 5 0 /4 0 H T 3 7 A 5 0 /4 0 H T 3 7 A 3 0 H T 3 7 A 3 0 H T 3 7 A 2 0 H T 3 7 A 2 0
0 0 H IA R 0 2 E H M P 2 0 0 H IA R 0 2 E H M P 2 0 0 H IA R 0 2 E H M P 2
0 1 H M P 0 2 F H R B P 2 0 1 H M P 0 2 F H R B P 2 0 1 H M P 0 2 F H R B P 2
0 2 H IA R 1 3 0 H A D R 0 2 H IA R 1 3 0 H A D R 0 2 H IA R 1 3 0 H A D R
0 3 H M P 1 3 1 H X S P L 0 3 H M P 1 3 1 H X S P L 0 3 H M P 1 3 1 H X S P L
0 4 H R B P 1 3 2 H X S P H 0 4 H R B P 1 3 2 H X S P H 0 4 H R B P 1 3 2 H X S P H
0 5 H A C C 3 3 H A D P C 0 5 H A C C 3 3 H A D P C 0 5 H A C C 3 3 H A D P C
0 6 H P C L 3 4 H A D P S 0 6 H P C L 3 4 H A D P S 0 6 H P C L 3 4 H A D P S
0 7 H T B L P 1 3 5 H IN T C H 0 7 H T B L P 1 3 5 H IN T C H 0 7 H T B L P 1 3 5 H IN T C H
0 8 H T B L H 3 6 H 0 8 H T B L H 3 6 H 0 8 H T B L H 3 6 H
0 9 H W D T S 3 7 H T M R 2 L 0 9 H W D T S 3 7 H T M R 2 L 0 9 H W D T S 3 7 H T M R 2 L
0 A H S T A T U S 3 8 H T M R 2 C 0 A H S T A T U S 3 8 H T M R 2 C 0 A H S T A T U S 3 8 H T M R 2 C
0 B H IN T C 3 9 H 0 B H IN T C 3 9 H 0 B H IN T C 3 9 H
0 C H T M R 0 H 3 A H T M R 3 L 0 C H T M R 0 H 3 A H T M R 3 L 0 C H T M R 0 H 3 A H
0 D H T M R 0 L 3 B H T M R 3 C 0 D H T M R 0 L 3 B H T M R 3 C 0 D H T M R 0 L 3 B H
0 E H T M R 0 C 3 C H 0 E H T M R 0 C 3 C H 0 E H T M R 0 C 3 C H
0 F H 3 D H 0 F H 3 D H 0 F H 3 D H
1 0 H T M R 1 L 3 E H 1 0 H T M R 1 L 3 E H 1 0 H T M R 1 L 3 E H
1 1 H T M R 1 C 3 F H 1 1 H T M R 1 C 3 F H 1 1 H T M R 1 C 3 F H
1 2 H P A 4 0 H A S C R 1 2 H P A 4 0 H A S C R 1 2 H P A 4 0 H A S C R
1 3 H P A C 4 1 H T M R A H 1 3 H P A C 4 1 H T M R A H 1 3 H P A C 4 1 H T M R A H
1 4 H P B 4 2 H T M R A L 1 4 H P B 4 2 H T M R A L 1 4 H P B 4 2 H T M R A L
1 5 H P B C 4 3 H R C O C C R 1 5 H P B C 4 3 H R C O C C R 1 5 H P B C 4 3 H R C O C C R
1 6 H P C 4 4 H T M R B H 1 6 H P C 4 4 H T M R B H 1 6 H P C 4 4 H T M R B H
1 7 H P C C 4 5 H T M R B L 1 7 H P C C 4 5 H T M R B L 1 7 H P C C 4 5 H T M R B L
1 8 H P D 4 6 H R C O C R 1 8 H P D 4 6 H R C O C R 1 8 H P D 4 6 H R C O C R
1 9 H P D C 4 7 H A D R L 1 9 H P D C 4 7 H 1 9 H P D C 4 7 H A D R L
1 A H 4 8 H A D R H 1 A H 4 8 H 1 A H P E 4 8 H A D R H
1 B H 4 9 H A D C R 1 B H 4 9 H 1 B H P E C 4 9 H A D C R
1 C H 4 A H A C S R 1 C H 4 A H 1 C H 4 A H A C S R
1 D H D A H 4 B H 1 D H D A H 4 B H 1 D H D A H 4 B H S B C R
1 E H D A L 4 C H 1 E H D A L 4 C H 1 E H D A L 4 C H S B D R
1 F H D A C C 4 D H 1 F H D A C C 4 D H 1 F H D A C C 4 D H R S 2 3 2 C
2 0 H C H A N 4 E H 2 0 H C H A N 4 E H 2 0 H C H A N 4 E H T X D
2 1 H F re q N H 4 F H 2 1 H F re q N H 4 F H 2 1 H F re q N H 4 F H R X D
2 2 H F re q N L 5 0 H 2 2 H F re q N L 5 0 H 2 2 H F re q N L 5 0 H P F
2 3 H A d d rH 5 1 H 2 3 H A d d rH 5 1 H 2 3 H A d d rH 5 1 H P F C
2 4 H A d d rL 5 2 H 2 4 H A d d rL 5 2 H 2 4 H A d d rL 5 2 H P G
2 5 H R e p H 5 3 H 2 5 H R e p H 5 3 H 2 5 H R e p H 5 3 H P G C
2 6 H R e p L 5 4 H 2 6 H R e p L 5 4 H 2 6 H R e p L 5 4 H B R G R
2 7 H E N V 5 5 H 2 7 H E N V 5 5 H 2 7 H E N V 5 5 H
2 8 H A d d rH 1 2 8 H A d d rH 1 2 8 H A d d rH 1
2 9 H L V C 5 F H 2 9 H L V C 5 F H 2 9 H L V C 5 F H
G e n e ra l G e n e ra l G e n e ra l
2 A H R V C 2 A H R V C 2 A H R V C
6 0 H P u rp o s e 6 0 H P u rp o s e 6 0 H P u rp o s e
2 B H T B M P 1 2 B H T B M P 1 2 B H T B M P 1
D a ta M e m o ry D a ta M e m o ry D a ta M e m o ry
2 C H T B H P 1 (3 2 0 B y te s :
2 C H (3 2 0 B y te s :
2 C H (3 2 0 B y te s :
2 D H B P 1 F F H 1 6 0 B y te s x 2 B a n k s ) 2 D H B P 1 F F H 1 6 0 B y te s x 2 B a n k s ) 2 D H B P 1 F F H 1 6 0 B y te s x 2 B a n k s )
: U n u s e d , re a d a s "0 0 "
Example
The following example shows how to clear General Purpose Data Memory of bank0 by using MP0 and bank0~bank1
by using MP1 and MP2
code .section at 0 code
org 00h
RAM0TEST:
MOV A,60H
MOV MP0,A ; loaded with first RAM address
LOOP0:
CLR IAR0 ; clear the data at address defined by MP0
CLR WDT
SIZ MP0 ; increase MP0, and skip out if MP0 is ²0²
JMP LOOP0
:
RAM1TEST:
CLR DACC.7 ; access data to iar1 by MP1
CLR rBP1 ; clear RAM bank pointer 1
RAM1_MP1:
MOV A,rBP1 ; load rBP1 data, and check if rBP1 is ²25²
XOR A,25
SZ ZERO ; jump to exit loop if rBP1 is ²2²
JMP RAM1TEST_Exit
MOV A,60H ; loaded with first RAM address to MP1
MOV MP1,A
LOOP1:
CLR WDT
CLR IAR1 ; clear the data at address defined by MP1
SIZ MP1 ; increase MP1, and skip out if MP1 is ²0²
JMP LOOP1
INC rBP1 ; increase rBP1
JMP RAM1_MP1
RAM1TEST_Exit:
:
RAM2TEST:
Set dacc.7 ; access data to iar1 by MP2
CLR rBP2 ; clear RAM bank pointer 2
RAM1MP2:
MOV A,RBP2
XOR A,25
SZ ZERO ; jump to exit loop if rBP2 is ²2²
JMP RAM2TEST_Exit
MOV A,60H ; loaded with first RAM address to MP2
www.datasheet4u.com MOV MP2,A
LOOP2:
CLR WDT
CLR IAR1 ; clear the data at address defined by MP2
SIZ MP2 ; increase MP2, and skip out if MP2 is ²0²
JMP LOOP2
INC rBP2 ; increase rBP2
JMP RAM1MP2
RAM2TEST_Exit:
:
Watchdog Timer Register - WDTS · AC is set if an operation results in a carry out of the
low nibbles in addition, or no borrow from the high nib-
The Watchdog feature of the microcontroller provides
ble into the low nibble in subtraction; otherwise AC is
an automatic reset function giving the microcontroller a cleared.
means of protection against spurious jumps to incorrect
· Z is set if the result of an arithmetic or logical operation
Program Memory addresses. To implement this, a timer
www.datasheet4u.com
is provided within the microcontroller which will issue a is zero; otherwise Z is cleared.
reset command when its value overflows. To provide · OV is set if an operation results in a carry into the high-
variable Watchdog Timer reset times, the Watchdog est-order bit but not a carry out of the highest-order bit,
Timer clock source can be divided by various division ra- or vice versa; otherwise OV is cleared.
tios, the value of which is set using the WDTS register. · PDF is cleared by a system power-up or executing the
By writing directly to this register, the appropriate divi- ²CLR WDT² instruction. PDF is set by executing the
sion ratio for the Watchdog Timer clock source can be ²HALT² instruction.
setup. Note that only the lower 3 bits are used to set divi-
sion ratios between 1 and 128. · TO is cleared by a system power-up or executing the
²CLR WDT² or ²HALT² instruction. TO is set by a
Status Register - STATUS WDT time-out.
This 8-bit register contains the zero flag (Z), carry flag In addition, on entering an interrupt sequence or execut-
(C), auxiliary carry flag (AC), overflow flag (OV), power ing a subroutine call, the status register will not be
down flag (PDF), and watchdog time-out flag (TO). pushed onto the stack automatically. If the contents of
These arithmetic/logical operation and system manage- the status registers are important and if the subroutine
ment flags are used to record the status and operation of can corrupt the status register, precautions must be
the microcontroller. taken to correctly save it.
With the exception of the TO and PDF flags, bits in the Interrupt Control Registers - INTC, INTCH
status register can be altered by instructions like most
other registers. Any data written into the status register The two 8-bit registers, known as the INTC and INTCH
will not change the TO or PDF flag. In addition, opera- register which control the operation of both external and
tions related to the status register may give different re- internal timer, CR/F and ADPCM interrupts, and By set-
sults due to the different instruction operations. The TO ting various bits within this register using standard bit
flag can be affected only by a system power-up, a WDT manipulation instructions, the enable/disable function of
the external and timer, CR/F and ADPCM interrupts can
time-out or by executing the ²CLR WDT² or ²HALT² in-
be independently controlled. A master interrupt bit within
struction. The PDF flag is affected only by executing the
this register, the EMI bit, acts like a global enable/dis-
²HALT² or ²CLR WDT² instruction or during a system
able and is used to set all of the interrupt enable bits on
power-up.
or off. This bit is cleared when an interrupt routine is en-
The Z, OV, AC and C flags generally reflect the status of tered to disable further interrupt and is set by executing
the latest operations. the ²RETI² instruction.
· C is set if an operation results in a carry during an ad-
Note: In situations where other interrupts may require
dition operation or if a borrow does not take place dur-
servicing within present interrupt service rou-
ing a subtraction operation; otherwise C is cleared. C
tines, the EMI bit can be manually set by the
is also affected by a rotate through carry instruction.
program after the present interrupt service rou-
tine has been entered.
b 7 b 0
T O P D F O V Z A C C S T A T U S R e g is te r
A r
ith m e tic /L o g ic O p e r a tio n F la g s
C a r r y fla g
A u x ilia r y c a r r y fla g
Z e
r o fla g
O v e r flo w fla g
S y s te m M a n a g e m e n t F la g s
P o w e r d o w n fla g
W a tc h d o g tim e - o u t fla g
N o t im p le m e n te d , re a d a s "0 "
Status Register
A/D Converter Registers - ADRL, ADRH, ADCR, Various methods exist to wake-up the microcontroller,
ACSR one of which is to change the logic condition on one of
the PA0~PA7 pins from high to low. After a HALT instruc-
HT37A70/60/50/40 contains a 8-channel 12-bit A/D
tion forces the microcontroller into entering the Power
converter. The correct operation of the A/D requires the
Down Mode, the processor will remain idle or in a
use of two data registers, a control register and a clock
www.datasheet4u.com low-power state until the logic condition of the selected
source register. It contain a 12-bit A/D converter, there
wake-up pin on Port A changes from high to low. This
are two data registers, a high byte data register known
function is especially suitable for applications that can
as ADRH, and a low byte data register known as ADRL.
be woken up via external switches. Note that pins PA0 to
These are the register locations where the digital value
PA7 can be selected individually to have this wake-up
is placed after the completion of an analog to digital con-
feature using an PA wake up option, located in the con-
version cycle. The channel selection and configuration
figuration.
of the A/D converter is setup via the control register
ADCR while the A/D clock frequency is defined by the
I/O Port Control Registers
clock source register, ACSR. HT37A30/20 was not inte-
grated A/D converter. Each I/O port have their own control register, known as
PAC, PAB, PCC and PDC, which control the input/out-
put configuration. With this control register, each PA~PD
Input/Output Ports
I/O pin with or without pull-high resistors can be recon-
Holtek microcontrollers offer considerable flexibility on figured by pull-hi option control. Pins PA~PD ports are
their I/O ports. With the input or output designation of ev- directly mapped to a bit in its associated port control reg-
ery pin fully under user program control, pull-high op- ister. For the I/O pin to function as an input, the corre-
tions for all ports and wake-up options on certain pins, sponding bit of the control register must be written as a
the user is provided with an I/O structure to meet the ²1². This will then allow the logic state of the input pin to
needs of a wide range of application possibilities. De- be directly read by instructions. When the correspond-
pending upon which device or package is chosen, the ing bit of the control register is written as a ²0², the I/O
microcontroller range provides from 16 to 28 pin will be setup as a CMOS output. If the pin is currently
bidirectional input/output lines labeled with port names setup as an output, instructions can still be used to read
PA, PB, PC and PD. These I/O ports are mapped to the the output register.
RAM Data Memory with specific addresses as shown in
However, it should be noted that the program will in fact
the Special Purpose Data Memory table. All of these I/O
only read the status of the output data latch and not the
ports can be used for input and output operations. For
actual logic status of the output pin.
input operation, these ports are non-latching, which
means the inputs must be ready at the T2 rising edge of · Pin-shared Functions
instruction ²MOV A,[m]², where m denotes the port ad- The flexibility of the microcontroller range is greatly
dress. enhanced by the use of pins that have more than one
function. Limited numbers of pins can force serious
For output operation, all the data is latched and remains design constraints on designers but by supplying pins
unchanged until the output latch is rewritten. with multi-functions, many of these difficulties can be
overcome. For some pins, the chosen function of the
Pull-high Resistors multi-function I/O pins is set by configuration options
Many product applications require pull-high resistors for while for others the function is set by application pro-
gram control.
their switch inputs usually requiring the use of an exter-
nal resistor. To eliminate the need for these external re- · External Interrupt Input
sistors, I/O pins PA~PD, when configured as an input The external interrupt pin, INT, is pin-shared with the
have the capability of being connected to an internal I/O pin PA5. To use the pin as an external interrupt in-
pull-high resistor. These pull-high resistors are put the correct bits in the PA share pin option must be
selectable via PA~PD option respectively, located in the selected. The pin must also be setup as an input by
setting the appropriate bit in the Port Control Register.
configuration. The pull-high resistors are implemented
A pull-high resistor can also be selected via the appro-
using weak PMOS transistors.
priate port pull-high option.
Port A Wake-up
If the HALT instruction is executed, the device will enter
the Power Down Mode, where the system clock will stop
resulting in power being conserved, a feature that is im-
portant for battery and other low-power applications.
· A/D Inputs the exact logical construction of the I/O pin may differ
The HT37A70/60/50/40 have 8 A/D converter channel from these drawings, they are supplied as a guide only
inputs. All of these analog inputs are pin-shared with to assist with the functional understanding of the I/O
PB0 to PB7. If these pins are to be used as A/D inputs pins.
and not as normal I/O pins then the corresponding bits
in the A/D Converter Control Register, ADCR.3~5 and Programming Considerations
www.datasheet4u.com
ADSR.4, must be properly set. There are no configu-
ration options associated with the A/D function. If Within the user program, one of the first things to con-
used as I/O pins, then full pull-high resistor selections sider is port initialization. After a reset, the PA~PD data
remain, however if used as A/D inputs then any register and PAC~PDC port control register will be set
pull-high resistor selections associated with these high. This means that all I/O pins will default to an input
pins will be automatically disconnected. state, the level of which depends on the other connected
· CR/F analog switch Inputs circuitry and whether pull-high options have been se-
The HT37A70/60/50/40/30 have 8 CR/F converter in- lected. If the PAC port control register, is then pro-
puts. All of these analog inputs are pin-shared with grammed to setup some pins as outputs, these output
PC0 to PC7. If these pins are to be used as CR/F ana- pins will have an initial high output value unless the as-
log switch Inputs and not as normal I/O pins then the sociated PA port data register is first programmed. Se-
corresponding bits in the Option, ²PC0~7 share pin lecting which pins are inputs and which are outputs can
configuration². The HT37A20 have 4 CR/F converter be achieved byte-wide by loading the correct value into
inputs. All of these analog inputs are pin-shared with the port control register or by programming individual
PC0 to PC3. If these pins are to be used as CR/F ana-
bits in the port control register using the ²SET [m].i² and
log switch Inputs and not as normal I/O pins then the
corresponding bits in the configuration, ²PC0~3 share ²CLR [m].i² instructions.
pin configuration². Note that when using these bit control instructions, a
· CR/F oscillator pin
read-modify-write operation takes place. The
The HT37A70/60/50/40/30/20 have 4 CR/F oscillator microcontroller must first read in the data on the entire
pins. All of these CR/F oscillator pin are pin-shared with port, modify it to the required new bit values and then re-
PD0 to PD3. If these pins are to be used as CR/F oscil- write this data back to the output ports.
lator pins and not as normal I/O pins then the corre-
sponding bits in the Option, ²PD0~3 share pin Option².
I/O Pin Structures
T 1 T 2 T 3 T 4 T 1 T 2 T 3 T 4
The diagrams illustrate the I/O pin internal structures. As
S y s te m C lo c k
P o rt D a ta
W r ite to P o r t R e a d fro m P o rt
Read/Write Timing
C o n tr o l B it
D a ta B u s D Q V D D
W r ite C o n tr o l R e g is te r C K Q W e a k
S V D D
P u ll- u p
C h ip R e s e t
M a s k O p tio n
R e a d C o n tr o l R e g is te r
D a ta B it I/O L in e
D Q
W r ite I/O C K Q
S
M
U
R e a d I/O X
S y s te m W a k e -U p
M a s k O p tio n
Input/Output Port
Timer/Event Counters
The provision of timers form an important part of any initial value can be preloaded. Reading from this register
microcontroller, giving the designer a means of carrying retrieves the contents of the Timer/Event Counter. The
out time related functions. The devices contain two second type of associated register is the Timer Control
count-up timers 8-bit capacity and one count-up timers Register which defines the timer options and deter-
www.datasheet4u.com
16-bit capacity. As the timer 0/1 has three different oper- mines how the timer is to be used. The Timer/Event
ating modes, they can be configured to operate as a Counter 0 can have the timer clock configured to come
general timer, an external event counter or as a pulse from the internal clock source. The clock source is
width measurement device. But the timer 2 only be con- fOSC/8.In addition, the timer clock source of Timer/Event
figured to operate as a general timer. The provision of an Counter 0 can also be configured to come from an inter-
internal prescaler to the clock circuitry of some of the nal RC 12kHz.
timer/event counters gives added range to the timer 1/2. An external clock source is used when the timer is in the
There are three types of registers related to the event counting mode, the clock source being provided
Timer/Event Counters 0. The first two register contain on the external timer pin, known as TMR0 or TMR1.
the actual high and low byte value of the timer and into These external timer pins are pin-shared with other I/O
which an initial value can be preloaded. pins. Depending upon the condition of PA share pin op-
tion, each high to low, or low to high transition on the ex-
There are two types of registers related to the
ternal timer input pin will increment the counter by one.
Timer/Event Counters 1/2. The first is the register that
contains the actual value of the timer and into which an
D a ta B u s
L o w B y te
B u ffe r
1 6 - b it T im e r /E v e n t C o u n te r R e lo a d
P r e lo a d R e g is te r
fO S C /8 M T 0 M 1 T 0 M 0
U
R C 1 2 K X
T im e r /E v e n t C o u n te r H ig h B y te L o w B y te O v e r flo w
T 0 S M o d e C o n tro l to In te rru p t
T 0 O N 1 6 - B it T im e r /E v e n t C o u n te r
T M R 0
T 0 E
16-bit Timer/Event Counter 0 Structure
D a ta B u s
R e lo a d
P r e lo a d R e g is te r
T 1 P S C 2 ~ T 1 P S C 0 T 1 M 1 T 1 M 0
(1 /1 6 ~ 1 /2 0 4 8 )
fO S C 8 - S ta g e P r e s c a le r T im e r /E v e n t C o u n te r T im e r /E v e n t C o u n te r O v e r flo w
M o d e C o n tro l to In te rru p t
T M R 1 T 1 O N
T 1 E
8-bit Timer/Event Counter 1 Structure
D a ta B u s
R e lo a d
P r e lo a d R e g is te r
T 2 P S C 2 ~ T 2 P S C 0 T 2 M 1 T 2 M 0
(1 /1 6 ~ 1 /2 0 4 8 )
fO S C 8 - S ta g e P r e s c a le r T im e r C o u n te r T im e r C o u n te r O v e r flo w
M o d e C o n tro l to In te rru p t
T 2 O N
Configuring the Timer/Event Counter Input Clock generated. The timer value will then be reset with the ini-
Source tial preload register value and continue counting.
The internal timer¢s clock can originate from various Note that to achieve a maximum full range count of FFH
sources, depending upon timer is chosen. The system for the 8-bit timer or FFFFH for the 16-bit timers, the
clock input timer source is used when the timer is in the preload registers must first be cleared to all zeros. It
www.datasheet4u.com
timer mode or in the pulse width measurement mode. should be noted that after power-on, the preload regis-
ters will be in an unknown condition. Note that if the
For Timer/Event Counter 0, these system clock timer
Timer/Event Counters are in an OFF condition and data
source is selected by TMR0C.5.
is written to their preload registers, this data will be im-
For Timer/Event Counter 1, 2 this system clock timer mediately written into the actual counter. However, if the
source is first divided by a prescaler, the division ratio of counter is enabled and counting, any new data written
which is conditioned by the Timer Control Register bits into the preload data register during this period will re-
T1PSC0~T1PSC2. main in the preload register and will only be written into
An external clock source is used when the timer is in the the actual counter the next time an overflow occurs.
event counting mode, the clock source being provided Note also that when the timer registers are read, the
on the external timer pin, known as TMR0 or TMR1. timer clock will be blocked to avoid errors, however, as
These external timer pins are pin-shared with other I/O this may result in certain timing errors, programmers
pins. Depending upon the condition of PA share pin op- must take this into account.
tion, each high to low, or low to high transition on the ex- The 16-bit Timer/Event Counter have contained both
ternal timer input pin will increment the counter by one. low byte and high byte timer registers, accessing these
registers is carried out in a specific way. It must be noted
Timer Registers - TMR0H/TMR0L, TMR1, TMR2 that when using instructions to preload data into the low
The timer registers are special function registers located byte register, namely TMR0L, the data will only be
in the special purpose Data Memory and is the place placed in a low byte buffer and not directly into the low
where the actual timer value is stored. For the 8-bit timer, byte register. The actual transfer of the data into the low
this register is known as Timer/Event Counter 1/2. In the byte register is only carried out when a write to its asso-
case of the 16-bit timer, a pair of 8-bit registers are re- ciated high byte register, namely TMR0H, is executed.
quired to store the 16-bit timer values. These are known On the other hand, using instructions to preload data
as TMR1L/TMR1H. The value in the timer registers in- into the high byte timer register will result in the data be-
creases by one each time an internal clock pulse is re- ing directly written to the high byte register. At the same
ceived or an external transition occurs on the external time the data in the low byte buffer will be transferred
timer pin. The timer will count from the initial value loaded into its associated low byte register. For this reason,
by the preload register to the full count of FFH for the 8-bit when preloading data into the 16-bit timer registers, the
timer or FFFFH for the 16-bit timers, at which point the low byte should be written first. It must also be noted that
timer overflows and a timer internal interrupt signal is to read the contents of the low byte register, a read to the
b 7 b 0
T 0 M 1 T 0 M 0 T 0 S T 0 O N T 0 E T M R 0 C R e g is te r
N o t im p le m e n te d , r e a d a s " 0 "
E v e n t C o u n te r A c tiv e E d g e S e le c t
1 : c o u n t o n fa llin g e d g e
0 : c o u n t o n r is in g e d g e
P u ls e W id th M e a s u r e m e n t A c tiv e E d g e S e le c t
1 : s ta rt c o u n tin g o n r is in g e d g e , s to p o n fa llin g e d g e
0 : s ta rt c o u n tin g o n fa llin g e d g e , s to p o n r is in g e d g e
T im e r /E v e n t C o u n te r C o u n tin g E n a b le
1 : e n a b le
0 : d is a b le
T im e r C lo c k S o u r c e
1 : R C 1 2 K
0 : fO S C /8
O p e r a tin g M o d e S e le c t
T 0 M 1 T 0 M 0
0 0 n o m o d e a v a ila b le
0 1 e v e n t c o u n te r m o d e
1 0 tim e r m o d e
1 1 p u ls e w id th m e a s u r e m e n t m o d e
b 7 b 0
T 1 M 1 T 1 M 0 T 1 O N T 1 E T 1 P S C 2 T 1 P S C 1 T 1 P S C 0 T M R 1 C R e g is te r
T im e r P r e s c a le r R a te S e le c t
T 1 P S C 2 T 1 P S C 1 T 1 P S C 0 T im e r R a te
0 0 0 1 :1 6
www.datasheet4u.com 0 0 1 1 :3 2
0 1 0 1 :6 4
0 1 1 1 :1 2 8
1 0 0 1 :2 5 6
1 0 1 1 :5 1 2
1 1 0 1 :1 0 2 4
1 1 1 1 :2 0 4 8
E v e n t C o u n te r A c tiv e E d g e S e le c t
1 : c o u n t o n fa llin g e d g e
0 : c o u n t o n r is in g e d g e
P u ls e W id th M e a s u r e m e n t A c tiv e E d g e S e le c t
1 : s ta rt c o u n tin g o n r is in g e d g e , s to p o n fa llin g e d g e
0 : s ta rt c o u n tin g o n fa llin g e d g e , s to p o n r is in g e d g e
T im e r /E v e n t C o u n te r C o u n tin g E n a b le
1 : e n a b le
0 : d is a b le
N o t im p le m e n te d , r e a d a s " 0 "
O p e r a tin g M o d e S e le c t
T 1 M 1 T 1 M 0
0 0 n o m o d e a v a ila b le
0 1 e v e n t c o u n te r m o d e
1 0 tim e r m o d e
1 1 p u ls e w id th m e a s u r e m e n t m o d e
b 7 b 0
T 2 M 1 T 2 M 0 T 2 O N T 2 E T 2 P S C 2 T 2 P S C 1 T 2 P S C 0 T M R 2 C R e g is te r
T im e r P r e s c a le r R a te S e le c t
T 2 P S C 2 T 2 P S C 1 T 2 P S C 0 T im e r R a te
0 0 0 1 :1 6
0 0 1 1 :3 2
0 1 0 1 :6 4
0 1 1 1 :1 2 8
1 0 0 1 :2 5 6
1 0 1 1 :5 1 2
1 1 0 1 :1 0 2 4
1 1 1 1 :2 0 4 8
E v e n t C o u n te r A c tiv e E d g e S e le c t
1 : c o u n t o n fa llin g e d g e
0 : c o u n t o n r is in g e d g e
P u ls e W id th M e a s u r e m e n t A c tiv e E d g e S e le c t
1 : s ta rt c o u n tin g o n r is in g e d g e , s to p o n fa llin g e d g e
0 : s ta rt c o u n tin g o n fa llin g e d g e , s to p o n r is in g e d g e
T im e r C o u n te r C o u n tin g E n a b le
1 : e n a b le
0 : d is a b le
N o t im p le m e n te d , r e a d a s " 0 "
O p e r a tin g M o d e S e le c t
T 2 M 1 T 2 M 0
0 0 n o m o d e a v a ila b le
0 1 n o m o d e a v a ila b le
1 0 tim e r m o d e
1 1 n o m o d e a v a ila b le
high byte register must first be executed to latch the con- determined by bits PSC0~PSC2 of the TMR1C~
tents of the low byte buffer into its associated low byte TMR2C register. The timer-on bit, TON must be set high
register. After this has been done, the low byte register to enable the timer to run. Each time an internal clock
can be read in the normal way. Note that reading the low high to low transition occurs, the timer increments by
byte timer register will only result in reading the previ- one. When the timer is full and overflows, the timer will
ously latched contents of the low byte buffer and not the
www.datasheet4u.com be reset to the value already loaded into the preload reg-
actual contents of the low byte timer register. ister and continue counting. If the timer interrupt is en-
abled, an interrupt signal will also be generated. The
Timer Control Registers - TMR0C, TMR1C, TMR2C timer interrupt can be disabled by ensuring that the
The Timer/Event Counters0/1 enable them to operate in ET0I~ET2I bit in the INTC and INTCH registers is
three different modes. the options of which are deter- cleared to zero. It should be noted that a timer overflow
mined by the contents of their respective control regis- is one of the wake-up sources.
ter. There are four timer control registers, known as
Configuring the Event Counter Mode
TMR0C, TMR1C and TMR2C. It is the timer control reg-
ister together with its corresponding timer registers that In this mode, two number of externally changing logic
control the full operation of the Timer/Event Counters. events, occurring on external pin PA6/TMR0 or
Before the timers can be used, it is essential that the ap- PA7/TMR1, can be recorded by the internal timer. For
propriate timer control register is fully programmed with the timer to operate in the event counting mode, bits
the right data to ensure its correct operation, a process TM1 and TM0 of the TMR0C or TMR1C registers must
that is normally carried out during program initialization. be set to 0 and 1 respectively. The timer-on bit, TON
To choose which of the three modes the timer is to oper- must be set high to enable the timer to count. With TE
ate in, either in the timer mode, the event counting mode low, the counter will increment each time the PA6/TMR0
or the pulse width measurement mode, bits 7 and 6 of or PA7/TMR1 pin receives a low to high transition. If the
the Timer Control Register, which are known as the bit TE bit is high, the counter will increment each time
pair T0M1/T0M0, T1M1/T1M0 respectively, depending PA6/TMR0 or PA7/TMR1 pin receives a high to low tran-
upon which timer is used, must be set to the required sition. As in the case of the other two modes, when the
logic levels. The timer-on bit, which is bit 4 of the Timer counter is full and overflows, the timer will be reset to the
Control Register and known as T0ON, T1ON or T2ON, value already loaded into the preload register and con-
depending upon which timer is used, provides the basic tinue counting. If the timer interrupt is enabled, an inter-
on/off control of the respective timer. Setting the bit high rupt signal will also be generated.
allows the counter to run, clearing the bit stops the coun- The timer interrupt can be disabled by ensuring that the
ter. If the timer is in the event count or pulse width mea- ETI bit in the INTC and INTCH registers is cleared to
surement mode, the active transition edge level type is zero. To ensure that the external pin PA6/TMR0 or
selected by the logic level of bit 3 of the Timer Control PA7/TMR1 is configured to operate as an event counter
Register which is known as T0E, T1E or T2E, depend- input pin, two things have to happen. The first is to en-
ing upon which timer is used. sure that the TM0 and TM1 bits place the timer/event
counter in the event counting mode, the second is to en-
Configuring the Timer Mode
sure that the share pin MR0 or TMR1 are selected by
In this mode, the timer can be utilized to measure fixed option. It should be noted that a timer overflow is one of
time intervals, providing an internal interrupt signal each the wake-up sources. Also in the Event Counting mode,
time the counter overflows. To operate in this mode, bits the Timer/Event Counter will continue to record exter-
TM1 and TM0 of the TMR0C~TMR2C register must be nally changing logic events on the timer input pin, even if
set to 1 and 0 respectively. In this mode, the internal the microcontroller is in the Power Down Mode. As a re-
clock is used as the timer clock. The input clock fre- sult when the timer overflows it will generate a wake-up
quency of 16 bit timer to the timer is fOSC/8 and RC12K, and if the interrupts are enabled also generate a timer
selected by TMR0C.5. The input clock frequency of 8 bit interrupt signal.
timer to the timer is Fosc divided by the value pro-
grammed into the timer prescaler, the value of which is
P r e s c a le r O u tp u t
In c re m e n t
T im e r C o n tr o lle r T im e r + 1 T im e r + 2 T im e r + N T im e r + N + 1
E x te r n a l T im e r
P in In p u t
T 0 E o r T 1 E = 1
In c re m e n t
T im e r + 1 T im e r + 2 T im e r + 3
T im e r C o u n te r
E x te r n a l T im e r
P in In p u t
T O N
( w ith T E = 0 )
P r e s c a le r O u tp u t
In c re m e n t
T im e r + 1 + 2 + 3 + 4
T im e r C o u n te r
P r e s c a le r O u tp u t is s a m p le d a t e v e r y fa llin g e d g e o f fO S C /8 o r R C 1 2 K .
small differences in measured values requiring pro- register. Note that setting the timer enable bit high to
grammers to take this into account during programming. turn the timer on, should only be executed after the timer
The same applies if the timer is configured to be in the mode bits have been properly setup. Setting the timer
event counting mode, which again is an external event enable bit high together with a mode bit modification,
and not synchronized with the internal system or timer may lead to improper timer operation if executed as a
clock. When the Timer/Event Counter is read, or if data
www.datasheet4u.com single timer control register byte write instruction. When
is written to the preload register, the clock is inhibited to the Timer/Event counter overflows, its corresponding in-
avoid errors, however as this may result in a counting er- terrupt request flag in the interrupt control register will be
ror, this should be taken into account by the program- set. If the timer interrupt is enabled this will in turn gener-
mer. Care must be taken to ensure that the timers are ate an interrupt signal. However irrespective of whether
properly initialized before using them for the first time. the interrupts are enabled or not, a Timer/Event counter
The associated timer enable bits in the interrupt control overflow will also generate a wake-up signal if the de-
register must be properly set otherwise the internal in- vice is in a Power-down condition. This situation may
terrupt associated with the timer will remain inactive. occur if the Timer/Event Counter is in the Event
The edge select, timer mode and clock source control Counting Mode and if the external signal continues to
bits in timer control register must also be correctly set to change state. In such a case, the
ensure the timer is properly configured for the required
Timer/Event Counter will continue to count these exter-
application. It is also important to ensure that an initial
nal events and if an overflow occurs the device will be
value is first loaded into the timer registers before the
woken up from its Power-down condition. To prevent
timer is switched on; this is because after power-on the
such a wake-up from occurring, the timer interrupt re-
initial values of the timer registers are unknown. After
quest flag should first be set high before issuing the
the timer has been initialized the timer can be turned on
HALT instruction to enter the Power Down Mode.
and off by controlling the enable bit in the timer control
tmr1int:
; Timer/Event Counter 1 main program placed here
:
reti
tmr2int:
; Timer Counter 2 main program placed here
:
reti
:
begin:
; setup interrupt register
mov a, 0bh ; enable master interrupt, timer0 and timer1 interrupt
mov intc,a
Interrupts
Interrupts are an important part of any microcontroller Interrupt Operation
system. When an external event or an internal function Timer/Event 0/1/2 Counter overflow, ERCOCI interrupt,
such as a Timer/Event Counter 0/1/2 or ERCOCI re- ADPCM empty request or the external interrupt line be-
quire or an ADPCM empty requires microcontroller at- ing pulled low will all generate an interrupt request by
tention, their corresponding interrupt will enforce a setting their corresponding request flag, if their appropri-
temporary suspension of the main program allowing the ate interrupt enable bit is set. When this happens, the
microcontroller to direct attention to their respective Program Counter, which stores the address of the next
needs. Each device in this series contains a single ex- instruction to be executed, will be transferred onto the
ternal interrupt and two internal interrupts functions. The stack. The Program Counter will then be loaded with a
external interrupt is controlled by the action of the exter- new address which will be the value of the correspond-
nal INT pin, while the internal interrupts are controlled by ing interrupt vector. The microcontroller will then fetch its
the Timer/Event 0/1Counter overflow or ERCOCI re- next instruction from this interrupt vector. The instruction
quire or the ADPCM empty interrupt. at this vector will usually be a JMP statement which will
jump to another section of program which is known as
Interrupt Register
the interrupt service routine. Here is located the code to
Overall interrupt control, which means interrupt enabling control the appropriate interrupt. The interrupt service
and request flag setting, is controlled by INTC and routine must be terminated with a RETI statement,
INTCH registers, which are located in Data Memory. By which retrieves the original Program Counter address
controlling the appropriate enable bits in this register from the stack and allows the microcontroller to continue
each individual interrupt can be enabled or disabled. with normal execution at the point where the interrupt
Also when an interrupt occurs, the corresponding re- occurred.
quest flag will be set by the microcontroller. The global
enable flag if cleared to zero will disable all interrupts.
Once an interrupt subroutine is serviced, all the other in- Interrupt Source Priority Vector
terrupts will be blocked, as the EMI bit will be cleared au-
Reset 1 00H
tomatically.
External Interrupt 2 04H
This will prevent any further interrupt nesting from oc-
curring. However, if other interrupt requests occur dur- Timer/Event Counter 0 Overflow 3 08H
www.datasheet4u.com
ing this interval, although the interrupt will not be Timer/Event Counter 1 Overflow 4 0CH
immediately serviced, the request flag will still be re-
corded. If an interrupt requires immediate servicing Timer Counter 2 overflow 5 10H
while the program is already in another interrupt service ERCOCI Interrupt 6 14H
routine, the EMI bit should be set after entering the rou-
ADPCM Empty Interrupt 7 18H
tine, to allow interrupt nesting. If the stack is full, the in-
terrupt request will not be acknowledged, even if the
related interrupt is enabled, until the Stack Pointer is External Interrupt
decremented. If immediate service is desired, the stack For an external interrupt to occur, the global interrupt en-
must be prevented from becoming full. able bit, EMI, and external interrupt enable bit, EEI,
must first be set. An actual external interrupt will take
Interrupt Priority place when the external interrupt request flag, EIF, is
Interrupts, occurring in the interval between the rising set, a situation that will occur when a high to low transi-
edges of two consecutive T2 pulses, will be serviced on tion appears on the INT line. The external interrupt pin is
the latter of the two T2 pulses, if the corresponding inter- pin-shared with the I/O pin PA5 and can only be config-
rupts are enabled. In case of simultaneous requests, the ured as an external interrupt pin if the corresponding ex-
following table shows the priority that is applied. These ternal interrupt enable bit in the INTC register has been
can be masked by resetting the EMI bit. In cases where set. The pin must also be selected as by setting the cor-
both external and internal interrupts are enabled and responding PAC.5 bit in the port control register. When
where an external and internal interrupt occurs simulta- the interrupt is enabled, the stack is not full and a high to
neously, the external interrupt will always have priority low transition appears on the external interrupt pin, a
and will therefore be serviced first. Suitable masking of subroutine call to the external interrupt vector at location
the individual interrupts using the INTC register can pre- 04H, will take place. When the interrupt is serviced, the
vent simultaneous occurrences. external interrupt request flag, EIF, will be automatically
reset and the EMI bit will be automatically cleared to dis-
able other interrupts.
b 7 b 0
T 1 F T 0 F E IF E T 1 I E T 0 I E E I E M I IN T C R e g is te r
M a s te r In te r r u p t G lo b a l E n a b le
1 : g lo b a l e n a b le
0 : g lo b a l d is a b le
E x te r n a l In te r r u p t E n a b le
1 : e n a b le
0 : d is a b le
T im e r /E v e n t C o u n te r 0 In te r r u p t E n a b le
1 : e n a b le
0 : d is a b le
T im e r /E v e n t C o u n te r 1 In te r r u p t E n a b le
1 : e n a b le
0 : d is a b le
E x te r n a l In te r r u p t R e q u e s t F la g
1 : a c tiv e
0 : in a c tiv e
T im e r /E v e n t C o u n te r 0 In te r r u p t R e q u e s t F la g
1 : a c tiv e
0 : in a c tiv e
T im e r /E v e n t C o u n te r 1 In te r r u p t R e q u e s t F la g
1 : a c tiv e
0 : in a c tiv e
N o im p le m e n te d , r e a d a s " 0 "
b 7 b 0
C H 1 F A D P C M F R C O C F T 2 F C H 0 F E A D P C M E R C O C I E T 2 I IN T C H R e g is te r
T im e r C o u n te r 2 In te r r u p t E n a b le
1 : e n a b le d
0 : d is a b le d
C /R to F In te r r u p t E n a b le
www.datasheet4u.com 1 : e n a b le d
0 : d is a b le d
A D P C M E m p ty In te r r u p t E n a b le
1 : e n a b le d
0 : d is a b le d
A D P C M C h a n n e l 0 E m p ty In te r r u p t R e q u e s t F la g
1 : e n a b le d
0 : d is a b le d
T im e r C o u n te r 2 In te r r u p t R e q u e s t F la g
1 : a c tiv e
0 : in a c tiv e
C /R to F In te r r u p t R e q u e s t F la g
1 : a c tiv e
0 : in a c tiv e
A D P C M E m p ty In te r r u p t R e q u e s t F la g
1 : a c tiv e
0 : in a c tiv e
A D P C M C h a n n e l 1 E m p ty In te r r u p t R e q u e s t F la g
1 : a c tiv e
0 : in a c tiv e
T im e r /E v e n t C o u n te r 0 E T 0 I
In te r r u p t R e q u e s t F la g T 0 F
T im e r /E v e n t C o u n te r 1 E T 1 I
In te r r u p t R e q u e s t F la g T 1 F
In te rru p t
P o llin g
T im e r C o u n te r 2 E T 2 I
In te r r u p t R e q u e s t F la g T 2 F
C /R to F (E R C O C I)
In te r r u p t R e q u e s t F la g R C O C F R C O C F
A D P C M E m p ty In te rru p t
R e q u e s t F la g A D P C M F L o w
E A D P C M
Interrupt Structure
In te rn a l R e s e t
Timer/Event
Timer Counter will be turned off
Counter
Low Voltage Reset Timing Chart
The Timer Counter Prescaler will
Prescaler
be cleared
· Watchdog Time-out Reset during Normal Operation
Input/Output Ports I/O ports will be setup as inputs
The Watchdog time-out Reset during normal opera-
tion is the same as a hardware RES pin reset except Stack Pointer will point to the top
Stack Pointer
that the Watchdog time-out flag TO will be set to ²1². of the stack
S S T T im e - o u t
HT37A70/60
Reset RES or LVR WDT Time-out WDT Time-out
Register
(Power-on) Reset (Normal Operation) (HALT)
TMR0H xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR0L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
www.datasheet4u.com
TMR0C 0000 1--- 0000 1--- 0000 1--- uuuu u---
TMR1L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR1C 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu
TMR2L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR2C 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu
PCL 0000 0000 0000 0000 0000 0000 0000 0000
MP0 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
MP1 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
MP2 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
RBP1 ---- ---0 ---- ---0 ---- ---0 ---- ---u
HT37A50/40
Reset RES or LVR WDT Time-out WDT Time-out
Register
(Power-on) Reset (Normal Operation) (HALT)
TMR0H xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR0L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
www.datasheet4u.com
TMR0C 0000 1--- 0000 1--- 0000 1--- uuuu u---
TMR1L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR1C 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu
TMR2L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR2C 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu
PCL 0000 0000 0000 0000 0000 0000 0000 0000
MP0 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
MP1 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
MP2 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
RBP1 ---- ---0 ---- ---0 ---- ---0 ---- ---u
HT37A30
Reset RES or LVR WDT Time-out WDT Time-out
Register
(Power-on) Reset (Normal Operation) (HALT)
TMR0H xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR0L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
www.datasheet4u.com
TMR0C 0000 1--- 0000 1--- 0000 1--- uuuu u---
TMR1L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR1C 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu
TMR2L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR2C 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu
PCL 0000 0000 0000 0000 0000 0000 0000 0000
MP0 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
MP1 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
MP2 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
RBP1 ---- ---0 ---- ---0 ---- ---0 ---- ---u
HT37A20
Reset RES or LVR WDT Time-out WDT Time-out
Register
(Power-on) Reset (Normal Operation) (HALT)
TMR0H xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR0L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
www.datasheet4u.com
TMR0C 0000 1--- 0000 1--- 0000 1--- uuuu u---
TMR1L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR1C 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu
TMR2L xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu
TMR2C 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu
PCL 0000 0000 0000 0000 0000 0000 0000 0000
MP0 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
MP1 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
MP2 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu
RBP1 ---- ---0 ---- ---0 ---- ---0 ---- ---u
Oscillator
Various oscillator options offer the user a wide range of with the crystal or resonator manufacturer¢s specifica-
functions according to their various application require- tion. The external parallel feedback resistor, Rp, is nor-
ments. Two types of system clocks can be selected mally not required but in some cases may be needed to
while various clock source options for the Watchdog assist with oscillation start up.
www.datasheet4u.com
Timer are provided for maximum flexibility. All oscillator
options are selected through the configuration options. Internal Ca, Cb, Rf Typical Values @ 5V, 25°C
More information regarding the oscillator is located in Using the external system RC oscillator requires that a
Application Note HA0075E on the Holtek website. resistor, with a value between 82kW and 180kW, is con-
nected between OSC1 and VSS. The generated system
External Crystal/Resonator Oscillator clock divided by 8 will be provided on OSC2 as an output
The simple connection of a crystal across OSC1 and which can be used for external synchronization pur-
OSC2 will create the necessary phase shift and feed- poses. Note that as the OSC2 output is an NMOS
back for oscillation, and will normally not require exter- open-drain type, a pull high resistor should be connected
nal capacitors. However, for some crystals and most if it to be used to monitor the internal frequency. Although
resonator types, to ensure oscillation and accurate fre- this is a cost effective oscillator configuration, the oscilla-
quency generation, it may be necessary to add two tion frequency can vary with VDD, temperature and pro-
small value external capacitors, C1 and C2. The exact cess variations and is therefore not suitable for
values of C1 and C2 should be selected in consultation applications where timing is critical or where accurate os-
cillator frequencies are required. For the value of the ex-
ternal resistor. Note that it is the only microcontroller
C 1 In te r n a l
O S C 1 internal circuitry together with the external resistor, that
O s c illa to r
C a C ir c u it determine the frequency of the oscillator. The external
R p R f capacitor shown on the diagram does not influence the
frequency of oscillation.
C b
T o in te r n a l
O S C 2 c ir c u its
C 2 O S C 1
R O S C
N o te : 1 . R p is n o r m a lly n o t r e q u ir e d .
2 . A lth o u g h n o t s h o w n O S C 1 /O S C 2 p in s h a v e a p a r a s itic
c a p a c ita n c e o f a r o u n d 7 p F .
fO S C /8 N M O S O p e n D r a in O S C 2
Crystal/Resonator Oscillator
External RC Oscillator
Watchdog Timer Oscillator a fixed high or low level as any floating input pins could
create internal oscillations and result in increased cur-
The WDT oscillator is a fully self-contained free running
rent consumption. This also applies to devices which
on-chip RC oscillator with a typical period of 65ms at 5V
have different package types, as there may be
requiring no external components. When the device en-
undonbed pins, which must either be setup as outputs
ters the Power Down Mode, the system clock will stop
www.datasheet4u.com or if setup as inputs must have pull-high resistors con-
running but the WDT oscillator continues to free-run and
nected. Care must also be taken with the loads, which
to keep the watchdog active. However, to preserve
are connected to I/O pins, which are setup as outputs.
power in certain applications the WDT oscillator can be
These should be placed in a condition in which minimum
disabled via a configuration option.
current is drawn or connected only to external circuits
that do not draw current, such as other CMOS inputs.
Power Down Mode and Wake-up Also note that additional standby current will also be re-
Power Down Mode quired if the configuration options have enabled the
Watchdog Timer internal oscillator.
All of the Holtek microcontrollers have the ability to enter
a Power Down Mode, also known as the HALT Mode or
Wake-up
Sleep Mode. When the device enters this mode, the nor-
mal operating current, will be reduced to an extremely After the system enters the Power Down Mode, it can be
low standby current level. This occurs because when woken up from one of various sources listed as follows:
the device enters the Power Down Mode, the system · An external reset
oscillator is stopped which reduces the power consump- · An external falling edge on Port A
tion to extremely low levels, however, as the device · A system interrupt
maintains its present internal condition, it can be woken
· A WDT overflow
up at a later stage and continue running, without requir-
ing a full reset. This feature is extremely important in ap- If the system is woken up by an external reset, the de-
plication areas where the MCU must have its power vice will experience a full system reset, however, if the
supply constantly maintained to keep the device in a device is woken up by a WDT overflow, a Watchdog
known condition but where the power supply capacity is Timer reset will be initiated. Although both of these
limited such as in battery applications. wake-up methods will initiate a reset operation, the ac-
tual source of the wake-up can be determined by exam-
Entering the Power Down Mode ining the TO and PDF flags. The PDF flag is cleared by a
There is only one way for the device to enter the Power system power-up or executing the clear Watchdog
Down Mode and that is to execute the ²HALT² instruc- Timer instructions and is set when executing the ²HALT²
tion in the application program. When this instruction is instruction. The TO flag is set if a WDT time-out occurs,
executed, the following will occur: and causes a wake-up that only resets the Program
Counter and Stack Pointer, the other flags remain in
· The system oscillator will stop running and the appli-
their original status.
cation program will stop at the ²HALT² instruction.
· The Data Memory contents and registers will maintain Each pin on Port A can be setup via an individual config-
their present condition. uration option to permit a negative transition on the pin
· The WDT will be cleared and resume counting if the to wake-up the system. When a Port A pin wake-up oc-
WDT clock source is selected to come from the WDT curs, the program will resume execution at the instruc-
oscillator. The WDT will stop if its clock source origi- tion following the ²HALT² instruction.
nates from the system clock.
If the system is woken up by an interrupt, then two possi-
· The I/O ports will maintain their present condition.
ble situations may occur. The first is where the related
· In the status register, the Power Down flag, PDF, will interrupt is disabled or the interrupt is enabled but the
be set and the Watchdog time-out flag, TO, will be stack is full, in which case the program will resume exe-
cleared. cution at the instruction following the ²HALT² instruction.
In this situation, the interrupt which woke-up the device
Standby Current Considerations
will not be immediately serviced, but will rather be ser-
As the main reason for entering the Power Down Mode viced later when the related interrupt is finally enabled or
is to keep the current consumption of the MCU to as low when a stack level becomes free. The other situation is
a value as possible, perhaps only in the order of several where the related interrupt is enabled and the stack is
micro-amps, there are other considerations which must not full, in which case the regular interrupt response
also be taken into account by the circuit designer if the takes place. If an interrupt request flag is set to ²1² be-
power consumption is to be minimized. Special atten- fore entering the Power Down Mode, the wake-up func-
tion must be made to the I/O pins on the device. All tion of the related interrupt will be disabled.
high-impedance input pins must be connected to either
No matter what the source of the wake-up event is, once source instead of the internal WDT oscillator. If the in-
a wake-up situation occurs, a time period equal to 1024 struction clock is used as the clock source, it must be
system clock periods will be required before normal sys- noted that when the system enters the Power Down
tem operation resumes. However, if the wake-up has Mode, as the system clock is stopped, then the WDT
originated due to an interrupt, the actual interrupt sub- clock source will also be stopped. Therefore the WDT
routine execution will be delayed by an additional one or
www.datasheet4u.com will lose its protecting purposes. In such cases the sys-
more cycles. If the wake-up results in the execution of tem cannot be restarted by the WDT and can only be re-
the next instruction following the ²HALT² instruction, this started using external signals. For systems that operate
will be executed immediately after the 1024 system in noisy environments, using the internal WDT oscillator
clock period delay has ended. is therefore the recommended choice.
Under normal program operation, a WDT time-out will
Watchdog Timer initialise a device reset and set the status bit TO. How-
ever, if the system is in the Power Down Mode, when a
The Watchdog Timer is provided to prevent program
WDT time-out occurs, only the Program Counter and
malfunctions or sequences from jumping to unknown lo-
Stack Pointer will be reset. Three methods can be
cations, due to certain uncontrollable external events
adopted to clear the contents of the WDT and the WDT
such as electrical noise. It operates by providing a de-
prescaler. The first is an external hardware reset, which
vice reset when the WDT counter overflows. The WDT
means a low level on the RES pin, the second is using
clock is supplied by one of two sources selected by con-
the watchdog software instructions and the third is via a
figuration option: its own self contained dedicated inter-
²HALT² instruction.
nal WDT oscillator or fOSC/8. Note that if the WDT
configuration option has been disabled, then any in- There are two methods of using software instructions to
struction relating to its operation will result in no opera- clear the Watchdog Timer, one of which must be chosen
tion. by configuration option. The first option is to use the sin-
The internal WDT oscillator has an approximate period gle ²CLR WDT² instruction while the second is to use
of 65ms at a supply voltage of 5V. If selected, it is first di- the two commands ²CLR WDT1² and ²CLR WDT2². For
vided by 256 via an 8-stage counter to give a nominal the first option, a simple execution of ²CLR WDT² will
period of 17ms. Note that this period can vary with VDD, clear the WDT while for the second option, both ²CLR
temperature and process variations. For longer WDT WDT1² and ²CLR WDT2² must both be executed to
time-out periods the WDT prescaler can be utilized. By successfully clear the WDT. Note that for this second
writing the required value to bits 0, 1 and 2 of the WDTS option, if ²CLR WDT1² is used to clear the WDT, succes-
register, known as WS0, WS1 and WS2, longer time-out sive executions of this instruction will have no effect,
periods can be achieved. With WS0, WS1 and WS2 all only the execution of a ²CLR WDT2² instruction will
equal to 1, the division ratio is 1:128 which gives a maxi- clear the WDT. Similarly, after the ²CLR WDT2² instruc-
mum time-out period of about 2.1s. tion has been executed, only a successive ²CLR WDT1²
A configuration option can select the instruction clock, instruction can clear the Watchdog Timer.
which is the system clock divided by 8, as the WDTclock
b 7 b 0
W S 2 W S 1 W S 0 W D T S R e g is te r
W D T p r e s c a le r r a te s e le c t
W S 2 W S 1 W S 0 W D T R a te
0 0 0 1 :1
0 0 1 1 :2
0 1 0 1 :4
0 1 1 1 :8
1 0 0 1 :1 6
1 0 1 1 :3 2
1 1 0 1 :6 4
1 1 1 1 :1 2 8
N o t u s e d
C L R W D T 1 F la g C le a r W D T T y p e
C L R W D T 2 F la g C o n fig u r a tio n O p tio n
1 o r 2 In s tr u c tio n s
C L R
C L R
fO S C /8 W D T C lo c k S o u r c e 8 - b it C o u n te r
7 - b it P r e s c a le r
www.datasheet4u.com W D T O s c illa to r C o n fig u r a tio n O p tio n (¸ 2 5 6 )
W D T C lo c k S o u r c e
8 -to -1 M U X W S 0 ~ W S 2
W D T T im e - o u t
Watchdog Timer
b 7 b 0
B P _ R S E L A C H 1 S E L A C H 0 A M P _ M A M P _ E N S E L W L D A C S E L W R D A C C R e g is te r
T o s e le c t D A R d a ta fr o m m C o r w a v e ta b le
0 : fr o m m C ( d e fa u lt)
1 : fr o m w a v e ta b le
E n a b le /d is a b le D A C fu n c tio n
0 : d is a b le
1 : e n a b le
T o s e le c t D A L d a ta fr o m m C o r w a v e ta b le
0 : fr o m m C ( d e fa u lt)
1 : fr o m w a v e ta b le
E n a b le /d is a b le b u ild - in p o w e r A m p . fu n c tio n
0 : d is a b le
1 : e n a b le
M u te fu n c tio n in th e b u ild - in p o w e r A m p .
0 : n o n -m u te
1 : m u te
S e le c t c h 0 s o u r c e fr o m w a v e ta b le /A D P C M d e c o d e r
0 : fr o m w a v e ta b le
1 : fro m A D P C M d e c o d e r
S e le c t c h 0 1 s o u r c e fr o m w a v e ta b le /A D P C M d e c o d e r
0 : fr o m w a v e ta b le
1 : fro m a d p c m d e c o d e r
* In d ir e c t m e m o r y a c c e s s s fr o m M P 1 /M P 2
0 : M P 1
1 : M P 2
A u d In A M P 1 A M P 2
C 1 O U T P
V B IA S
R
B IA S
A M P _ E N
Capacitor
tR 0.1mF 1mF 4.7mF 10mF
Voltage
2.2V 15ms 30ms 90ms 185ms
3V 15ms 30ms 90ms 185ms
4 15ms 30ms 90ms 185ms
For battery based applications, power consumption is a key issue, therefore the amplifier should be turned off when in
the standby state. In order to eliminate any speaker sound bursts while turning the amplifier on, the application circuit,
which will incorporate a capacitance value of C1, should be adjusted in accordance with the speaker s audio frequency
response. A greater value of C1 will improve the noise burst while turning on the amplifier. The recommended operation
sequence is:
Turn On: audio signal standby (1/2VDD) ® enable amplifier ® wait tR for amplifier ready ® audio output
Turn Off: audio signal finished ® disable amplifier ® wait tR for amplifier off ® audio signal off
L C H /R C H
tR tR
A M P _ E N
If the application is not powered by batteries and there is no problem with amplifier On/Off issue, a capacitor value of
0.1mF for C1 is recommended.
How to use integrated power Amp?
· Connect the ²Internal Power Amp Circuit², please refer to Application Circuits.
· Set DACC.3 to enable integrated power amp. Clear DACC.3 to disable integrated power amp.
· User can control it at ²PowerAmpDisable² and ²PowerAmpEnable² of HT-MDS.
These two bits, VM and FR, are used to define which · PCM code has to be located at a multiple of 32 (byte)
register will be updated on this selected channel. There · ST13~ST0= WA18~WA0/32
are two modes that can be selected to reduce the pro-
cess of setting the register. Please refer to the state- HT37A50/40 contains ST12~ST0 is used to define the
ments of the following table: start address of each PCM code and reads the wave-
form data from this location.
VM FR Function
· HT37A50/40 provides PCM 12/8 bit source
0 0 Update all the parameter
· PCM 12 Start address definition
0 1 Only change the frequency parameter
· PCM code has to be located at a multiple of 48 (byte)
1 0 Only change the volume parameter
1 1 Unused · ST11~ST0= WA17~WA0/48
to generate the tone scale. When the FR11~FR0 is HT37A30 contains ST11~ST0 is used to define the start
800H and BL3~BL0 is 6H, each sample data of the PCM address of each PCM code and reads the waveform
code will be sent out sequentially. data from this location.
When the fOSC is 11.059MHz, the formula of a tone fre- · HT37A30 provides PCM 12/8 bit source
quency is: · PCM 12 Start address definition
f / (16x8) FR11 ~ FR0
fOUT= fRECORD x osc x (17 - BL3~BL0)
SR 2 · PCM code has to be located at a multiple of 48 (byte)
where fOUT is the output signal frequency, fRECORD and SR · ST10~ST0= WA16~WA0/48
is the frequency and sampling rate on the sample code,
· PCM 8 Start address definition
respectively.
· PCM code has to be located at a multiple of 32 (byte)
So if a voice code of C3 has been recorded which has
the fRECORD of 261Hz and the SR of 11025Hz, the tone · ST11~ST0= WA16~WA0/32
frequency (fOUT) of G3: fOUT=98Hz. Can be obtained by
HT37A20 contains ST10~ST0 is used to define the start
using the formula: If FR=031h and BL=7, could get
address of each PCM code and reads the waveform
98Hz.
data from this location.
86.4kHz FR11 ~ FR0 · HT37A20 provides PCM 12/8 bit source
98Hz= 261Hz x x
11.025kHz 2 (17 - BL3~BL0)
· PCM 12 Start address definition
BL3~BL0: range from 00h~0Bh
FR11~FR0: range from 000h~3FFh · PCM code has to be located at a multiple of 48 (byte)
· ST9~ST0= WA15~WA0/48
Start Address Definition
· PCM 8 Start address definition
Each device provides two address types for extended
use, one is the program ROM address which is program · PCM code has to be located at a multiple of 32 (byte)
counter corresponding with BP1 value, the other is the · ST10~ST0= WA15~WA0/32
start address of the PCM code.
Name Function D7 D6 D5 D4 D3 D2 D1 D0
20H Channel number selection (CHAN) VM FR ¾ ¾ ¾ CH2 CH1 CH0
21H Frequency number high byte (FreqNH) BL3 BL2 BL1 BL0 FR11 FR10 FR9 FR8
22H Frequency number low byte (FreqNL) FR7 FR6 FR5 FR4 FR3 FR2 FR1 FR0
23H Start address high byte (AddrH) ¾ ¾ ST13 ST12 ST11 ST10 ST9 ST8
24H Start address low byte (AddrL) ST7 ST6 ST5 ST4 ST3 ST2 ST1 ST0
25H Repeat number high byte (RepH) WBS RE14 RE13 RE12 RE11 RE10 RE9 RE8
26H Repeat number low byte (RepL) RE7 RE6 RE5 RE4 RE3 RE2 RE1 RE0
27H Control register (ENV) A_R ¾ VL9 VL8 ENV1 ENV0 VR9 VR8
28H ¾
29H Left volume control (LVC) VL7 VL6 VL5 VL4 VL3 VL2 VL1 VL0
2AH Right volume control (RVC) VR7 VR6 VR5 VR4 VR3 VR2 VR1 VR0
Wavetable Register Memory Map (20h~2Ah)
ADPCM
Address Offset Register Name R/W Default Value Description
30H ADR W xxxx xxxx ADPCM Data Register
31H XSPL W 0000 0000 Xn + SP Initial Register Low Byte
32H XSPH W 0000 0000 Xn + SP Initial Register High Byte
33H ADPC R/W 00x0 xx00 ADPCM Decoder control register
34H ADPS R 0000 1111 ADPCM Decoder Status Register
HT-ADPCM Decoder Registers
b 7 b 0
W B R 1 _ E m p ty W B R 0 _ E m p ty A D R 1 _ E m p ty A D R 0 _ E m p ty A D P S R e g is te r
V o ic e c h a n n e l 0 , A D P C M D a ta E m p ty F la g
0 : n o n e m p ty
1 : e m p ty
V o ic e c h a n n e l 1 , A D P C M D a ta E m p ty F la g
www.datasheet4u.com 0 : n o n e m p ty
1 : e m p ty
V o ic e c h a n n e l 0 , W B R D a ta E m p ty F la g
0 : n o n e m p ty
1 : e m p ty
V o ic e c h a n n e l 1 , W B R D a ta E m p ty F la g
0 : n o n e m p ty
1 : e m p ty
N o t im p le m e n te d , r e a d a s " 0 "
b 7 b 0
R C O M 2 R C O M 1 R C O M 0 R C O C O N R C O C C R R e g is te r
U n d e fin e d , r e a d a s z e r o
R C O s c illa to r C o n v e r te r E n a b le
1 : E n a b le
0 : D is a b le
T im e r A C lo c k S o u r c e S e le c t
R C O M 2 R C O M 1 R C O M 0
0 0 0 fS Y S (fO S C /2 )
0 0 1 fS Y S /4 (fO S C /8 )
0 1 0 U n d e fin e d
: : : :
1 1 1 U n d e fin e d
RCOCCR Register
b 7 b 0
A S O N 1 A S O N 0 R C O C R R e g is te r
In te r r u p t S o u r c e S e le c t
1 : T im e r B o v e r flo w
0 : T im e r A o v e r flo w
www.datasheet4u.com R C C o n v e rte r M o d e
1 : E n a b le
0 : D is a b le
U n d e fin e d , r e a d a s z e r o
RCOCR Register
S 1
S y s te m C lo c k O V B = 0
S 2
S y s te m C lo c k /4 T im e r A E x te r n a l R C O s c illa tio n C o n v e r te r In te r r u p t
T O N
O V B = 1
T im e r B R e s e t R C O C O N
R C O S C O u tp u t
Programming Considerations directly written to the high byte register. At the same
time the data in the low byte buffer will be transferred
As the 16-bit Timers have both low byte and high byte
into its associated low byte register. For this reason,
timer registers, accessing these registers is carried out
when preloading data into the 16-bit timer registers, the
in a specific way. It must be noted that when using in-
low byte should be written first. It must also be noted that
structions to preload data into the low byte registers,
to read the contents of the low byte register, a read to
namely TMRAL or TMRAL, the data will only be placed
the high byte register must first be executed to latch the
into a low byte buffer and not directly into the low byte
contents of the low byte buffer into its associated low
register. The actual transfer of the data into the low byte
byte register. After this has been done, the low byte reg-
register is only carried out when a write to its associated
ister can be read in the normal way. Note that reading
high byte register, namely TMRAH or TMRBH, is exe-
the low byte timer register will only result in reading the
cuted. However, using instructions to preload data into
previously latched contents of the low byte buffer and
the high byte timer register will result in the data being
not the actual contents of the low byte timer register.
Program Example
External RC oscillation converter mode example program - Timer A overflow:
clr RCOCCR
mov a, 00000010b ; Enable External RC oscillation mode and set Timer A overflow
mov RCOCR,a
clr intch.5 ; Clear External RC Oscillation Converter interrupt request flag
mov a, low (65536-1000) ; Give timer A initial value
mov tmral, a ; Timer A count 1000 time and then overflow
mov a, high (65536-1000)
mov tmrah, a
mov a, 00h ; Give timer B initial value
mov tmrbl, a
mov a, 00h
mov tmrbh, a
mov a, 00110000b ; Timer A clock source=fSYS/4 and timer on
mov RCOCCR, a
p10:
clr wdt
Snz intch.5 ; Polling External RC Oscillation Converter interrupt request flag
jmp p10
clr intch.5 ; Clear External RC Oscillation Converter interrupt request flag
; Program continue
Analog Switch
There are 8 analog switch lines in the microcontroller for K0~K7 for HT37A70/60/50/40/30, except HT37A20 which
only have 4 analog switch lines for K0~K3 and the Analog Switch control register, which is mapped to the data memory.
All of these Analog Switch lines can be used for touch key input keys.
www.datasheet4u.com b 7 b 0
A S O N 3 A S O N 2 A S O N 1 A S O N 0 A S C R R e g is te r
A n a lo g S w itc h S e le c t
A S O N 3 A S O N 2 A S O N 1 A S O N 0
0 0 0 0 K 0 o n , o th e rs o ff
0 0 0 1 K 1 o n , o th e rs o ff
0 0 1 0 K 2 o n , o th e rs o ff
0 0 1 1 K 3 o n , o th e rs o ff
0 1 0 0 K 4 o n , o th e rs o ff
0 1 0 1 K 5 o n , o th e rs o ff
0 1 1 0 K 6 o n , o th e rs o ff
0 1 1 1 K 7 o n , o th e rs o ff
1 X X X A ll o ff, O S C o ff
U n d e fin e d , r e a d a s z e r o
A S O N
K 0 T .G .1
K 1 T .G .2
K 2 T .G .3
K 3 T .G .4
K 4 T .G .5
K 5 T .G .6
K 6 T .G .7
K 7 T .G .8
R C O U T
R R
R C
C C T im e r B
Analog Switch
C lo c k D iv id e R a tio
A D C S o u rc e ¸ 4 ~
A C S R R e g is te r
fO S C ¸ 1 2
P B 0 /A N 0 V C C A 3
P B 1 /A N 1 A /D r e fe r e n c e v o lta g e
P B 2 /A N 2
P B 3 /A N 3 A D R L A /D D a ta
P B 4 /A N 4 A D C
A D R H R e g is te r s
P B 5 /A N 5
P B 6 /A N 6
P B 7 /A N 7
A D C R
P C R 0 ~ P C R 2 A D C S 0 ~ A D C S 2 S T A R T E O C
R e g is te r
P in C o n fig u r a tio n C h a n n e l S e le c t S ta rt a n d E n d o f
B its B its C o n v e r s io n B its
The START bit in the ADCR register is used to start and A/D Converter Clock Source Register - ACSR
reset the A/D converter. When the microcontroller sets The clock source for the A/D converter, which originates
this bit from low to high and then low again, an analog to from the system clock fOSC, is first divided by a division
digital conversion cycle will be initiated. When the ratio, the value of which is determined by the ADCS1
START bit is brought from low to high but not low again, and ADCS0 bits in the ACSR register.
the EOCB bit in the ADCR register will be set high and
www.datasheet4u.com
the analog to digital converter will be reset. It is the Although the A/D clock source is determined by the sys-
START bit that is used to control the overall on/off opera- tem clock fOSC, and by bits ADCS1 and ADCS0, there
tion of the internal analog to digital converter. are some limitations on the maximum A/D clock source
speed that can be selected. Refer to the following table.
The EOCB bit in the ADCR register is used to indicate
when the analog to digital conversion process is com- ACS3 ACS2 ACS1 ACS0 Analog Channel
plete. This bit will be automatically cleared to zero by the 0 0 0 0 AN0
microcontroller after a conversion cycle has ended. In 0 0 0 1 AN1
addition, the corresponding A/D interrupt request flag
0 0 1 0 AN2
will be set in the interrupt control register, and if the inter-
0 0 1 1 AN3
rupts are enabled, an appropriate internal interrupt sig-
nal will be generated. This A/D internal interrupt signal 0 1 0 0 AN4
will direct the program flow to the associated A/D inter- 0 1 0 1 AN5
nal interrupt address for processing. If the A/D internal 0 1 1 0 AN6
interrupt is disabled, the microcontroller can be used to
0 1 1 1 AN7
poll the EOCB bit in the ADCR register to check whether
it has been cleared as an alternative method of detect- ACS Table: A/D Channel Select Table
ing the end of an A/D conversion cycle.
b 7 b 0
S T A R T E O C B P C R 2 P C R 1 P C R 0 A C S 2 A C S 1 A C S 0 A D C R R e g is te r
S e le c t A /D c h a n n e l
T h e d e ta il r e fe r e n c e A C S ta b le
P o r t B A /D c h a n n e l c o n fig u r a tio n s
T h e d e ta il r e fe r e n c e P C R ta b le
E n d o f A /D c o n v e r s io n fla g
1 : n o t e n d o f A /D c o n v e r s io n - A /D c o n v e r s io n w a itin g o r in p r o g r e s s
0 : e n d o f A /D c o n v e r s io n - A /D c o n v e r s io n e n d e d
S ta r t th e A /D c o n v e r s io n
0 ® 1 ® 0 : S ta rt
0 ® 1 : R e s e t A /D c o n v e rte r a n d s e t E O C B to "1 "
ADCR Register
b 7 b 0
T E S T A D C S 1 A D C S 0 A C S R R e g is te r
S e le c t A /D c o n v e r te r c lo c k s o u rc e
A D C S 1 A D C S 0
0 0 : fO S C /4
0 1 : fO S C /6
1 0 : fO S C /8
1 1 : fO S C /1 2
N o t im p le m e n te d , r e a d a s " 0 "
F o r te s t m o d e u s e o n ly
ACSR Register
A/D Input Pins the channel selection bits have changed, then, within a
All of the A/D analog input pins are pin-shared with the time frame of one to ten instruction cycles, the START bit
I/O pins on Port B. Bits PCR2~PCR0 in the ACSR regis- in the ADCR register must first be set high and then im-
ters, not configuration options, determine whether the mediately cleared to zero. This will ensure that the EOCB
input pins are setup as normal Port B input/output pins flag is correctly set to a high condition.
or whether they are setup as analog inputs. In this way,
Summary of A/D Conversion Steps
pins can be changed under program control to change
their function from normal I/O operation to analog inputs The following summarizes the individual steps that
and vice versa. Pull-high resistors, which are setup should be executed in order to implement an A/D con-
through configuration options, apply to the input pins version process.
only when they are used as normal I/O pins, if setup as · Step 1
A/D inputs the pull-high resistors will be automatically Select the required A/D conversion clock by correctly
disconnected. Note that it is not necessary to first setup programming bits ADCS1 and ADCS0 in the ACSR
the A/D pin as an input in the PBC port control register to register.
enable the A/D input, when the PCR2~PCR0 bits en- · Step 2
able an A/D input, the status of the port control register Select which channel is to be connected to the internal
will be overridden. A/D converter by correctly programming the
The VDD power supply pin is used as the A/D converter ACS2~ACS0 bits which are also contained in the
ADCR register.
reference voltage, and as such analog inputs must not
be allowed to exceed this value. Appropriate measures · Step 3
should also be taken to ensure that the VDD pin remains Select which pins on Port B are to be used as A/D in-
as stable and noise free as possible. puts and configure them as A/D input pins by correctly
programming the PCR2~PCR0 bits in the ADCR reg-
Initialising the A/D Converter ister. Note that this step can be combined with Step 2
into ADCR registers programming operation.
The internal A/D converter must be initialized in a special
way. Each time the Port B A/D channel selection bits are · Step 4
modified by the program, the A/D converter must be The analog to digital conversion process can now be
re-initialised. If the A/D converter is not initialized after the initialised by setting the START bit in the ADCR regis-
ter from ²0² to ²1² and then to ²0² again. Note that this
channel selection bits are changed, the EOCB flag may
bit should have been originally set to ²0².
have an undefined value, which may produce a false end
of conversion signal. To initialize the A/D converter after · Step 5
To check when the analog to digital conversion pro- The following timing diagram shows graphically the vari-
cess is complete, the EOCB bit in the ADCR register ous stages involved in an analog to digital conversion
can be polled. The conversion process is complete process and its associated timing.
when this bit goes low. When this occurs the A/D data
registers ADRL and ADRH can be read to obtain the
conversion value.
www.datasheet4u.com
S T A R T
P C R 2 ~ 0 0 0 B 0 1 1 B 1 0 0 B 0 0 0 B
P C R 0
1 . P B p o rt s e tu p a s I/O s
2 . A /D c o n v e r te r is p o w e r e d o ff
to r e d u c e p o w e r c o n s u m p tio n
A C S 2 ~
A C S 0 0 0 0 B 0 1 0 B 0 0 0 B 0 0 1 B D o n 't c a r e
P o w e r-o n S ta rt o f A /D S ta rt o f A /D S ta rt o f A /D
R e s e t c o n v e r s io n c o n v e r s io n c o n v e r s io n
R e s e t A /D R e s e t A /D R e s e t A /D
c o n v e rte r c o n v e rte r c o n v e rte r
E n d o f A /D E n d o f A /D E n d o f A /D
1 : D e fin e P B c o n fig u r a tio n c o n v e r s io n c o n v e r s io n c o n v e r s io n
2 : S e le c t a n a lo g c h a n n e l
tA D C tA D C tA D C
A /D c o n v e r s io n tim e A /D c o n v e r s io n tim e A /D c o n v e r s io n tim e
Configuration Options
Configuration options refer to certain options within the MCU that are programmed into the device during the program-
ming process. During the development process, these options are selected using the HT-MDS software development
tools. As these options are programmed into the device using the hardware programming tools, once they are selected
they cannot be changed later as the application software has no control over the configuration options. All options must
be defined for proper system function, the details of which are shown in the table.
No. Function
1 Watchdog Timer: enable or disable
2 Watchdog Timer clock source: T1 (fOSC/8) or RC OSC
3 CLRWDT instructions: 1 or 2 instructions
4 PA0~PA7: wake-up enable or disable (bit option)
5 PA, PB, PC and PD: pull-high enable or disable (port numbers are device dependent)
6 System oscillator: Xtal Mode or RC Mode
LVR function: enable or disable
7
LVR function: 3.3V/2.2V
8 Share PIN - PA5/INT : Enable (INT)/Disable (PA5)
9 R to F Function : enable or normal I/O (PD)
R to F_ Analog Switch: enable or normal I/O (PC)
K0 Enable and PC1~7
K0~1 Enable and PC2~7
K0~2 Enable and PC3~7
10 K0~3 Enable and PC4~7
K0~4 Enable and PC5~7
K0~5 Enable and PC6~7
K0~6 Enable and PC7
K0~7 Enable
Application Circuits
V D D
1 0 W
4 7 m F 0 .1 m F
www.datasheet4u.com
V D D V D D _ D A C
O S C 1
O S C 2 0 .1 m F
A u d _ in
*R C H
V D D
V D D _ A M P V b ia s 5 0 k W
V D D _ A D C 1 0 m F
In te r n a l P o w e r V D D
4 7 m F 0 .1 m F A M P C ir c u it
S P +
S p e a k e r
(8 W ) 4 7 m F
S P -
8
V D D
L C H O U T N
0 .1 m F V D D O U T N
2
1 0 0 k W V S S 5 0 k W IN 1
V S S _ D A C S P K
H T 8 2 V 7 3 3
R E S V S S _ A M P 3 (8 W )
V R E F 7
V S S _ A D C
O U T P
0 .1 m F 1 0 m F O U T P
H T 3 7 A 7 0 /5 0 /3 0 /2 0 5 4
C E
Note: If user has used internal power AMP circuit, need to add two capacitances (47mF, 0.1mF) that be connected be-
tween VDD_AMP and VSS.
HT37A20 can¢t apply the internal power AMP circuit application because it don¢t integrated Power Amplifier.
²*² In application circuit, the RCH pin connect internal power amplifer circuit or external power amplifer circuit
individually.
V D D
1 0 W
4 7 m F 0 .1 m F
V D D
V D D V D D _ D A C
O S C 1
1 1 .0 5 9 M H z S P K
O S C 2
(8 W )
1 k W
L C H
V D D
7 5 0 W
V D D
V D D _ A M P
V D D _ A D C
S P K
(8 W )
V D D 1 k W
R C H
1 0 0 k W
7 5 0 W
V S S
R E S V S S _ D A C
V S S _ A M P
0 .1 m F
V S S _ A D C
H T 3 7 A 7 0 /5 0 /3 0 /2 0
Instruction Set
Introduction subtract instruction mnemonics to enable the necessary
arithmetic to be carried out. Care must be taken to en-
C e n t ra l t o t he s uc c es s f ul oper a t i on o f a n y
sure correct handling of carry and borrow data when re-
microcontroller is its instruction set, which is a set of pro-
sults exceed 255 for addition and less than 0 for
gram instruction codes that directs the microcontroller to
www.datasheet4u.com
perform certain operations. In the case of Holtek subtraction. The increment and decrement instructions
microcontrollers, a comprehensive and flexible set of INC, INCA, DEC and DECA provide a simple means of
over 60 instructions is provided to enable programmers increasing or decreasing by a value of one of the values
to implement their application with the minimum of pro- in the destination specified.
gramming overheads.
Logical and Rotate Operations
For easier understanding of the various instruction
The standard logical operations such as AND, OR, XOR
codes, they have been subdivided into several func-
and CPL all have their own instruction within the Holtek
tional groupings.
microcontroller instruction set. As with the case of most
instructions involving data manipulation, data must pass
Instruction Timing
through the Accumulator which may involve additional
Most instructions are implemented within one instruc- programming steps. In all logical data operations, the
tion cycle. The exceptions to this are branch, call, or ta- zero flag may be set if the result of the operation is zero.
ble read instructions where two instruction cycles are Another form of logical data manipulation comes from
required. One instruction cycle is equal to 4 system the rotate instructions such as RR, RL, RRC and RLC
clock cycles, therefore in the case of an 11.059MHz sys- which provide a simple means of rotating one bit right or
tem oscillator, most instructions would be implemented left. Different rotate instructions exist depending on pro-
within 0.723ms and branch or call instructions would be gram requirements. Rotate instructions are useful for
implemented within 1ms. Although instructions which re- serial port programming applications where data can be
quire one more cycle to implement are generally limited rotated from an internal register into the Carry bit from
to the JMP, CALL, RET, RETI and table read instruc- where it can be examined and the necessary serial bit
tions, it is important to realize that any other instructions set high or low. Another application where rotate data
which involve manipulation of the Program Counter Low operations are used is to implement multiplication and
register or PCL will also take one more cycle to imple- division calculations.
ment. As instructions which change the contents of the
PCL will imply a direct jump to that new address, one Branches and Control Transfer
more cycle will be required. Examples of such instruc- Program branching takes the form of either jumps to
tions would be ²CLR PCL² or ²MOV PCL, A². For the specified locations using the JMP instruction or to a sub-
case of skip instructions, it must be noted that if the re- routine using the CALL instruction. They differ in the
sult of the comparison involves a skip operation then sense that in the case of a subroutine call, the program
this will also take one more cycle, if no skip is involved must return to the instruction immediately when the sub-
then only one cycle is required. routine has been carried out. This is done by placing a
return instruction RET in the subroutine which will cause
Moving and Transferring Data
the program to jump back to the address right after the
The transfer of data within the microcontroller program CALL instruction. In the case of a JMP instruction, the
is one of the most frequently used operations. Making program simply jumps to the desired location. There is
use of three kinds of MOV instructions, data can be no requirement to jump back to the original jumping off
transferred from registers to the Accumulator and point as in the case of the CALL instruction. One special
vice-versa as well as being able to move specific imme- and extremely useful set of branch instructions are the
diate data directly into the Accumulator. One of the most conditional branches. Here a decision is first made re-
important data transfer applications is to receive data garding the condition of a certain data memory or indi-
from the input ports and transfer data to the output ports. vidual bits. Depending upon the conditions, the program
will continue with the next instruction or skip over it and
Arithmetic Operations jump to the following instruction. These instructions are
The ability to perform certain arithmetic operations and the key to decision making and branching within the pro-
data manipulation is a necessary feature of most gram perhaps determined by the condition of certain in-
microcontroller applications. Within the Holtek put switches or by the condition of internal data bits.
microcontroller instruction set are a range of add and
Note: 1. For skip instructions, if the result of the comparison involves a skip then two cycles are required,
if no skip takes place only one cycle is required.
2. Any instruction which changes the contents of the PCL will also require 2 cycles for execution.
3. For the ²CLR WDT1² and ²CLR WDT2² instructions the TO and PDF flags may be affected by
the execution status. The TO and PDF flags are cleared after both ²CLR WDT1² and
²CLR WDT2² instructions are consecutively executed. Otherwise the TO and PDF flags
remain unchanged.
Instruction Definition
DAA [m] Decimal-Adjust ACC for addition with result in Data Memory
Description Convert the contents of the Accumulator value to a BCD ( Binary Coded Decimal) value re-
sulting from the previous addition of two BCD variables. If the low nibble is greater than 9 or
if AC flag is set, then a value of 6 will be added to the low nibble. Otherwise the low nibble
remains unchanged. If the high nibble is greater than 9 or if the C flag is set, then a value of
6 will be added to the high nibble. Essentially, the decimal conversion is performed by add-
ing 00H, 06H, 60H or 66H depending on the Accumulator and flag conditions. Only the C
flag may be affected by this instruction which indicates that if the original BCD sum is
greater than 100, it allows multiple precision decimal addition.
Operation [m] ¬ ACC + 00H or
[m] ¬ ACC + 06H or
[m] ¬ ACC + 60H or
[m] ¬ ACC + 66H
Affected flag(s) C
NOP No operation
Description No operation is performed. Execution continues with the next instruction.
Operation No operation
Affected flag(s) None
RET A,x Return from subroutine and load immediate data to ACC
Description The Program Counter is restored from the stack and the Accumulator loaded with the
specified immediate data. Program execution continues at the restored address.
Operation Program Counter ¬ Stack
ACC ¬ x
Affected flag(s) None
RLCA [m] Rotate Data Memory left through Carry with result in ACC
Description Data in the specified Data Memory and the carry flag are rotated left by 1 bit. Bit 7 replaces
the Carry bit and the original carry flag is rotated into the bit 0. The rotated result is stored in
the Accumulator and the contents of the Data Memory remain unchanged.
Operation ACC.(i+1) ¬ [m].i; (i = 0~6)
ACC.0 ¬ C
C ¬ [m].7
Affected flag(s) C
RRCA [m] Rotate Data Memory right through Carry with result in ACC
Description Data in the specified Data Memory and the carry flag are rotated right by 1 bit. Bit 0 re-
places the Carry bit and the original carry flag is rotated into bit 7. The rotated result is
stored in the Accumulator and the contents of the Data Memory remain unchanged.
Operation ACC.i ¬ [m].(i+1); (i = 0~6)
ACC.7 ¬ C
C ¬ [m].0
Affected flag(s) C
SBCM A,[m] Subtract Data Memory from ACC with Carry and result in Data Memory
Description The contents of the specified Data Memory and the complement of the carry flag are sub-
tracted from the Accumulator. The result is stored in the Data Memory. Note that if the re-
sult of subtraction is negative, the C flag will be cleared to 0, otherwise if the result is
positive or zero, the C flag will be set to 1.
Operation [m] ¬ ACC - [m] - C
Affected flag(s) OV, Z, AC, C
SDZA [m] Skip if decrement Data Memory is zero with result in ACC
Description The contents of the specified Data Memory are first decremented by 1. If the result is 0, the
following instruction is skipped. The result is stored in the Accumulator but the specified
Data Memory contents remain unchanged. As this requires the insertion of a dummy in-
struction while the next instruction is fetched, it is a two cycle instruction. If the result is not
0, the program proceeds with the following instruction.
Operation ACC ¬ [m] - 1
Skip if ACC = 0
Affected flag(s) None
SIZA [m] Skip if increment Data Memory is zero with result in ACC
Description The contents of the specified Data Memory are first incremented by 1. If the result is 0, the
following instruction is skipped. The result is stored in the Accumulator but the specified
Data Memory contents remain unchanged. As this requires the insertion of a dummy in-
struction while the next instruction is fetched, it is a two cycle instruction. If the result is not
0 the program proceeds with the following instruction.
Operation ACC ¬ [m] + 1
Skip if ACC = 0
Affected flag(s) None
SUBM A,[m] Subtract Data Memory from ACC with result in Data Memory
Description The specified Data Memory is subtracted from the contents of the Accumulator. The result
is stored in the Data Memory. Note that if the result of subtraction is negative, the C flag will
be cleared to 0, otherwise if the result is positive or zero, the C flag will be set to 1.
Operation [m] ¬ ACC - [m]
Affected flag(s) OV, Z, AC, C
TABRDC [m] Read table (current page) to TBLH and Data Memory
Description The low byte of the program code (current page) addressed by the table pointer (TBLP) is
moved to the specified Data Memory and the high byte moved to TBLH.
Operation [m] ¬ program code (low byte)
TBLH ¬ program code (high byte)
Affected flag(s) None
TABRDL [m] Read table (last page) to TBLH and Data Memory
Description The low byte of the program code (last page) addressed by the table pointer (TBLP) is
moved to the specified Data Memory and the high byte moved to TBLH.
Operation [m] ¬ program code (low byte)
TBLH ¬ program code (high byte)
Affected flag(s) None
Package Information
20-pin SOP (300mil) Outline Dimensions
www.datasheet4u.com
2 0 1 1
A B
1 1 0
C '
G
D H
E F a
· MS-013
Dimensions in mil
Symbol
Min. Nom. Max.
A 393 ¾ 419
B 256 ¾ 300
C 12 ¾ 20
C¢ 496 ¾ 512
D ¾ ¾ 104
E ¾ 50 ¾
F 4 ¾ 12
G 16 ¾ 50
H 8 ¾ 13
a 0° ¾ 8°
2 8 1 5
www.datasheet4u.com A B
1 1 4
C '
G
D H
E F a
· MS-013
Dimensions in mil
Symbol
Min. Nom. Max.
A 393 ¾ 419
B 256 ¾ 300
C 12 ¾ 20
C¢ 697 ¾ 713
D ¾ ¾ 104
E ¾ 50 ¾
F 4 ¾ 12
G 16 ¾ 50
H 8 ¾ 13
a 0° ¾ 8°
4 8 2 5
www.datasheet4u.com
A B
1 2 4
C '
G
D H
a
E F
Dimensions in mil
Symbol
Min. Nom. Max.
A 395 ¾ 420
B 291 ¾ 299
C 8 ¾ 12
C¢ 613 ¾ 637
D 85 ¾ 99
E ¾ 25 ¾
F 4 ¾ 10
G 25 ¾ 35
H 4 ¾ 12
a 0° ¾ 8°
C
H
D
www.datasheet4u.com G
5 1 3 3
5 2 3 2
A B
E
6 4 2 0
K a
J
1 1 9
Dimensions in mm
Symbol
Min. Nom. Max.
A 18.8 ¾ 19.2
B 13.9 ¾ 14.1
C 24.8 ¾ 25.2
D 19.9 ¾ 20.1
E ¾ 1 ¾
F ¾ 0.4 ¾
G 2.5 ¾ 3.1
H ¾ ¾ 3.4
I ¾ 0.1 ¾
J 1.15 ¾ 1.45
K 0.1 ¾ 0.2
a 0° ¾ 7°
www.datasheet4u.com
D H
G
6 0 4 1
6 1 4 0
A B
8 0 2 1
K a
J
1 2 0
Dimensions in mm
Symbol
Min. Nom. Max.
A 11.9 ¾ 12.1
B 9.9 ¾ 10.1
C 11.9 ¾ 12.1
D 9.9 ¾ 10.1
E ¾ 0.40 ¾
F ¾ 0.16 ¾
G 1.35 ¾ 1.45
H ¾ ¾ 1.6
I ¾ 0.1 ¾
J 0.45 ¾ 0.75
K 0.1 ¾ 0.2
a 0° ¾ 7°
D
T 2
www.datasheet4u.com
A B C
T 1
SSOP 48W
F
www.datasheet4u.com W
B 0
C
D 1 P
K 0
A 0
R e e l H o le
IC p a c k a g e p in 1 a n d th e r e e l h o le s
a r e lo c a te d o n th e s a m e s id e .
SOP 20W
Symbol Description Dimensions in mm
W Carrier Tape Width 24.0+0.3/-0.1
P Cavity Pitch 12.0±0.1
E Perforation Position 1.75±0.10
F Cavity to Perforation (Width Direction) 11.5±0.1
D Perforation Diameter 1.5+0.1/-0.0
D1 Cavity Hole Diameter 1.50+0.25/-0.00
P0 Perforation Pitch 4.0±0.1
P1 Cavity to Perforation (Length Direction) 2.0±0.1
A0 Cavity Length 10.8±0.1
B0 Cavity Width 13.3±0.1
K0 Cavity Depth 3.2±0.1
t Carrier Tape Thickness 0.30±0.05
C Cover Tape Width 21.3±0.1
P 0 P 1 t
D
F
www.datasheet4u.com
W C B 0
K 1
D 1 P
K 2
A 0
R e e l H o le ( C ir c le )
IC p a c k a g e p in 1 a n d th e r e e l h o le s
a r e lo c a te d o n th e s a m e s id e .
R e e l H o le ( E llip s e )
SSOP 48W
www.datasheet4u.com