PRELIMINARY
GMS81C4040/87C4060
Nov. 1999 Ver 1.0
PRELIMINARY
1
Table of Contents
OVERVIEW.......................................... 1
Description...................................................1
Features .......................................................1
Development Tools..................................... 2
BLOCK DIAGRAM.............................. 3
PIN ASSIGNMENT.............................. 4
PACKAGE DIAGRAM .........................5
PIN FUNCTION ....................................6
PORT STRUCTURES ..........................9
RESET................................................................ 9
TEST................................................................... 9
XIN, XOUT ........................................................9
OSC1, OSC2 ..................................................... 9
R00~07, R53 ...................................................... 9
R10~15 (AN0~5) ................................................ 9
R16, 17, 20, 24, 25, 26, 27, 52, 67 ................... 10
R21/Sclk, R22/Sout .......................................... 10
R23/Sin ............................................................ 10
R40~43 (PWM0~3) .......................................... 10
R44, 45, 46, 47 (SCL, SDA, PWM) ..................10
R50/BUZZ, R51/PWM8 ........ ......... ................. ..11
R54/YM, R55/YS, R56/I ...................................11
R, G, B ............................................................. 11
ELECTRICAL CHARACTERISTICS . 12
Absolute Maximum Ratings .....................12
Recommended Operating Conditions ....12
DC Electr i cal Characteristics - GM S81C404 0
.....................................................................12
A/D Comparator Characteristics .............14
AC Characteristics ....................................14
Typical Characteristics ............................16
MEMORY ORGANIZATION .............. 17
Registers ...................................................17
Program Memory ........ ............... .............. .20
PCALL→ rel ..................................................... 21
TCALL→ n ....................................................... 21
Data Memory ........ ............... .............. ........23
User Memory .................................................... 23
Control Registe rs ........................................... ..23
Stack Area ........................................................23
Addressing Mode ......................................25
(1) Register Addressing ...................................25
(2) Immediate Addressing → #imm .................. 25
(3) Direct Page Addressing → dp ....... .............. 25
(4) Absolute Addressing → !abs ....................... 25
(5) Indexed Addressing .................................... 26
X indexed direct page (no offset) → {X} ...........26
X indexed direct page, auto increment→ {X}+ . 26
X indexed direct page (8 bit offset) → dp+X .....26
Y indexed direct page (8 bit offset) → dp+Y .....27
Y indexed absolute → !abs+Y ..........................27
Direct page indirect → [dp] ...............................27
X indexed indirect → [dp+X] ............................. 27
Y indexed indirect → [dp]+Y ............................. 28
Absolute indirect → [!abs] ................................28
I/O PORTS ......................................... 29
Registers for Port .............. .............. .........29
Port Data Registers ..........................................29
I/O Ports Configuration ............................3 0
R0 Ports ...........................................................30
R1 Ports ...........................................................30
R2 Port .............................................................31
R4 Port .............................................................31
R5 Port .............................................................32
R6 Port .............................................................32
CLOCK GENERATOR ...................... 33
TIMER ................................................ 34
Basic Interval Timer .................................34
Timer 0, 1 ................. .............. ............... .....35
Timer / Event Counter 2, 3 ....... ............... .37
Timer Mode ...................................................... 39
Event counter Mode ......................................... 39
A/D Converter ................................... 42
Control ..............................................................42
Serial I/O ........................................... 44
Control ..............................................................44
Pulse Width Modulation (PWM) ...... 46
8bit PWM Control ............................................. 47
14bit PWM Control ........................................... 47
Interrupt interval measurement circuit
........................................................... 49
Control ..............................................................49
Buzzer driver .................................... 51
Control ..............................................................51
On Screen Display (OSD) ................ 53
OSDCON1 ....................................................... 55
OSDCON2 ....................................................... 55
OSDPOL .......................................................... 56
FDWSET .......................................................... 56
L1ATTR ............................................................ 57
L1VPOS ........................................................... 58
L2ATTR ............................................................ 58
L2VPOS ........................................................... 58
COLMOD ......................................................... 58
MESHCON ....................................................... 58
VRAM ...............................................................58
Font ROM .........................................................60