8-bit programmable timer with built-in
frequency source
General Description
The HTG12G0 is a 4-bit singl e chip microcontroller specially designed for LCD product applications.
HTG12G0
Microcontroller
•
Internal timer overflow and RTC interrupt
•
16 kinds of programmable sound effects
•
Halt function and wake-up feature
reduce power consumption
•
One-level subroutine nesting
•
8-bit table read instruction
•
Up to 4.0µs instruction cycle with 1.0MHz
system clock at V
•
95 powerful instructions
It is ideally suited for applications requiring
low power consumption, with many L CD segments such as calculator , scale, subsystem controller, hand-held LCD products and electroni c
appliances.
DD
=3V
114th May ’99
Block Diagram
HTG12G0
Notes: ACC: AccumulatorPC: Program counter
R0~R4: Working registersP A0~PA1: Output ports
PP , PS: Input portsPA3: ROM bank control bit
PA2: LCD on/off switch
214th May ’99
Pad Assignment
HTG12G0
Chip size: 3070 × 4440 (µm)
* The IC substrate should be connected to VSS in the PCB layout artwork.
An external resistor between OSCI and OSCO
is needed for internal system clock.
For test mode only
TEST1 and TEST2 must be open when the
HTG12G0 is in normal operation (with an
internal pull high resistor)
4-bit port for input only
2-bit latch port for output only
4-bit port for input only
Input for reset LSI inside
Reset is active at logical low level
HTG12G0
*: 6 internal sources deriving from the system clock can be selected as sound effect clock by mask
option. If Holtek’s sound library is invoked, only 128K and 64K is accepted.
**: Each bit of input ports PS, PP can be a trigger source of HALT interrupt. That can be specified
by mask option.
Absolu te Maximu m R a tin g s
Supply Voltage .........................VSS–0.3V to 13VOperating Temperature...................0°C to 70°C
Input V oltage.......................V
Note: These are stress ratings only. Stresses exceeding the range spe cified under “Absolute Maxi-
mum 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 condition s may affect device reliability.
–0.3 to VDD+0.3Storage Temperature.................–50°C to 125°C
SS
514th May ’99
HTG12G0
D.C. CharacteristicsTa=25°C
SymbolParameter
V
DD
I
DD
Operating Voltage——2.4—3.3V
Operating Current3V No load, f
Standby Current
I
STB
(RTC OSC ON)
and LCD ON
V
V
V
V
I
I
I
I
I
I
I
I
R
R
IL1
IH1
IL2
IH2
OL1
OH1
OL2
OH2
OL3
OH3
OL4
OH4
PH1
PH2
Input Low Voltage3V PS, PP0—0.6V
Input High Voltage3V PS, PP2.1—3.0V
Input Low Voltage3V RES0—0.6V
Input High Voltage3V RES2.5—3.0V
Port A, BZ and BZ
Output Sink Current
Port A, BZ and BZ
Output Source Current
Segment 0~7 Output
Sink Current
Segment 0~7 Output
Source Current
Segment 8~49 Output
Sink Current
Segment 8~49 Output
Source Current
Common Output Sink
Current
Common Output
Source Current
Pull-high Resistance3V PS, PP15—200kΩ
Pull-high Resistance3V RES100—300kΩ
Test Conditions
V
DD
Conditions
=500kHz—100500µA
SYS
Min.Typ. Max. Uint
3V System halt—1020
3V V
3V V
3V V
3V V
3V V
3V V
3V V
3V V
=3V, VOL=0.3V1.53.0—mA
DD
=3V, VOH=2.7V–0.5–1.5—mA
DD
=3V, VOL=0.3V80100—µA
LCD
=3V, VOH=2.7V–50–70—µA
LCD
=3V, VOL=0.3V4060—µA
LCD
=3V, VOH=2.7V–20–40—µA
LCD
=3V, VOL=0.3V100120—µA
LCD
=3V, VOH=2.7V–100–130—µA
LCD
µA
614th May ’99
HTG12G0
A.C. CharacteristicsTa=25°C
SymbolParameter
f
SYS
f
LCD
t
COM
t
CY
t
RES
f
SOUND
System Clock3VR:620kΩ~51kΩ100—1000kHz
LCD Clock3V——512—Hz
LCD Common Period—1/8 duty—(1/f
Cycle Time—f
Reset Pulse Width——5——ms
Sound Effect Clock———64 or 128*—kHz
Test Conditions
V
DD
Conditions
=1.0MHz—4.0—µs
SYS
Min.Typ.Max.Unit
)x8—sec
LCD
*: Only these two clock signal frequencies are supported by Holtek sound library.
714th May ’99
Functional Description
Program counter – PC
The 12-bit program counter is controlled by PA3
which can change the ROM bank of the program
memory. There are two program memory banks
which are selected by PA3, e ach bank is 4KB
ROM. The instruction“OUT PA, A” is used to
change the value of PA3. Then, low or hi gh 4K
ROM is selected accordingly. All instructions
are not effective on the crossin g bank, unless
the value of PA3 is changed in advance.
The 12-bit program counter (PC) controls the
sequence in which the instructions stored in the
program ROM are executed and its contents
specify a max. of 4096 address.
After accessing a memory word to fetch an instruction code, the contents of the program
counter are incremented by one or two, then the
program counter will point to the memory word
containing the next instruction code.
When executing the jump instruction (JMP,
JNZ, JC, JTMR...), subro uti ne cal l, intern al interrupt, RTC inte rrupt or return from su broutine, the PC manipulate s the pro gram transfer
by loading the address corresponding to each
instruction.
Progr a m me mory – ROM
The program memory is used to store program
instruction which is to be execu ted . It is orga nized into 8192
gram counter and PA3.
Certain locations in bank 0 of the program
memory are reserved for specific usage:
•
Location 0004H
This area is reserved for TIMER interrupt
service program. A timer interrupt results
from TIMER overflow, if interrupt is enabled,
the CPU begins execution at location 0004H.
Program Counter
×8 bits and addressed by the pro-
Notes: PC11~PC0: Instruction code bits@: PC11 keeps current value
S11~S0: Stack register bitsP A3: Bank value bits
814th May ’99
•
Location 0008H
This area is reserved for RTC interrup t serv-
ice program.
•
Location 0n00H~0nFF H (n=current number)
and 0F00H~0FFFH.
The last 256 bytes of each page in the program
memory, addressed f rom 0n00H to 0n FFH and
0F00H to 0FFFH can be used as a look–up
table. The instructions READ R4A, READ
MR0A, READF R4A, READF MR0A can read
the table and transfer the contents of the table
to ACC and R4 or transfer to ACC and data
memory addresse d by register p air “R1, R0”.
These areas may function as a normal program memory depending on the requirements.
Certain locations in bank 1 of the program
memory are reserved for specific usage:
•
Location 1000H
This area is reserved for the initialization pro-
gram. After reset, the CPU always begins execution at location 1000H.
•
Location 1004H
This area is reserved for TIMER interrupt
service program. A timer interrupt results
from TIMER overflow, if interrupt is enabled,
the CPU begins execution at location 1004H.
•
Location 1008H
This area is reserved for RTC interrup t serv-
ice program.
•
Location 1n00H~1nFF H (n=current number)
and 1F00H~1FFFH.
The last 256 bytes of each page in the program
memory, addressed f rom 1n00H to 1n FFH and
1F00H to 1FFFH can be used as a look–up
table. The instructions READ R4A, READ
MR0A, READF R4A, READF MR0A can read
the table and transfer the contents of the table
to ACC and R4 or transfer to ACC and data
memory addresse d by register p air “R1, R0”.
These areas may function as a normal program memory depending on the requirements.
The program memory (ROM) mapping is
shown below:
HTG12G0
Program memory
In the execution of an instruction, the program counter is added before the executing
phase. So a careful manipulation of READ
MR0A and READ R4A is needed in the page
margin.
Stack register
This is a special group of register which is used
to save the contents of the program counter
(PC) and is organized with 13 bits
bit is used to sto re the ca rry flag. An inte rrupt
will force the contents of the PC and the carry
flag onto the stack register. A subroutine call
will also cause the PC contents to be pushed
onto the stack; however the carry flag will not
be stored. At the en d of a subroutine or interrupt routine which is signaled by a return instruction, RET or RETI restores the program
counter to its previous value from stack register.
Executing “RETI” instruction will restore the
carry flag from the stack register, but “RET”
does not.
×1 level. One
914th May ’99
HTG12G0
Working registers – R0, R1, R2, R3, R4
These five registers are usually used to store the
frequently accessed data. Th e workin g regi ster
can be incremented (+1) or decremented (–1).
The JNZ Rn,address (n=0,1,4) instruction
makes very efficient use of the working register
as program loop counter. The register pairs of
R1, R0 and R3, R2 can also be used as the data
memory pointer, when the data memory transfer instruction is executed.
Data memory – RAM
The data memory is a static RAM organized
with 256
× 4 bits and is used to store temporary
data and display data. All of the data memory
locations are indirectly addressable through the
register pair “R1, R0” or “R3, R2”.
There are two areas in the data memory , temporary data area and display data area. Access to
temporary data memory is made through
00H~9BH address, an d access to display data
memory is made in 9CH~FFH address.
When data is written in the di splay area, the
LCD driver automatically reads it and generates an LCD driving signal.
Data memory
Accumulator – ACC
The register ACC plays the most important role
in data manipulation and data transfer. It is not
only one of the s ources of inp ut to the A LU bu t
also the destin ation of the result due to ALU.
Data transfer can be performed b etween ACC
and other registers, data memory or I/O ports.
Arithmetic and log ic unit – ALU
This circuit performs arithmeti c and logic operation. The AL U provides the fol lowing functions:
•
Arithmetic operation
(ADD, ADC, SUB, SBC, DAA)
•
Logic operation (AND, OR, XOR)
•
Rotation (RL, RR, RLC, RRC)
•
Increment and Decrement (INC, DEC)
•
Branch decision (JZ, JNZ, JC, JNC...)
The ALU not only outputs the results of data
operation but also sets the status of carry flag
(C) in some instructions.
Timer
This is a programmable 8–bit count-up counter ,
internal frequency sources used to aid the user
in counting and generating accurate time base.
The Timer can be pre-set and read with software instructions. “TIMER XXH”, “MOV
TMRL, A” and “MOV TMRH, A” preload TIMER
value. “MOV A, TMR L” and “MOV A, TMRH”
read the contents of TIMER to ACC.
The Timer is stopped by a hardware reset or
“TIMER OFF” instruction and started by a
TIMER ON instruction.
Once the Timer is started, it will in crement to
its maximum count (FFH) and overflows to zero
(00H). It will not stop until there is a “TIMER
OFF” instruction or reset. When an overflow
occurs, it will set the Timer Flag (T F) simultaneously. If interrupt is enabled, the Timer circuit supports TF for internal interrupt. The
state of the TF can be tested with the conditional instruction JTMR.
The Timer flag is cleared after the interrupt or
JTMR instruction is executed.
The frequency of the internal frequency so urce
can be selected by mask option.
Frequency of TIMER clock
system clock
=
n
2
Where n=0,1,2......13 except 6, by mask option
(the sixth stage is reserved for internal use).
1014th May ’99
Loading...
+ 21 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.