Published by
MCU Application Team in HYUNDAI ELCETRONICS Co., Ltd.
¨Ï
HYUNDAI ELECTRONICS Co., Ltd. 1998 All Right Reserved.
Additional information of this manual may be served by HYUNDAI ELECTIONICS Offices in Korea or
Distributors and Representative listed at address directory.
HYUNDAI ELECTIONICS 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, HYUNDAI
ELECTIONICS Co., Ltd. is in no way responsible for any violations of patents or other rights of the
third party generated by the use of this manual.
The GMS810 Series is the high speed and Low voltage operating 8-bit single chip
microcomputers. This MCU contains G8MC core, ROM, RAM, input/output ports and five
multi-function timer/counters.
tcpnsXin250500 10001
tsys
tcpH
tcpL
trcp
tfcp
tIH
tIL
tRSTL
tECH
tECL
trEC
tfEC
Xin
Xin
Xin
Xin
INT1~INT2
INT1~INT2
RESET
EC
EC
EC
EC
Specification
mintypmax
500 1000 2000
40
40
40
40
2
2
8
2
2
40
40
ns
ns
ns
ns
ns
tsys
tsys
tsys
tsys
tsys
ns
ns
1 - 16
Chapter 1. Overview
Xin
INT1
INT2
RESET
EC
trCP
0.8Vcc
tfEC
tCPH
tfCP
tRSTL
tCP
tIH
tECHtECL
0.8Vcc0.8Vcc
trEC
tCPL
Vcc-0.5V
0.5V
tIL
0.2Vcc
0.2Vcc
0.2Vcc
* FIG-1 : Clock, INT, RESET. EC input timing
1 - 17
OVERVIEW1
FUNCTION DESCRIPTION2
I/O PORT3
PERIPHERAL HARDWARE4
INTERRUPT5
STANDBY FUNCTION6
RESET FUNCTION7
APPENDIX A.8
APPENDIX B.9
CHAPTER 2. FUNCTION DESCRIPTION
2.1 REGISTERS
1570
Chapter 2. Function Description
PCHPCL
70
A
1570
70
70
70
70
NVGBHIZC
¡é
X
Y
SP
PSW
Program Counter
A-Register
YA (16bit Accumulator)
X-Register
Y-Register
Stack Pointer ¡Ø1
Program Status Word
¡é
Carry Flag
Zero Flag
Interrupt Enable Flag
Half Carry Flag
Break Flag
G Flag
Overflow Flag
Negative Flag
¡Ø
1 Stack Address
1570
PCHPCL
¡é
Fixed as 01XXh (=RAM 1page)
¡é
SP
2 - 1
Chapter 2. Function Description
2.1.1 A register
- 8bit Accumulator.
- In the case of 16-bit operation, compose the lower 8-bit of A, upper 8bit in Y (16-bit
Accumulator)
- In the case of multiplication instruction, execute as a multiplier register. After
multiplication operation, the lower 8-bit of the result enters. (Y*A ¡æ YA)
- In the case of division instruction, execute as the lower 8-bit of dividend. After
division operation, quotient enters.
2.1.2 X register
- General-purpose 8-bit register
- In the case of index addressing mode within direct page(RAM area), execute as
index register.
- In the case of division instruction, execute as register.
2.1.3 Y register
- General-purpose 8-bit register
- In the case of index addressing mode, execute as index register
- 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.
- Can be used as loop counter of conditional branch command. (e.g.DBNE Y, rel)
2.1.4 Stack Pointer
- In the cases of subroutine call, Interrupt and PUSH, POP, RETI, RET instruction,
stack data on RAM or in the case of returning, assign the storage location having
stacked data.
- Stack area is constrained within 1-page (00H-FFH). The SP is post-decremented
when a subroutine call or a push instruction is executed, or when an interrupt is
accepted; and the SP is pre-incremented when a return or a pop instruction is
executed.
- SP should be initialized as follows
ex) LDX #0FEH: 0FEH ¡æ X reg.
TXSP: X reg. ¡æ SP
- The behaviors of stack pointer according to each instruction are the following.
2 - 2
2.1.4.1 Interrupt
Chapter 2. Function Description
M(SP) ¡ç (PCH)
SP ¡ç SP - 1
2.1.4.2 RETI( Return from interrupt )
SP ¡ç SP + 1
(PSW) ¡ç M(SP)
2.1.4.3 Subroutine call
M(SP) ¡ç (PCH)
SP ¡ç SP - 1
M(SP) ¡ç (PCL)
SP ¡ç SP - 1
SP ¡ç SP + 1
(PCL) ¡ç M(SP)
M(SP) ¡ç (PCL)
SP ¡ç SP - 1
M(SP) ¡ç (PSW)
SP ¡ç SP - 1
SP ¡ç SP + 1
(PCH) ¡ç M(SP)
2.1.4.4 RET(Return from subroutine)
SP ¡ç SP + 1
(PCL) ¡ç M(SP)
SP ¡ç SP + 1
(PCH) ¡ç M(SP)
2 - 3
Chapter 2. Function Description
2.1.4.5 PUSH A(X, Y, PSW)
M(SP) ¡ç A
SP ¡ç SP - 1
2.1.4.6 POP A(X, Y, PSW)
SP ¡ç SP + 1
A ¡ç M(SP)
2.1.5 PC (Program Counter)
- Program counter is a 16-bit counter consisted of 8-bit register PCH and PCL.
- Addressing space is 64K bytes.
2.1.6 PSW (Program Status Word)
- PSW is an 8-bit register.
- Consisted of the flags showing the post state of operation and the flags determining
the CPU operation, initialized as 00H in reset state.
2.1.7 Flag register.
2.1.7.1 Carry flag (C)
- After operation, set when there is a carry from bit7 of ALU or there is not a borrow.
- Set by SETC and clear by CLRC.
- Executable as 1-bit accumulator.
- Branch condition flag of BCS, BCC.
2.1.7.2 Zero flag (Z)
- After operation also including 16-bit operatiion, set if the result is ¡È0
¡È
- Branch condition flag of BEQ, BNE.
2.1.7.3 Interrupt enable flag (I)
- Master enable flag of interrupt except for RST (reset).
- Set and cleared by EI, DI
2 - 4
Chapter 2. Function Description
2.1.7.4 Half carry flag (H)
- After operation, set when there is a carry from bit3 of ALU or there is not a borrow
from bit4 of ALU.
- Can not be set by any instruction.
- Cleared by CLRV instruction like V flag.
2.1.7.5 Break flag (B)
- Set by BRK (S/W interrupt) instruction to distinguish BRK and TCALL instruction
having the same vector address.
2.1.7.6 G flag (G)
- Set and cleared by SETG, CLRG instruction.
- Assign direct page (0-page, 1-page).
- Addressable directly to RAM 1-page by SETG. and to RAM 0-page by CLRG.
2.1.7.7 Overflow flag (V)
- After operation, set when overflow or underflow occurs.
- In the case of BIT instruction, bit6 memory location is transferred to V-flag.
- Cleared by CLRV instruction, but not set by any instruction.
- Branch condition flag of BVS, BVC.
2.1.7.8 Negative flag (N)
- Set whenever the result of a data transfer or operation is negative (bit7 is set to
¡È1¡È
).
- In the case of BIT instruction, bit7 of memory location is transferred to N-flag
- N-flag is not affected by CLR or SET instruction.