background image
GMS81C3004
MAR. 1999 Ver 1.01
Table of Contents
1. OVERVIEW ............................................1
Description .........................................................1
Features .............................................................1
Development Tools ............................................1
2. BLOCK DIAGRAM .................................2
3. PIN ASSIGNMENT ................................3
4. PACKAGE DIAGRAM ............................4
5. PIN FUNCTION......................................5
6. PORT STRUCTURES............................7
7. ELECTRICAL CHARACTERISTICS ....10
Absolute Maximum Ratings .............................10
Recommended Operating Conditions ..............10
DC Electrical Characteristics ...........................10
A/D Comparator Characteristics ......................12
AC Characteristics ...........................................12
Typical Characteristics .....................................14
8. MEMORY ORGANIZATION.................16
Registers ..........................................................16
Program Memory .............................................19
Data Memory ...................................................22
Addressing Mode .............................................25
9. I/O PORTS ...........................................29
Registers for Port .............................................29
I/O Ports Configuration ....................................30
10. CLOCK GENERATOR .......................33
Operation Mode ...............................................35
Operation Mode Switching ...............................36
11. TIMER ................................................38
Basic Interval Timer .........................................38
Timer/Event Counter 1 .....................................39
Watch Timer .....................................................43
12. COMPARATOR .................................44
13. INTERRUPTS ....................................46
Interrupt Sequence .......................................... 48
Multi Interrupt .................................................. 50
External Interrupt ............................................. 51
14. KEY SCAN.........................................53
15. LCD DRIVER .....................................55
Configuration of LCD driver ............................. 55
Control of LCD Driver Circuit ........................... 56
Bias Resistor ................................................... 57
LCD Display Memory ...................................... 59
LCD Port Selection .......................................... 60
Control Method of LCD Driver ......................... 60
LCD Waveform ................................................ 62
16. WATCHDOG TIMER .........................64
17. BUZZER DRIVER ..............................66
18. POWER DOWN OPERATION...........68
SLEEP Mode ................................................... 68
STOP Mode .................................................... 69
19. OSCILLATOR CIRCUIT.....................73
20. RESET ...............................................74
External Reset Input ........................................ 74
Watchdog Timer Reset ................................... 74
21. POWER FAIL PROCESSOR.............75
A. CONTROL REGISTER LIST .................. i
B. PAD COORDINATION .......................... ii
Pad Layout ......................................................... ii
Bonding Pad Coordination ................................ iii
C. INSTRUCTION ..................................... iv
Terminology List ................................................iv
Instruction Map ...................................................v
Instruction Set ...................................................vi
D. MASK ORDER SHEET ....................... xii
background image
GMS81C3004
MAR. 1999 Ver 1.01
1
GMS81C3004
CMOS SINGLE-CHIP 8-BIT MICROCONTROLLER
WITH LCD DRIVER
1. OVERVIEW
1.1 Description
The GMS81C3004 is an advanced CMOS 8-bit microcontroller with 4K bytes of ROM. The device is one of GMS800 fam-
ily. The LG Semicon GMS81C3004 is a powerful microcontroller which provides a highly flexible and cost effective solu-
tion to many LCD applications such as controller with LCD and toys. The GMS81C3004 provides the following standard
features: 4K bytes of ROM, 256 bytes of RAM, 8-bit timer/counter, on-chip oscillator and clock circuitry. In addition, the
GMS81C3004 supports power saving modes to reduce power consumption.
1.2 Features
• 4K Bytes On-chip Program Memory
• 256 Bytes of On-chip Data RAM
(Included 64 bytes stack memory)
• Dot Matrix LCD Driver
- Max. 320 dots (40 seg. x 8 com.)
- 40 bytes of Display RAM
• Instruction Cycle Time:
- 0.5us, 1.9us, 3.8us, 15.2us at 4.19MHz
- 61us, 244us, 488us, 1.95ms at 32.768KHz
• 51 Programmable I/O pins
(Included 32 LCD pins)
• 2.2V to 5.5V Wide Operating Range
• Dual Clock Operation (4.19MHz, 32kHz)
• One 8-bit Basic Interval Timer
• Key Scan
• One 8-bit Timer/ Counter
• Watch Timer
• Watchdog timer
• Eight Interrupt sources
- External input: 3
- Keyscan input: 1
- Timer: 4
• Buzzer Driving port
- 500Hz ~ 130kHz
• 4-channel 5-bit On-chip Comparator
• Power Down Mode
- STOP mode
- SLEEP mode
1.3 Development Tools
The GMS81C3004 is supported by a full-featured macro
assembler, an in-circuit emulator CHOICE-Dr
TM
.
Device name
ROM Size
RAM Size
Package
GMS81C3004
4K bytes
256 bytes
80QFP or DIE
In Circuit Emulators
CHOICE-Dr. (with EVA81C)
LCD Simulator
Under development
Assembler
LGS Macro Assembler
background image
GMS81C3004
2
MAR. 1999 Ver 1.01
2. BLOCK DIAGRAM
ALU
LCD CONTROLLER
Accumulator
Stack Pointer
Interrupt Controller
Data
Memory
LCD
Memory
Display
5-bit
C om p ara tor
8-bit
Counter
Timer/
Program
Memory
Data Table
PC
8-bit Basic
Tim er
Interval
Watchdog
Timer
PC
R0
R1
R2
Buzzer
Driver
PSW
System controller
Timing generator
System
Clock Controller
Clock
Generator
High freq.
Low freq.
RESET
TEST
XIN
XOUT
SXIN
SXOUT
LCD Power
Supply
Segment Drive Output
SEG0 ~ SEG39
Common Drive Output
COM0 ~ COM7
R00 / INT0
R01 / INT1
R02 / INT2
R03 / EC1
R04
R05
R06 / LCDCK
R07
R10/ KS0
R11 / KS1
R12 / KS2
R13 / BUZ / KS3
R14 / CMP0 / KS4
R15 / CMP1 / KS5
R16 / CMP2 / KS6
R17 / CMP3 / KS7
R20~R22
VDD
VSS
Power
Supply
VCL1
VCL2
VCL3
VCL4
VCL5
Watch
Timer
R7
R6
R5
R4
(R4, R5, R6, R7)
background image
GMS81C3004
MAR. 1999 Ver 1.01
3
3. PIN ASSIGNMENT
R07
R06 / LCDCK
R05
R04
R03 / EC1
R02 / INT2
R01 / INT1
R00 / INT0
R17 / CMP3 / KS7
R16 / CMP2 / KS6
R15 / CMP1 / KS5
R14 / CMP0 / KS4
R13 / BUZ / KS3
R12 / KS2
R11 / KS1
R10 / KS0
SEG14 / R56
SEG15 / R57
SEG16 / R60
SEG17 / R61
SEG18 / R62
SEG19 / R63
SEG20 / R64
SEG21 / R65
SEG22 / R66
SEG23 / R67
SEG24 / R70
SEG25 / R71
SEG26 / R72
SEG27 / R73
SEG28 / R74
SEG29 / R75
S
E
G
30 /
R
7
6
S
E
G
31 /
R
7
7
SE
G
3
2
SE
G
3
3
SE
G
3
4
SE
G
3
5
SE
G
3
6
SE
G
3
7
SE
G
3
8
SE
G
3
9
VSS
CO
M
0
CO
M
1
CO
M
2
CO
M
3
CO
M
4
CO
M
5
CO
M
6
CO
M
7
VC
L
1
VC
L
2
VC
L
3
VC
L
4
VC
L
5
SEG
1
3
/
R
5
5
SEG
1
2
/
R
5
4
SEG
1
1
/
R
5
3
SEG
1
0
/
R
5
2
SEG
9
/
R
5
1
SEG
8
/
R
5
0
SEG
7
/
R
4
7
SEG
6
/
R
4
6
SEG
5
/
R
4
5
SEG
4
/
R
4
4
SEG
3
/
R
4
3
SEG
2
/
R
4
2
SEG
1
/
R
4
1
SEG
0
/
R
4
0
SXI
N
SXO
U
T
XI
N
XO
U
T
VD
D
TE
S
T
R
ESE
T
R2
2
R2
1
R2
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
GMS81C3004
background image
GMS81C3004
4
MAR. 1999 Ver 1.01
4. PACKAGE DIAGRAM
Figure 4-1 Package Diagram
20.10
19.90
24.15
23.65
18.1
5
17.6
5
14.1
0
13.9
0
3.10 max.
0.45
0.30
0.8 BSC
SEE DETAIL "A"
1.03
0.73
0-7
°
0.36
0.10
0.23
0.13
1.95
REF
DETAIL "A"
UNIT: mm
background image
GMS81C3004
MAR. 1999 Ver 1.01
5
5. PIN FUNCTION
V
DD
: Supply voltage.
V
SS
: Circuit ground.
TEST: Used for shipping inspection of the IC. For normal
operation, it should be connected to V
SS
.
RESET: Reset the MCU.
X
IN
: Input to the inverting oscillator amplifier and input to
the internal main clock operating circuit.
X
OUT
: Output from the inverting oscillator amplifier.
SX
IN
: Input to the internal sub system clock operating cir-
cuit.
SX
OUT
: Output from the inverting subsystem oscillator
amplifier.
R00~R07: R0 is an 8-bit CMOS bidirectional 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 follow-
ing special features.
R10~R17: R1 is an 8-bit CMOS bidirectional I/O port. R1
pins 1 or 0 written to the Port Direction Register can be
used as outputs or inputs.
In addition, R1 serves the functions of the various follow-
ing special features.
R20~R22: R2 is a 3-bit CMOS bidirectional I/O port. Each
pins 1 or 0 written to the their Port Direction Register can
be used as outputs or inputs.
R40~R47, R50~57, R60~R67, R70~R77:
R4, R5, R6, R7 are four 8-bit CMOS bidirectional I/O port.
Each pins 1 or 0 written to the their Port Direction Register
can be used as outputs or inputs.
Ports is multiplexed with SEG0~SEG31 respectively.
After the reset of the MCU, port is initialized as a segment
output port.
SEG0~SEG39: Segment signal output pins for the LCD
display. See "15. LCD DRIVER" on page 55 for details.
COM0~COM7: Common signal output pins for the LCD
display. See "15. LCD DRIVER" on page 55 for details.
V
CL1
~V
CL5
: Power supply pins for the LCD driver. Since
the LCD driving resistors are provided internally, no lines
should be connected to these pins. The voltage on each pin
is V
DD
>
V
CL1
>
V
CL2
>
V
CL3
>
V
CL4
>
V
CL5
>
V
SS
. For de-
tails, Refer to Section "15.".
Port pin
Alternate function
R00
R01
R02
R03
R06
INT0 (External interrupt 0)
INT1 (External interrupt 1)
INT2 (External interrupt 2)
Event counter input
LCD clock output
Port pin
Alternate function
R10
R11
R12
R13
R14
R15
R16
R17
KS0 (Key scan input 0)
KS1 (Key scan input 1)
KS2 (Key scan input 2)
BUZ / KS3 (Buzzer output or Key scan input
3)
CMP0 / KS4 (Comparator input or Key scan
input 4)
CMP1 / KS5 (Comparator input or Key scan
input 5)
CMP2 / KS6 (Comparator input or Key scan
input 6)
CMP3 / KS7 (Comparator input or Key scan
input 7)
Port pin
Alternate function
SEG0~SEG7
R40~R47
SEG8~SEG15
R50~R57
SEG16~SEG23
R60~R67
SEG24~SEG31
R70~R77
background image
GMS81C3004
6
MAR. 1999 Ver 1.01
PIN NAME
Pin No.
In/Out
Function
V
DD
46
-
Supply voltage
V
SS
11
-
Circuit ground
TEST
45
I
For test purposes. Should connect it to GND for normal operation.
RESET
44
I
Reset signal input
VCL1~VCL5
20~24
-
LCD power supply
X
IN
48
I
Main oscillation input
X
OUT
47
O
Main oscillation output
SX
IN
50
I
Sub oscillation input
SX
OUT
49
O
Sub oscillation output
R00 (INT0)
33
I/O (Input)
8-bit general I/O ports
External interrupt 0 input
R01 (INT1)
34
I/O (Input)
External interrupt 1 input
R02 (INT2)
35
I/O (Input)
External interrupt 2 input
R03 (EC1)
36
I/O (Input)
External counter input
R04
37
I/O
-
R05
38
I/O
-
R06 (LCDCK)
39
I/O (Output)
LCD clock output
R07
40
I/O
-
R10 (KS0)
25
I/O (Input)
8-bit general I/O ports
R11 (KS1)
26
I/O (Input)
Key scan input
R12 (KS2)
27
I/O (Input)
R13 (BUZ/KS3)
28
I/O (Output/Input)
Buzzer output or key scan input
R14~R17
(CMP0~CMP3/
KS4~KS7)
29~32
I/O
(Input/Input)
Comparator input 0~3 or key scan
input 4~7
R20~R22
41,42,
43
I/O
3-bit general I/O ports
-
SEG0~SEG7
(R40~R47)
51~58
Output (I/O)
Segment signal output ports
8-bit general I/O ports
SEG8~SEG15
(R50~R57)
59~66
Output (I/O)
8-bit general I/O ports
SEG16~SEG23
(R60~R67)
67~74
Output (I/O)
8-bit general I/O ports
SEG24~SEG31
(R70~R77)
1,2,
75~80
Output (I/O)
8-bit general I/O ports
SEG32~SEG39
3~10
O
Segment signal output ports
COM0~COM7
12~19
O
Common signal output ports
Table 5-1 Port Function Description
background image
GMS81C3004
MAR. 1999 Ver 1.01
7
6. PORT STRUCTURES
R00~R03 / INT0~INT2, EC1
R04, R05, R07, R20~R23
R06/LCDCK
R10~R12 / KS0~KS2
R13 / BUZ, KS3
Pin
Data Reg.
Dir. Reg.
Noise
Canceler
INT
DB
DB
DB
Pull up
DB
Reg.
MU X
RD
V
DD
V
SS
Pull-up Tr.
EC1
Pin
Data Reg.
Dir. Reg.
DB
DB
DB
Pull up
DB
Reg.
M U X
RD
V
DD
V
SS
Pull-up Tr.
Pin
D a ta R eg .
Dir. Reg.
DB
DB
DB
Pull up
DB
Reg.
MUX
MU X
LCDCK
RD
LCR[2]
V
DD
V
SS
Pull-up Tr.
Pin
Data Reg.
Dir. Reg.
DB
DB
DB
Pull up
DB
Reg.
MU X
RD
V
DD
V
SS
Pull-up Tr.
Key Scan
Key Scan
Enable
Pin
D a ta R eg .
Dir. Reg.
DB
DB
DB
Pull up
DB
Reg.
MUX
MU X
BUZZER
RD
Buzzer Enable
V
DD
V
SS
Pull-up Tr.
Key Scan
Key Scan
Enable
background image
GMS81C3004
8
MAR. 1999 Ver 1.01
R14~R17 / CIN0~CIN3, KS4~KS7
SEG0~SEG31 / R4, R5, R6, R7
SEG32 ~ SEG39
COM0 ~ COM7
VCL1 ~ VCL5
Pin
Data Reg.
Dir. Reg.
DB
DB
DB
Pull up
DB
Reg.
MU X
Comparator
Channel
Selection
RD
V
DD
V
SS
Pull-up Tr.
Key Scan
Key Scan
Enable
Pin
Data Reg.
Dir. Reg.
DB
DB
DB
M U X
RD
LCV
DD
Port / SEG
Selection Reg.
LCD
Data Reg.
DB
DB
LCV
SS
V
DD
V
SS
LCD
Control
SEGn Pin
LCD Control
DB
LCD
Data Reg.
LCV
DD
LCV
SS
LCD Control
n=32 to 39
COMn Pin
LCD Control
LCV
DD
LCV
SS
Frame Counter
n=0 to 7
VCL1
VCL2
VCL3
VCL4
VCL5
LCDEN
LCR.5
LCDEN
LCR.4
background image
GMS81C3004
MAR. 1999 Ver 1.01
9
X
IN
, X
OUT
( Crystal or Ceramic resonator Option)
X
IN
, X
OUT
(RC Option)
SX
IN
, SX
OUT
RESET
TEST
STOP
XOUT
XIN
V
DD
V
SS
V
DD
V
SS
V
DD
Main frequency
clock
XOUT
XIN
V
DD
V
SS
V
DD
V
SS
V
DD
STOP
Main frequency
clock
RC
Oscillator
SX
IN
SX
OUT
V
SS
V
DD
V
SS
V
DD
V
DD
V
SS
Noise
Canceler
Sub frequency
clock
RESET
V
DD
V
SS
Noise
Canceler
TEST
V
DD
V
SS
Noise
Canceler
background image
GMS81C3004
10
MAR. 1999 Ver 1.01
7. ELECTRICAL CHARACTERISTICS
7.1 Absolute Maximum Ratings
Supply voltage ........................................... -0.3 to +6.0 V
Storage Temperature ................................-40 to +125
°
C
Voltage on any pin with respect to Ground (V
SS
)
............................................................... -0.3 to V
DD
+0.3
Maximum current out of V
SS
pin ........................100 mA
Maximum current into V
DD
pin ............................80 mA
Maximum current sunk by (I
OL
per I/O Pin) ........20 mA
Maximum output current sourced by (I
OH
per I/O Pin)
.................................................................................8 mA
Maximum current (
Σ
I
OL
) ...................................... 80 mA
Maximum current (
Σ
I
OH
)...................................... 50 mA
Note: Stresses above those listed under "Absolute Maxi-
mum Ratings" may cause permanent damage to the de-
vice. This is a stress rating only and functional operation of
the device at any other conditions above those indicated in
the operational sections of this specification is not implied.
Exposure to absolute maximum rating conditions for ex-
tended periods may affect device reliability.
7.2 Recommended Operating Conditions
7.3 DC Electrical Characteristics
(T
A
=-20~85
°
C, V
DD
=2.2~5.5V)
,
Paramet