2001 Hynix Semiconductor, Inc. All right reserved.
Additional information of this manual may be served by Hynix Semiconductor offices in Korea or Distributors and Representatives listed at address directory.
Hynix Semiconductor reserves the right to make changes to any information here in at any time without notice.
The information, diagrams and other data in this manual are correct and reliable; however, Hynix Semiconductor is in no
way responsible for any violations of patents or other rights of the third party generated by the use of this manual.
Instruction Set ..................................................iv
JUNE 2001 Ver 1.00
HMS81004E/08E/16E/24E/32E
HMS81004E/08E/16E/24E/32E
CMOS SINGLE- CHIP 8-BIT MICROCONTROLLER
FOR UNIVERSAL REMOTE CONTROLLER
1. OVERVIEW
1.1 Description
The HMS81004E/08E/16E/24E/32E is an advanced CMOS 8-bit microcontroller with 4/8/16/24/32K bytes of ROM. The
device is one of GMS800 family. The HYNIX HMS81004 E/08E/16E/24E/32E is a powerfu l microcontroller which provides
a highly flexible and cost effective solution to many UR applications.The HMS81004E/0 8E/16E/24E/32E provides the following standard features: 4/8/16/24/32K bytes of ROM, 448 bytes of RAM, 8-bit timer/counter, on-chip oscillator and clock
circuitry. In addition, the HMS81004E/08E/16E/24E/32E supports power saving modes to reduce power consumption.
• Watch Dog Timer Auto Start (During 1second
after Power on Reset)
20 SOP/PDIP
24 SOP/Skinny DIP
28 SOP/Skinny DIP
JUNE 2001 Ver 1.001
HMS81004E/08E/16E/24E/32E
1.3 Development Tools
The HMS81004E/08E/16E/24E/32E are supported by a full-featured macro assembler, an in-circuit emulator CHOICE-Dr.
and OTP programmers. Macro assembler operates under the MSWindows 95/98
pins 1 or 0 written to the Port Direction Register can be
used as outputs or inputs .
8JUNE 2001 Ver 1.00
HMS81004E/08E/16E/24E/32E
PIN NAME
R00I/O
R01I/O
R02I/O
R03I/O
R04I/O
R05I/O
R06I/O
R07I/O
R10I/O
R11/INT1I/O
R12/INT2I/O
R13I/O
R14/EC
R15/T2I/O
R16/T1I/O
R17/T0I/O
R20I/O- Each bit of the port can be individually configured as
R21I/O
R22I/O
R23I/O
R24I/O
XINI Oscillator inputLow
XOUTOOscillator outputHigh
REMOUTOHigh current output‘L’ output‘L’ output
RESET
TEST
VDDPPositive power supply
VSSPGroud
INPUT/
OUTPUT
- Each bit of the port can be individually configured as
an input or an output by user software
- Push-pull output
- CMOS input with pull-up resister (option)
- Can be programmable as key scan input
- Pull-up resisters are automatically disabled at output
mode
- Each bit of the port can be individually configured as
an input or an output by user software
Storage Temperature ......................................-65~150°C
Power Dissipation................................................700 mA
7.2 Recommended Operating Conditions
ParameterSymbolCondition
Supply Voltage
Operating Frequency
Operating Temperature
V
T
DD
f
XIN
OPR
f
XIN
VDD=2.0~3.6V
7.3 DC Electrical Characteristics
(TA=-0~70°C, VDD=2.0~3.6V, GND=0V)
ParameterSymbolCondition
Note: Stresses above those listed under “Absolute Maxi-
mum Ratings” may cause per manent damage to the d evice. This is a stress ra ting only and functional ope r ati on of
the device at any oth er c ond iti ons ab ov e tho se ind ic ated in
the oper ati o na l se c ti ons of this s pe c ifi ca t io n i s no t i m pl ie d .
Exposure to absolute maximum rating conditions for extended periods may affect device reliability.
Operating current ,fxin=4Mhz, VDD=2.0V-2.46mA
Operating current ,fxin=4Mhz, VDD=3.6V-410mA
Sleep mode current ,fxin=4Mhz,
VDD=2.0V
Sleep mode current ,fxin=4Mhz,
VDD=3.6V
Stop mode current ,Oscillator Stop
VDD=2.0V
Stop mode current ,Oscillator Stop
VDD=3.6V
OL
Specifications
Unit
Min.Typ.Max.
=2V-30
OH
=1V
0.5-3mA
-12-5mA
µ
A
-12mA
-23mA
-28µA
-310µA
-0.7--V
7.4 REMOUT Port Ioh Characteristics Graph
(typical process & room temperature)
.
Ioh(mA)
0
-5
-10
-15
-20
-25
-30
0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
Voh (
Vdd 2V
Vdd 3V
Vdd 4V
V)
Figure 7-1 Ioh vs Voh
JUNE 2001 Ver 1.0013
HMS81004E/08E/16E/24E/32E
7.5 REMOUT Port Iol Characteristics Graph
(typical process & room temperature)
.
Iol(mA)
5
4
3
2
1
0
-1
0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
7.6 AC Characteristics
(TA=0~+70°°°°C, VDD=2.0~3.6V, VSS=0V)
ParameterSymbolPins
Vdd 2V
Vol (
V)
Figure 7-2 Iol vs Vol
Vdd 4V
Vdd 3V
Specifications
Unit
Min.Typ.Max.
External clock input cycle time
System clock cycle time
External clock pulse width High
External clock pulse width Low
External clock rising time
External clock falling time
Interrupt pulse width High
Interrupt pulse width Low
RESET Input pulse width low
Event counter input pulse width high
Event counter input pulse width low
Event counter input pulse rising time
Event counter input pu lse fa lling time
t
CP
t
SYS
t
CPH
t
CPL
t
RCP
t
FCP
t
t
t
RSTL
t
ECH
t
ECL
t
REC
t
FEC
IH
IL
X
IN
2505001000ns
50010002000
X
IN
X
IN
X
IN
X
IN
40--ns
40--ns
--40ns
--40nS
INT1, INT22-INT1, INT22--
RESET8--
EC2-EC2-EC--40
EC--40
t
SYS
t
SYS
t
SYS
t
SYS
t
SYS
ns
ns
ns
14JUNE 2001 Ver 1.00
HMS81004E/08E/16E/24E/32E
X
IN
INT1
INT2
RESET
EC
t
CP
t
RCP
t
IH
0.8V
DD
t
RSTL
t
ECH
Figure 7-3 Timing Diagram
t
CPH
t
ECL
t
CPL
-0.5V
V
DD
0.5V
t
FCP
t
IL
0.2V
DD
0.2V
DD
0.8V
DD
0.2V
DD
JUNE 2001 Ver 1.0015
HMS81004E/08E/16E/24E/32E
8. MEMORY ORGANIZATION
The HMS81004E/08E/16E/24E/32E has separate address
spaces for Program memory and Data Memory. Program
memory can only be read, not written to. It can be up to
8.1 Registers
This device has six registers that are the Program Counter
(PC), an Accumulator (A), two index registers (X, Y), the
Stack Pointer (SP), and the Program Status Word (PSW).
The Program Counter consists of 16-bit register.
A
X
Y
SP
PCLPCH
PSW
Figure 8-1 Configuration of Registers
Accumulator:
The Accumulator is the 8-bit general purpose register, used
for data operation such as transfer, temporary saving, and
conditional judgement, etc. The Accumulator can be used
as a 16-bit register with Y Register as shown below.
In the case of multiplication instruction, execute as a multiplier register. After multiplication operation, the lower 8bit of the result enters. (Y*A => YA). In the case of division instruction, ex ecute as the lo wer 8-bit of di vidend. After division operation, quotient enters.
Y
A
Two 8-bit Registers can be used as a "YA" 16-bit Register
ACCUMULATOR
X REGISTER
Y REGISTER
STACK POINTER
PROGRAM COUNTER
PROGRAM STATUS
WORD
YA
32K bytes of Program memory. Data memory can be read
and written to up to 448 bytes including the stack area.
X, Y Registers:
In the addressing mode which uses these index registers,
the register contents are added to the specified address,
which becomes the actual address. These modes are extremely effective for referencing subroutine tables and
memory tables. The index registers also have increment,
decrement, comparison and data transfer functions, and
they can be used as simple accumulators.
• X Regist er
In the case of division instruction, execute as register.
• Y Regist er
In the case of 16-bit operation instruction, execute as the
upper 8-bit of YA. (16-bit accumulator). In the case of
multiplication instruction, execute as a multiplicand register. After multiplication operation, the upper 8-bit of the
result enters. In the case of division instruction, execute as
the upper 8-bit of dividend. After division operation, remains enters. Y register can be used as loop counter of
conditional branch command. (e.g.DBNE Y, rel)
Stack Pointer:
The Stack Pointer is an 8-bit register used for occurrence
interrupts, calling out subroutines and P USH, POP, RETI,
RET instruction. Stack Pointer identifies the location in the
stack to be accessed (save or restore).
Generally, SP is automatically updated when a subrout ine
call is executed or an interrupt is accepted. However, if it
is used in excess of the stack area permitted by the data
memory allocating configuration, the user-processed data
may be lost. The SP is post-decremented when a subroutine call or a push instruction is executed, or when an interrupt is accepted. The SP is pre-incremented when a return
or a pop instruction is executed.
Figure 8-2 Configuration of YA 16-bit Register
The stack can be located at any position within 100
1FF
of the internal data memory. The SP is not initialized
H
to
H
by hardware, requiring to write the initial v alue (the lo cation with which the use of the stack starts) by using the initialization routine. Normally, the initial value of "FF
H
" is
16JUNE 2001 Ver 1.00
HMS81004E/08E/16E/24E/32E
used.
Stack Address ( 100H ~ 1FFH )
15087
01
H
Hardware fixed
At execution of
a CALL/TCALL/PCALL
01FC
01FD
01FE
01FF
SP before
execution
SP after
execution
PCL
PCH
01FF
01FD
Push
down
SP
01FC
01FD
01FE
01FF
At acceptance
of interrupt
PSW
PCL
PCH
01FF
01FC
Push
down
Caution:
The Stack Pointer must be initialized by software be-
cause its value is undefined after RESET.
Example: To initialize the SP
LDX#0FFH
TXSP; SP ← FFH
At execution
of RET instruction
01FC
01FD
01FE
01FF
PCL
PCH
01FD
01FF
Pop
up
At execution
of RETI instruction
01FC
01FD
01FE
01FF
PSW
PCL
PCH
01FC
01FF
Pop
up
At execution
of PUSH instruction
PUSH A (X,Y,PSW)
01FC
01FD
SP before
execution
SP after
execution
01FE
01FF
01FF
01FE
Push
A
down
Figure 8-3 Stack Operation
Program Counter:
The Program Counter is a 16-bit wide which consists of
two 8-bit registers, PCH and PCL. This counter indicates
the address of the next instruction to be executed. In reset
state, the program counter has reset routine address
(PC
:0FFH, PCL:0FEH).
H
Program Status Word:
The Program Status Word (PSW) contains several bits that
At execution
of POP instruction
POP A (X,Y,PSW)
01FC
01FD
01FE
01FF
A
01FE
01FF
Pop
up
0100H
01FFH
Stack
depth
reflect the current state of the CPU. The PSW is described
in Figure 8-4 . It contains the Negative flag, the Overflow
flag, the Break flag the Half Carry (for BCD operation),
the Interrupt enable flag, the Zero flag, and the Carry flag.
[Carry flag C]
This flag stores any carry or borrow from the ALU of CPU
after an arithmetic operation and is also changed by the
Shift Instruction or Rotate Instruction.
JUNE 2001 Ver 1.0017
HMS81004E/08E/16E/24E/32E
[Zero flag Z]
This flag is set when the result of an arithmetic operat ion
or data transfer is "0" and is cleared by any other result.
MSBLSB
N
PSW
VGBHIZC
RESET VALUE : 00
H
NEGATIVE FLAG
OVERFLOW FLAG
SELECT DIRECT PAGE
when g=1, page is addressed by RPR
BRK FLAG
Figure 8-4 PSW (Program Status Word) Register
[Interrupt disable flag I]
This flag enables/disables all interrupts except interrupt
caused by Reset or software BRK instruction. All interrupts are disabled when cleared to "0". This flag immediately becomes "0" when an interrupt is served. It is set by
the EI instruction and cleared by the DI instruction.
[Half carry flag H]
After operation, this is set when there is a carry from bit 3
of ALU or there is no borrow from bit 4 of ALU. This bit
can not be set or cleared except CLRV instruction with
Overflow flag (V).
[Break flag B]
This flag is set by software BRK instruction to distinguish
BRK from TCALL instruction with the same vector address.
[Direct page flag G]
CARRY FLAG RECEIVES
CARRY OUT
ZERO FLAG
INTERRUPT ENABLE FLAG
HALF CARRY FLAG RECEIVES
CARRY OUT FROM BIT 1 OF
ADDITION OPERLANDS
the direct addressing mode, addressing area is from zero
page 00
to 0FFH when this flag is "0". If it is set to "1",
H
addressing area is 1 Page. It is set by SETG instruction and
cleared by CLRG.
[Overflow flag V]
This flag is set to "1" when an overflow occurs as the result
of an arithmetic operation involving signs. An overflow
occurs when the result of an addition or subtraction exceeds +127(7F
) or -128(80H). The CLRV instruction
H
clears the overflow flag. There is no set instruction. When
the BIT instruction is executed, bit 6 of memory is copied
to this flag.
[Negative flag N]
This flag is set to match the sign bit (bit 7) status of the result of a data or arithmetic operation. When the BIT instruction is executed, bit 7 of memory is copied to this flag.
This flag assigns RAM page for di rect addressing mode. I n
18JUNE 2001 Ver 1.00
8.2 Program Memory
E0
E2
Address
Vector Area Memory
E4
E6
E8
EA
EC
EE
F0
F2
F4
F6
F8
FA
FC
FE
-
-
-
Basic Interval Timer Interrupt Vector Area
-
-
Timer2 Interrupt Vector Area
Timer0 Interrupt Vector Area
-
External Interrupt 2 Vector Area
Key Scan Interrupt Vector Area
RESET Vector Area
External Interrupt 1 Vector Area
Timer1 Interrupt Vector Area
Watch Dog Timer Interrupt Vector Area
"-" means reserved area.
NOTE:
-
0FFDE
H
S/W Interrupt Vector Area
HMS81004E/08E/16E/24E/32E
A 16-bit program counter is capable of addressing up to
64K bytes, but this device has 4/8/16/24/32K bytes program memory space only physically implemented. Accessing a location above FFFF
to 0000
.
H
will cause a wrap-around
H
Figure 8-5 , shows a map of Progr am Memory. After reset,
the CPU begins execution from reset vector which is stored
in address FFFE
and FFFFH as shown in Figure 8-6 .
H
As shown in Figure 8-5 , each area is assigned a fixed location in Program M emory. Program Memory area contains the user program.
8000
H
A000
H
C000
H
32KROM
E000
F000
FF00
FFC0
FFE0
FFFF
H
H
H
H
H
INTERRUPT
VECTOR AREA
H
PCALL
AREA
TCALL
AREA
8KROM
4KROM
HMS81008E
HMS81004E
KROM
HMS81016E 16
24KROM
HMS81032E
HMS81024E
Example: Usage of TCALL
LDA#5
TCALL 0FH;
:;
:;
;
;TABLE CALL ROUTINE
;
FUNC_A: LDALRG0
RET
;
FUNC_B: LDALRG1
RET
;
;TABLE CALL ADD. AREA
;
ORG0FFC0H;
DWFUNC_A
DWFUNC_B
1BYTE INSTRUCTION
IN STEAD OF 2 BYTES
NORMAL CALL
1
2
TCALL ADDRESS AREA
The interrupt causes the CPU to jum p to specific location,
where it commences the execution of the service routine.
The External interrupt 0, for example, is assigned to location 0FFFA
interval: 0FFF8
0FFFA
Any area from 0FF00
. The interrupt service locations spaces 2-byte
H
and 0FFF9H for External Interru pt 1,
H
and 0FFFBH for External Interrupt 0, etc.
H
to 0FFFFH, if it is not going to be
H
used, its service location is available as general purpose
Program Memory.
Figure 8-5 Program Memory Map
Page Call (PCALL) area contains subroutine program to
reduce program byte length by using 2 bytes PCALL instead of 3 bytes CALL instruction. If it is frequently
called, it is more useful to save program byte length.
Table Call (TCALL) c auses the CPU to jump to each
TCALL address, where it commences the execution of the
service routine. The Table Call service area spaces 2-byte
for every TCALL: 0FFC0
TCALL14, etc., as shown in Figure 8-7 .
JUNE 2001 Ver 1.0019
for TCALL15, 0FFC2H for
H
Figure 8-6 Interrupt Vector Area
HMS81004E/08E/16E/24E/32E
11111111
11010110
01001010
PC:
FHFHDH6
H
4A
~
~
~
~
25
0FFD6H
0FF00H
0FFFFH
D1
NEXT
0FFD7H
➊
➋
➌
0D125H
Reverse
AddressPCALL Area Memory
0FF00
H
PCALL Area
(192 Bytes)
0FFBF
H
AddressPro gram Memory
0FFC0
H
C1
C2
C3
C4
C5
C6
C7
C8
C9
CA
CB
CC
CD
CE
CF
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DA
DB
DC
DD
DE
DF
NOTE:
* means that the BRK software interrupt is using
same address with TCALL0.
TCALL 15
TCALL 14
TCALL 13
TCALL 12
TCALL 11
TCALL 10
TCALL 9
TCALL 8
TCALL 7
TCALL 6
TCALL 5
TCALL 4
TCALL 3
TCALL 2
TCALL 1
TCALL 0 / BRK *
Figure 8-7 PCALL and TCALL Memory Area
PCALL
4F35PCALL 35H
20JUNE 2001 Ver 1.00
→
→
→ →
rel
0FF00H
0FF35H
0FFFFH
TCALL
→
→
→ →
n
4ATCALL 4
4F
35
~
~
NEXT
~
~
HMS81004E/08E/16E/24E/32E
Example: The usage software example of Vector address and the initialize part.
;********************************************
; MAIN PROGRAM *
;********************************************
;
RESET:NOP
RAM_CLR:LDA#0;RAM Clear(!0000H->!00BFH)
CLRG
DI;Disable All Interrupts
LDX#0
STA{X}+
CMPX#0C0H
BNERAM_CLR;
LDX#0FFH;Stack Pointer Initialize
TXSP
LDMR0, #0;Normal Port 0
LDMR0DD,#1000_0010B;Normal Port Direction
LDMP0PC,#1000_0010B;Pull Up Selection Set
LDMPMR1,#0000_0010B;R1 port / int
:
:
LDMCKCTLR,#0011_1101B;WDT ON , 16mS Time delay after stop mode release
:
:
JUNE 2001 Ver 1.0021
Loading...
+ 53 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.