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 ....................................................v
C. MASK ORDER SHEET........................xi
GMS81C2112/GMS81C2120
GMS81C2112/GMS81C2120
CMOS Single-Chip 8-Bit Microcontroller
with A/D Converter & VFD Driver
1. OVERVIEW
1.1 Description
The GMS81C2112 and GMS81C2120 are advanced CMOS 8-b it micro contr oller with 12 K/20K bytes of ROM. Thes e are a
powerful microcontroller which provides a highly flexible and cost effective solution to many VFD applications. These provide the following standard features: 12K/20K bytes of ROM, 448 bytes of RAM, 8-bit timer/counter, 8-bit A/D converter,
10-bit High Speed PWM Output, Programmable Buzzer Driving Port, 8-bit Basic Interval Timer, 7-bit Watch dog Timer,
Serial Peripheral Interface, on-chip oscillator and clo ck circuitry. They also come with h igh voltage I/O p ins that can dir ectl y
drive a VFD (Vacuum Fluores cent Displ ay). I n addit ion, t he GMS81C21 12 and GMS 81C212 0 suppor t po wer saving modes
to reduce power consumption.
Device nameROM SizeRAM SizeOTPPackage
GMS81C211212K bytes
GMS81C212020K bytesGMS87C2120
1.2 Features
• 20K/12K bytes ROM(EPROM)
• 448 Bytes of On-Chip Data RAM
(Including STACK Area)
• 8-Channel 8-bit On-Chip Analog to Digital Converter
• Oscillator:
- Crystal
- Ceramic Resonator
- External R Oscillator
• Low Power Dissipation Modes
- STOP mode
- Wake-up Timer Mode
- Standby Mode
• Operating Voltage: 2.7V ~ 5.5V (at 4.5MHz)
• Operating Frequency: 1MHz ~ 4.5MHz
• Enhanced EMS Improvement
Power Fail Processor
(Noise Immunity Circuit)Enhanced EMS
Improvement
Power Fail Processor
(Noise Immunity Circuit)
42SDIP, 44MQFP,
40PDIP
• Eight Interrupt Sources
- Two External Sources (INT0, INT1)
- Two Timer/Counter Sources (Timer0, Timer1)
- Four Functional Sources (SPI,ADC,WDT,BIT)
JUNE. 2001 Ver 1.001
GMS81C2112/GMS81C2120
1.3 Development Tools
The GMS81C21xx are supported by a full-featured macro
assembler, an in-circuit emulator CHOICE-Dr.
TM
and
OTP programmers. There are third diffe rent type program mers such as emulator add-on board type, single type, gang
type. For mode detail, Refer to “21. OTP PROGRAMMING” on page 83. Macro assembler operates under the
MS-Windows 95/98
: Supply voltage to the ladder resistor of ADC circuit. To enhance the resolution of analog to digital converter, use independent po wer source as wel l as poss ible, oth er
than digital power source.
SS
AV
: ADC circuit ground.
RESET
X
: Reset the MCU.
IN
: Input to the inverting oscillator amplifier and input to
the internal clock operating circuit.
OUT
X
: Output from the inverting oscillator amplifier.
RA(V
In addition, RA serves the functions of the V
features. V
)
: RA is one-bit high-voltage input only port pin.
disp
is used as a high-voltage i nput power supply
disp
disp
special
pin when selected by the mask option.
Port pinAlternate function
V
RA
R00~R07
: R0 is an 8-bit hi gh-voltage CMOS bidir ectional
(High-voltage input power supply)
disp
I/O port. R0 pins 1 or 0 written to the Port Direction Register can be used as outputs or inputs. In addition, R0
serves the functions of the various following special features.
: R2 is an 8-bit high-voltage CMOS bidirectional
I/O port. R2 pins 1 or 0 writt en to th e Port Direction R eg ister can be used as outputs or inputs.
R30~R34
: R3 is a 5-bit high-voltage CMOS bidirectional
I/O port. R3 pins 1 or 0 writt en to th e Port Direction R eg ister can be used as outputs or inputs.
R53~R57
: R5 is an 5-bit CMOS bidirectional I/O port. R5
pins 1 or 0 written to the Port Direction Register can be
used as outputs or inputs. In addition, R5 serves the functions of the various following special features.
Port pinAlternate function
R53
R54
R55
R56
R60~R67
SCLK (Serial clock)
SIN (Serial data input)
SOUT (Serial data output)
PWM1O (PWM1 Output)
T1O (Timer/Counter 1 output)
: R6 is an 8-bit CMOS bidirectional I/O port. R6
pins 1 or 0 written to the Port Direction Register can be
used as outputs or inputs. In addition, R6 is shared with the
ADC input.
Serial clock source
R54 (SIN)I/O (I)Serial data input
R55 (SOUT)I/O (O)Serial data output
R56 (PWM1O/T1O)I/O (O)
5-bit high-voltage I/O ports
PWM 1 pulse output /Timer/Counter 1 out-
put
R57I/O
R60~R67 (AN0~AN7)I/O (I)8-bit general I/O portsAnalog voltage input
DD
AV
AV
V
V
SS
DD
SS
-Supply voltage input pin for ADC
-Ground level input pin for ADC
-Supply voltage
-Circuit ground
Table 5-1 GMS81C2120 Port Function Description
JUNE. 2001 Ver 1.009
GMS81C2112/GMS81C2120
Data Bus
V
DD
V
SS
Pin
Data Reg.
Direction
Reg.
Rd
MUX
Selection
SCLK Output
SCLK Input
V
DD
Mask
N-MOS
Open Drain Select
Option
Pull-up
Tr.
Data Bus
V
DD
V
SS
Pin
Data Reg.
Direction
Reg.
Rd
Selection
SIN Input
V
DD
Mask
N-MOS
Open Drain Select
Option
Pull-up
Tr.
6. PORT STRUCTURES
R57
Data Reg.
Dir.
Reg.
Data Bus
MUX
Rd
R00/INT0, R01/INT1, R02/EC0
Selection
Data Reg.
Data Reg.
Dir.
Reg.
Data Bus
Rd
V
DD
VSS
V
DD
Mask
Option
Pull-up
Tr.
Mask
Option
V
DD
R53/SCLK
Pin
R54/SIN
Pin
EX) INT0
Alternate Function
Vdisp
10JUNE. 2001 Ver 1.00
GMS81C2112/GMS81C2120
RESET
V
DD
V
SS
OTP :disconnected
Main :connected
XOUT
V
DD
XIN
Stop
Mainclk Off
V
SS
Pin
Data Reg.
Dir.
Rd
V
DD
Vdisp
Reg.
Data Bus
MUX
MUX
Selection
Data Reg.
Secondary
Function
Mask
Option
R55/SOUT
SOUT output
Data Reg.
Direction
Reg.
IOSWB
Data Bus
IOSWIN Input
RA/Vdisp
Rd
Selection
MUX
N-MOS
Open Drain Select
RESET
V
DD
Pull-up
Tr.
Mask
Option
V
DD
Pin
V
SS
V
DD
XIN, XOUT
Data bus
Rd
Vdisp
Mask
Option
R03/BUZO
R04~R07, R20~R27, R30~R34
V
DD
Data Reg.
Mask
Dir.
Reg.
Data Bus
Rd
MUX
Option
Vdisp
Pin
JUNE. 2001 Ver 1.0011
GMS81C2112/GMS81C2120
R56/PWM1O/T1O
Selection
SOUT output
MUX
Data Reg.
Direction
Reg.
Data Bus
R60~R67/AN0~AN7
Data Reg.
N-MOS
Open Drain Select
Rd
V
DD
Pull-up
Tr.
Mask
Option
V
DD
Pin
V
SS
V
DD
Pull-up
Tr.
Mask
V
DD
Option
Direction
Reg.
Data Bus
A/D
Converter
Analog
Input Mode
A/D Ch.
Selection
Rd
Pin
V
SS
12JUNE. 2001 Ver 1.00
7. ELECTRICAL CHARACTERISTICS
7.1 Absolute Maximum Ratings
GMS81C2112/GMS81C2120
Supply voltage.............................................-0.3 to +7.0 V
Storage Temperature ....................................-40 to +85 °C
Voltage on Normal voltage pin
with respect to Ground (V
..............................................................-0.3 to V
SS
)
+0.3 V
DD
Voltage on High voltage pin
with respect to Ground (V
............................................................-45V to V
Maximum current out of V
Maximum current into V
Maximum current sunk by (I
)
SS
DD
pin..........................150 mA
SS
pin ..............................80 mA
DD
per I/O Pin) ..........20 mA
OL
+0.3 V
7.2 Recommended Operating Conditions
ParameterSymbolCondition
Supply Voltage
Operating Frequency
Operating Temperature
T
V
f
DD
XIN
OPR
fXI = 4.5 MHz
VDD = V
Maximum output current sourced by (I
per I/O Pin)
OH
............................. ...... ................................................ 8 mA
Maximum current (ΣI
Maximum current (ΣI
Note:
Stresses above those listed under “Absolute Maximum 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 pecificatio n i s no t i mp l ie d .
Exposure to absolute maximum rating conditions for extended periods may affect device reliability.
Min.Max.
2.75.5V
DD
-4085
)......................................100 mA
OL
)........................................50 mA
OH
Specifications
14.5MHz
Unit
°
C
7.3 A/D Converter Characteristics
(TA=25°C, VDD=5V, VSS=0V, AVDD=5.12V, AVSS=0V @
ParameterSymbolCondition
Analog Power Supply Input Voltage Range
Analog Input Voltage Range
Current Following
Between AV
DD
and
AV
SS
Overall Accuracy
Non-Linearity Error
Differential Non-Linearity Error
Zero Offset Error
Full Scale Error
Gain Error
Conversion Time
1. Data in “T yp” column is at 25°C unless otherwise stated. These parameters are for design guidance only and are not tested.
AV
V
I
AVDD
CA
N
N
DNLE
N
N
N
T
CONV
DD
AN
IN
NLE
ZOE
FSE
NLE
=4MHz)
f
XIN
f
XIN
=4MHz
Specifications
AV
Min.
AV
SS
SS
-0.3
Typ.
1
AV
Max.
AV
DD
DD
+0.3
--200uA
--±2LSB
--±2LSB
--±2LSB
--±2LSB
--±2LSB
--±2LSB
--20us
Unit
V
V
JUNE. 2001 Ver 1.0013
GMS81C2112/GMS81C2120
DC Electrical Characteristics for Standard Pins(5V)
7.4
(VDD = 5.0V ± 10%, V
= 0V, TA = -40 ~ 85°C, f
SS
= 4 MHz, Vdisp = VDD-40V to VDD)
XIN
,
Specification
ParameterPinSymbolTest Condition
Min
XIN
Input High Voltage
RESET,SIN,R55,SCLK,
&
1,EC0
INT0
R53~R57,R6
XIN
,SIN,,R55,SCLK,
Input Low Voltage
RESET
&
INT0
1,EC0
R53~R57,R6
Output High
Voltage
Output Low
Voltage
Input High
Leakage Current
Input Low
Leakage Current
Input Pull-up
Current(*Option)
Power Fa il
Detect Voltage
Current dissipation
in active mode
Current dissipation
in standby mode
Current dissipation
in stop mode
Hysteresis
Internal RC WDT
Frequency
RC Oscillation
Frequency
1. Data in “Typ.” column is at 4.5V, 25°C unless otherwise stated. These parameters are for design guidance only and are not tested.
R53~R57,R6,BUZO,
PWM1O/T1O,SCLK,SOUT
R53~R57,R6,BUZO,
PWM1O/T1O,SCLK,SOUT
R53~R57,R6
R53~R57,R6
R53~R57,R6
V
DD
V
DD
V
DD
V
DD
,SIN,R55,SCLK,
RESET
,
INT1,EC0
INT0
XOUT
XOUT
V
V
V
V
V
V
V
V
OL1
V
OL2
I
IH1
I
IL1
I
PU
V
PFD
I
DD
I
STBY
I
STOP
V
T+~VT-
T
RCWDT
f
RCOSC
IH1
IH2
IH3
IL1
IL2
IL3
OH
External Clock
External Clock-0.3
I
= -0.5mAVDD-0.5
OH
I
= 1.6mA
OL
I
= 10mA
OL
XIN
f
=4.5MHz8mA
XIN
f
=4.5MHz3mA
XIN
f
=Off
SXIN
=32.7KHz
f
R= 120K
0.9V
DD
0.8V
DD
0.7V
DD
-0.3
-0.3
-1uA
50100180uA
0.4V
830KHz
Ω
1.522.5MHz
1
Typ.
Max
VDD+0.3
VDD+0.3
VDD+0.3
0.1V
DD
0.2V
DD
0.3V
DD
0.4
2
1uA
2.7V
10uA
Unit
V
V
V
V
14JUNE. 2001 Ver 1.00
7.5 DC Electrical Characteristics for High-Voltage Pins
GMS81C2112/GMS81C2120
(VDD = 5.0V ± 10%, V
= 0V, TA = -40 ~ 85°C, f
SS
= 4 MHz, Vdisp = VDD-40V to VDD)
XIN
Specification
ParameterPinSymbolTest Condition
Input High Voltage R0,R2,R30~R34,RA
Input Low VoltageR0,R2,R30~R34,RA
Output High
Voltage
Output Low
Voltage
Input High
Leakage Current
Input Pull-down
Current(*Option)
R0,R2,R30~R34
R0,R2,R30~R34
R0,R2,R30~R34,RA
R0,R2,R30~R34
Input High Voltage R0,R2,R30~R34,RA
1. Data in “Typ.” column is at 4.5V, 25°C unless otherwise stated. These parameters are for design guidance only and are not tested.
V
IH
V
IL
I
= -15mA
OH
I
V
OH
OH
I
OH
= -10mA
= - 4mA
Vdisp = VDD-40
V
OL
150KΩ atVDD-
40
I
IH
I
PD
V
IH
VIN=VDD-40V
to V
DD
Vdisp=VDD-35V
VIN=V
DD
Min
0.7V
DD
VDD-400.3V
-3.0
V
DD
VDD-2.0
V
-1.0
DD
2006001000uA
0.7V
DD
Typ.
1
Max
VDD+0.3
DD
V
-37
DD
VDD-37
20uA
VDD+0.3
Unit
V
V
V
V
V
JUNE. 2001 Ver 1.0015
GMS81C2112/GMS81C2120
7.6 AC Characteristics
(TA=-40~ 85°C, VDD=5V±10%, VSS=0V)
ParameterSymbolPins
Operating Frequency
External Clock Pulse Width
External Clock Transition Time
Oscillation Stabilizing Time
External Input Pulse Width
External Input Pulse Transi-
tion Time
RESET Input Width
XI
f
CP
t
CPW
t
RCP,tFCP
t
ST
t
EPW
t
REP,tFEP
t
RST
Specifications
Min.Typ.Max.
XIN1-8MHz
XIN80--nS
XIN--20nS
XIN, XOUT--20mS
INT0, INT1, EC02--
INT0, INT1, EC0--20nS
RESET8--
t
1/f
CP
CPW
t
CPW
0.5V
-0.5V
V
DD
Unit
t
SYS
t
SYS
RESETB
INT0, INT1
EC0
t
REP
t
SYS
t
EPW
t
FEP
t
t
RCP
RST
t
EPW
t
FCP
Figure 7-1 Timing Chart
0.2V
0.2V
DD
0.8V
DD
DD
16JUNE. 2001 Ver 1.00
7.7 AC Characteristics
GMS81C2112/GMS81C2120
(TA=-40~+85°C, VDD=5V±10%, VSS=0V, f
ParameterSymbolPins
Serial Input Clock Pulse
Serial Input Clock Pulse Width
Serial Input Clock Pulse Transition
Time
SIN Input Pulse Transition Time
SIN Input Setup Time (External SCLK)
SIN Input Setup Time (Internal SCLK)
SIN Input Hold Time
Serial Output Clock Cycle Time
Serial Output Clock Pulse Width
Serial Output Clock Pulse Transition
Time
Serial Output Delay Time
XIN
t
SCYC
t
SCKW
t
FSCK
t
RSCK
t
FSIN
t
RSIN
t
SUS
t
SUS
t
HS
t
SCYC
t
SCKW
t
FSCK
t
RSCK
s
OUT
=4MHz)
Specifications
Unit
Min.Typ.Max.
SCLK
SCLK
2t
SYS
+70
t
SYS
-8ns
-8ns
+200
SCLK--30ns
SIN--30ns
SIN100--ns
SIN200-ns
SIN
SCLK
SCLK
t
SYS
t
4t
SYS
SYS
-30
-ns
-
16t
SYS
ns
ns
+70
SCLK30ns
SOUT100ns
SCLK
SIN
SOUT
t
0.8V
0.2V
t
SCYC
FSCK
DD
DD
t
SCKW
t
SUS
t
FSIN
t
DS
0.8V
DD
0.2V
DD
Figure 7-2 Serial I/O Timing Chart
t
RSCK
t
SCKW
t
HS
0.8V
DD
0.2V
DD
t
RSIN
JUNE. 2001 Ver 1.0017
GMS81C2112/GMS81C2120
7.8 Typical Characteristics
This graphs and tables provided in this section are for design guidance only and are not tested or guaranteed.
In some graphs or tables the data presented are outside specified operating range (e.g. outside specified
VDD range). This is for information only and devices
are guaranteed to operate properly only within the
specified range.
R40~R43, R6, R53~R57
BUZO, PWM1O/T1O
V
SCLK, SOUT pins
OH
4.8 4.9
R40~R43, R6, R53~R57
BUZO, PWM1O/T1O
OL
SCLK, SOUT pins
5.0
V
(V)
OH
I
OH
(mA)
-1.6
-1.2
-0.8
-0.4
I
OL
(mA)
16
I
OH
VDD=4.0V
Ta=25°C
0
I
OL
VDD=4.0V
Ta=25°C
−
V
OH
3.6 3.7
−
V
OL
I
OH
(mA)
-1.6
-1.2
-0.8
-0.4
I
OL
(mA)
16
I
OH
VDD=5.0V
Ta=25°C
0
I
OL
VDD=5.0V
Ta=25°C
−
4.64.7
−
V
The data presented in this s ection is a statistical s ummary
of data collected on units from different lots over a period
of time. “Typical” represents the mean of the distribution
while “max” or “min” represents (mean + 3σ) and (mean −
3σ) respectively where σ is standard deviation
−
I
V
OH
VDD=3.0V
Ta=25°C
2.62.7
−
I
V
OL
VDD=3.0V
Ta=25°C
OL
OH
2.8 2.9
3.0
3.8 3.9
4.0
V
(V)
OH
I
OH
(mA)
-1.6
-1.2
-0.8
-0.4
I
OL
(mA)
16
0
V
(V)
OH
12
8
4
0
I
OH
(mA)
-16
-12
-8
-4
I
OH
VDD=5.0V
Ta=25°C
0
0.60.8
−
V
OH
1.02.0
1.0 1.2
R0, R2,RA
R30~R34 pins
3.0 4.0
1.4
5.0
V
(V)
V
(V)
12
8
4
1.4
5.0
V
(V)
V
(V)
OL
OH
I
OH
(mA)
-16
-12
-8
-4
0
I
0
0.6 0.8
−
V
OH
VDD=4.0V
Ta=25°C
1.0 2.0
1.0 1.2
OH
3.0 4.0
OL
OH
12
I
OH
(mA)
-16
-12
-8
-4
8
4
0
I
0
0.60.8
−
V
OH
VDD=3.0V
Ta=25°C
1.02.0
OH
1.0 1.2
3.0 4.0
1.4
5.0
V
(V)
V
(V)
OL
OH
18JUNE. 2001 Ver 1.00
GMS81C2112/GMS81C2120
RESET, R55, SIN, SCLK
V
IH2
INT0, INT1, EC0 pinsXIN pins
45
RESET, R55, SIN, SCLK
V
IL2
INT0, INT1, EC0 pinsXIN pins
23
45
−
V
V
DD
V
IH3
f
=4.5MHz
XIN
(V)
Ta=25°C
4
3
2
1
V
DD
(V)
6
V
DD
(V)
6
0
1
23
−
V
V
DD
V
IL3
f
=4.5MHz
XIN
(V)
Ta=25°C
4
3
2
1
0
1
23
IH3
IL3
R53~R57, R6 pins
V
(V)
45
R53~R57, R6 pins
45
6
V
6
DD
(V)
DD
4
3
2
1
0
IL2
4
3
2
1
0
V
DD
f
XIN
Ta=25°C
1
V
DD
f
XIN
Ta=25°C
1
−
=4.5MHz
23
−
=4.5MHz
−
V
V
DD
f
=4.5MHz
XIN
Ta=25°C
23
V
DD
f
=4.5MHz
XIN
Ta=25°C
IH1
−
V
IL1
23
45
45
V
DD
(V)
6
V
DD
(V)
6
V
IH1
(V)
4
3
2
1
0
V
IL1
(V)
4
3
2
1
0
V
IH2
(V)
V
(V)
I
DD
(mA)
4.0
3.0
2.0
1.0
0
I
DD
Ta=25°C
−
V
DD
f
= 4.5MHz
XIN
23
Normal Operation
2.5MHz
45
−
V
I
SBY
DD
= 4.5MHz
XIN
Stand-by Mode
2.5MHz
45
V
DD
(V)
6
I
DD
Ta=25°C
(mA)
4.0
3.0
2.0
1.0
V
DD
(V)
6
0
f
23
I
DD
(µA)
2.0
1.5
1.0
0.5
0
I
STOP
−
V
DD
23
Stop Mode
45
6
85°C
25°C
-20°C
V
DD
(V)
JUNE. 2001 Ver 1.0019
GMS81C2112/GMS81C2120
SP
01
H
Stack Address ( 100H ~ 1FEH )
Bit 15Bit 087
Hardware fixed
00H~FF
H
8. MEMORY ORGANIZATION
The GMS81C2112 and GMS81C2120 have separate address spaces for Program memory and Data Memory. Pro gram memory can only be read, not written to. It can be up
8.1 Registers
This device has six registers that are the Program Counter
(PC), a 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
PCH
Figure 8-1 Configuration of Registers
Accumulator:
PCL
PSW
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.
ACCUMULATOR
X REGISTER
Y REGISTER
STACK POINTER
PROGRAM COUNTER
PROGRAM STATUS
WORD
to 12K/20K bytes of Program memory. Data memory can
be read and written to up to 448 by tes includ ing the s tack
area.
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 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
” is
H
used.
Note:
The Stack Pointer must be initi alized by softwa re be-
cause its value is undefined after RESET.
Example: To initialize the SP
LDX#0FFH
TXSP; SP ← FFH
Y
YA
A
Two 8-bit Registers can be used as a "YA" 16-bit Register
Figure 8-2 Configuration of YA 16-bit Register
X, Y Registers
: In the addressing mode which uses these
index registers, the register conten ts a re added to the specified address, which becomes the actual address. These
modes are extremely effective for referencing subroutine
tables and memory tables . The index regi sters also h ave increment, decrement, comparison and data transfer functions, and they can be used as simple accumulators.
Stack Pointer
: The Stack Pointer is an 8-bit register used
for occurrence interrupts and calling out subroutines. Stack
Pointer identifies the location in the stack to be access
(save or restore).
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
Program Status Word
:0FFH, PCL:0FEH).
H
: The Program Status Word (PSW)
contains several bits that reflect the current state of the
CPU. The PSW is described in Figure 8-3. 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.
[Zero flag Z]
This flag is set when the result of an arithmetic operation
or data transfer is "0" and is cleared by any other result.
20JUNE. 2001 Ver 1.00
NEGATIVE FLAG
OVERFLOW FLAG
when G=1, page is selected to “page 1”
SELECT DIRECT PAGE
BRK FLAG
Figure 8-3 PSW (Program Status Word) Register
MSBLSB
N
PSW
V G B H I Z C
GMS81C2112/GMS81C2120
RESET VALUE : 00
CARRY FLAG RECEIVES
CARRY OUT
ZERO FLAG
INTERRUPT ENABLE FLAG
HALF CARRY FLAG RECEIVES
CARRY OUT FROM BIT 1 OF
ADDITION OPERLANDS
H
[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]
This flag assigns RAM page for direct addressing mode. In
the direct addressing mode, addressing area is from zero
page 00
addressing area is assigned 100
to 0FFH when this flag is "0". If it is set to "1",
H
to 1FFH. It is set by
H
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 re-
sult of a data or arithmetic operation. When the BIT instruction is executed, bit 7 of memory is copied to this flag.
JUNE. 2001 Ver 1.0021
GMS81C2112/GMS81C2120
At execution of
a CALL/TCALL/PCALL
01FE
01FD
01FC
01FB
SP before
execution
SP after
execution
PCH
PCL
01FE
01FC
Push
down
01FE
01FD
01FC
01FB
SP before
execution
SP after
execution
At acceptance
of interrupt
01FE
01FD
01FC
01FB
At execution
of PUSH instruction
PUSH A (X,Y,PSW)
A
01FE
01FD
PCH
PCL
PSW
01FE
01FB
Push
down
Push
down
01FE
01FD
01FC
01FB
At execution
of RET instruction
01FE
01FD
01FC
01FB
At execution
of POP instruction
POP A (X,Y,PSW)
PCH
PCL
01FC
01FE
A
01FD
01FE
Pop
up
Pop
up
At execution
of RET instruction
01FE
01FD
01FC
01FB
0100H
01FEH
PCH
PCL
PSW
01FB
01FE
Stack
depth
Pop
up
Figure 8-4 Stack Operation
22JUNE. 2001 Ver 1.00
8.2 Program Memory
0FFE0H
E2
AddressVector Area Memory
E4
E6
E8
EA
EC
EE
F0
F2
F4
F6
F8
FA
FC
FE
-
-
Serial Communication Interface
Basic Interval Timer
-
-
-
Timer/Counter 0 Interrupt
-
External Interrupt 0
-
RESET Vector Area
External Interrupt 1
Watchdog Timer Interrupt
"-" means reserved area.
NOTE:
Timer/Counter 1 Interrupt
-
A/D Converter
GMS81C2112/GMS81C2120
A 16-bit program counter is capable of addressing up to
64K bytes, but this device has 2 0K bytes program memory
space only physically implemented. Accessing a location
above FFFF
will cause a wrap-around to 0000H.
H
Figure 8-5, shows a map of Pr ogram 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 fix ed location in Program Memory. Program Memory area contains
the user program.
B000
H
D000
H
FEFF
H
FF00
FFC0
FFDF
FFE0
FFFF
H
H
TCALL area
H
H
Vector Area
H
Interrupt
PCALL area
GMS81C2120, 20K ROM
GMS81C2112, 12K ROM
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 3 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,
and 0FFFBH for External Interrupt 0, etc.
H
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.0023
for TCALL15, 0FFC2H for
H
Figure 8-6 Interrupt Vector Area
GMS81C2112/GMS81C2120
11111111 11010110
01001010
PC:
FH FH DH 6H
4A
~
~
~
~
25
0FFD6
H
0FF00
H
0FFFF
H
D1
NEXT
0FFD7
H
➊
➋
➌
0D125
H
Reverse
Address
0FF00
0FFFF
PCALL Area Memory
H
PCALL Area
(256 Bytes)
H
AddressP ro gra m Mem o r y
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.