EMC EM78862B

EM78862B
8-Bit RISC Type
Microprocessor
Product
Specification
VERSION 1.1
ELAN MICROELECTRONICS CORP.
March 2005
Specification Revision Chronology
Version
Revision Description
Date
1.0
Initial version
Aug. 02, 2004
1.1
Revised operting temp to –40°C ~ 85°C
Mar. 01, 2005
Trademark Acknowledgments
IBM is a registered trademark and PS/2 is a trademark of IBM.
Microsoft, MS, MS-DOS, and Windows are registered trademarks of Microsoft Corporation.
© 2003 ELAN Microelectronics Corporation
All Rights Reserved
Printed in Taiwan, ROC, Mar-01-2005 (Version 1.1)
The contents of in this specification are subject to change without notice. ELAN Microelectronics assumes no
responsibility for errors that may appear in this specification. ELAN Microelectronics makes no commitment to update,
or to keep current, the information contained in this specification. The software (if any) described in this specification is
furnished under a license or nondisclosure agreement, and may be used or copied only in accordance with the terms of the
agreement.
ELAN Microelectronics products are not intended for use in life support appliances, devices, or systems. Use of ELAN
Microelectronics product in such applications is not supported and is prohibited.
NO PART OF THIS SPECIFICATION MAY BE REPRODUCED OR TRANSMITTED IN ANY FORM OR BY ANY
MEANS WITHOUT THE EXPRESS WRITTEN PERMISSION OF ELAN MICROELECTRONICS.
ELAN MICROELECTRONICS CORPORATION
ii
Headquarters:
Hong Kong:
USA:
No. 12, Innovation Road 1
Science-based Industrial Park
Hsinchu, Taiwan, R.O.C. 30077
Tel: +886 3 563-9977
Fax: +886 3 563-9966
http://www.emc.com.tw
Elan (HK) Microelectronics
Corporation, Ltd.
Elan Information Technology
Group
Rm. 1005B, 10/F Empire Centre
68 Mody Road, Tsimshatsui
Kowloon , HONG KONG
Tel: +852 2723-3376
Fax: +852 2723-7780
http://www.elanhk.com.hk
10062 Miller Ave., Suite 100
Cupertino, CA 95014
USA
Tel: +1 048 366-8223
Fax: +1 048 366-8220
Europe:
Shenzhen:
Shanghai:
Elan Microelectronics Corp.
(Europe)
Elan (Shenzhen) Microelectronics Elan Electronics (Shanghai)
Corporation, Ltd.
Corporation, Ltd.
Siewerdtstrasse 105
8050 Zurich, SWITZERLAND
Tel: +41 43 299-4060
Fax: +41 43 299-4079
http://www.elan-europe.com
Rm. 420/4Fl., Fuxing Garden
Fuxing Rd, Futian Dist., Shenzhen
Guandong, CHINA 518031
Tel: +86 755 2601-0565
Fax: +86 755 2601-0500
23/Bldg. 115, Lane 572, Bibo Road
Zhangliang Hi-Tech Park
Shanghai, CHINA
Tel: +86 021 5080-3866
Fax: +86 021 5080-4600
EM78862B Specification
Contents
1
General Description................................................................................................ 1
2
Features ................................................................................................................... 1
2.1
CPU............................................................................................................................. 1
2.2
LCD............................................................................................................................. 2
3
Applications ............................................................................................................ 2
4
Pin Configurations.................................................................................................. 2
4.1
Pin Description.......................................................................................................... 3
5
Functional Block Diagram ..................................................................................... 4
6
Functional Descriptions......................................................................................... 5
6.1
Operational Registers............................................................................................... 5
6.1.1
6.1.2
6.1.3
6.1.4
6.1.5
6.1.6
6.1.7
6.1.8
6.1.9
6.1.10
6.1.11
6.1.12
6.1.13
6.1.14
6.1.15
6.1.16
6.1.17
6.2
R0 (Indirect Address Register) ................................................................................... 5
R1 (TCC).................................................................................................................... 5
R2 (Program Counter) ................................................................................................ 5
R3 (Status Register) ................................................................................................... 6
R4 (Register Bank Select Register)............................................................................ 7
R5 (Program Page Select Register) ........................................................................... 7
R6 (Port 6).................................................................................................................. 7
R7 (Port 7).................................................................................................................. 7
R8 (Port 8).................................................................................................................. 8
R9 (Port 9).................................................................................................................. 8
RA (Mode Control Register) ....................................................................................... 8
RB (Reserved)............................................................................................................ 9
RC (2K RAM Address)................................................................................................ 9
RD (2K RAM Data) ..................................................................................................... 9
RE (LCD Driver, WDT Control) ................................................................................... 9
RF (Interrupt Status Register)....................................................................................11
R10 ~ R1F and R20 ~ R3F (General Purpose Register) ...........................................11
Special Purpose Registers..................................................................................... 11
6.2.1
6.2.2
6.2.3
6.2.4
6.2.5
6.2.6
6.2.7
A (Accumulator, ACC)................................................................................................11
CONT (Control Register) ...........................................................................................11
IOC5 (Port 5 I/O Control Register)............................................................................ 12
IOC6 (Port 6 I/O Control Register)............................................................................ 12
IOC7 (Port 7 I/O Control Register)............................................................................ 13
IOC8 (Port 8 I/O Control Register)............................................................................ 13
IOC9 (Port 9 I/O Control Register)............................................................................ 13
EM78862B Specification
iii
6.2.8
6.2.9
6.2.10
6.2.11
6.2.12
6.2.13
IOCA (2K RAM Bank, Port 8 I/O, Page Control Register, R/W,
Default "00000000") ................................................................................................. 13
IOCB (LCD Address, Counter 1 Preset Register) ..................................................... 14
6.2.9.1 Page 0 (LCD Address)................................................................................. 14
6.2.9.2 Page 1 (Counter 1 Preset Register)............................................................. 15
IOCC (LCD Data, Counter 2).................................................................................... 15
6.2.10.1 Page 0 (LCD Data) .................................................................................... 15
6.2.10.2 Page 1 (Counter 2) .................................................................................... 15
IOCD (Pull-High Control Register, R-Option Register).............................................. 15
6.2.11.1 Page 0 (Pull-High Control Register)........................................................... 15
6.2.11.2 Page 1 (R-Option Control Register) ........................................................... 15
IOCE (Port9 GPIO/LCD Segment, Port6 GPIO/LCD Com,
LCD Bias Scan Key Signal, Port7 Open Drain, Counter 1/2 Clock Source,
Counter1 Pre-Scaler Control Register)..................................................................... 16
6.2.12.1 Page 0 (Port9 GPIO/LCD Segment, Port6 GPIO/LCD Com,
LCD Bias, Scan Key Signal Control Register............................................ 16
6.2.12.2 Page 1 (Port 7 Open Drain, Counter 1/2 Clock Source,
Counter 1 Pre-Scaler ................................................................................. 18
IOCF (Interrupt Mask Register) ................................................................................ 18
6.3
TCC/WDT Pre-Scaler............................................................................................... 19
6.4
I/O Ports ................................................................................................................... 20
6.5
RESET and Wake-Up .............................................................................................. 20
6.6
Oscillator.................................................................................................................. 22
6.7
Interrupt ................................................................................................................... 22
6.8
LCD Driver ............................................................................................................... 23
6.8.1
6.8.2
6.8.3
6.8.4
6.9
LCD Driver Control ................................................................................................... 24
6.8.1.1 LCD Driver, WDT Control (RE) .................................................................. 24
LCD Display Area ..................................................................................................... 25
6.8.2.1 IOCB (LCD RAM Display Address)............................................................ 25
6.8.2.2 IOCC (LCD RAM Display Data) ................................................................. 25
LCD COM and SEG Signal ...................................................................................... 26
LCD Bias Control...................................................................................................... 27
6.8.4.1 IOCE (Bias Control Register)..................................................................... 27
Code Options........................................................................................................... 28
6.10 Instruction Set ......................................................................................................... 28
7
Absolute Maximum Ratings ................................................................................ 30
8
DC Electrical Characteristics .............................................................................. 31
9
AC Electrical Characteristics .............................................................................. 32
10 Timing Diagram..................................................................................................... 33
11 Application Circuit................................................................................................ 34
11.1 Application with Crystal Mode ............................................................................... 34
11.2 Application with RC Mode...................................................................................... 35
iv
EM78862B Specification
EM78862B
8-Bit RISC Type Microprocessor
1
General Description
The EM78862B is an 8-bit RISC type microprocessor with low power, high speed CMOS
technology. Integrated into the single chip are on chip watchdog (WDT), RAM, ROM,
programmable real-time clock/counter, internal interrupt, power-down mode, LCD driver, and
tri-state I/O. The EM78862B provides a single chip solution for designing DATA-BANK of
message display.
The following table shows how EM78862B compares with other MCU’s of the same series.
Item
2
EM78862
EM78862B
EM78869
ROM size
16K X 13 bit
16K X 13 bit
8K X 13 bit
RAM size
2.2K X 8 bit
2.2K X 8 bit
0.7K X 8 bit
LCD
60 X 9
60 X 9
40 X 9
LCD RAM
Write only when LCD is enabled. Read/Write when disabled.
Oscillator
Crystal
Crystal/RC
Crystal/RC
Code option
MCLK
MCLK/OSCSEL
MCLK/ELCD/OSCSEL
Pins number
84
84
64
OTP
EM78P862A
EM78P862A
EM78P862A
Features
2.1 CPU
„ Operating voltage range: 2.2V ~ 5.5V
„ 16K X 13 on chip ROM
„ 2.2K X 8 on chip RAM
„ Up to 29 bi-directional and tri-state I/O ports
„ 8 level stack for subroutine nesting
„ 8-bit real time clock/counter (TCC)
„ Two sets of 8 bit counters can be interrupt sources
„ Programmable free running on chip watchdog timer
„ Four modes (internal PLL clock 3.579MHz)
• SLEEP Mode: CPU and 3.579MHz clock turn off, 32.768KHz clock turn off
• IDLE Mode:
CPU and 3.579MHz clock turn off, 32.768KHz clock turn on
• GREEN Mode: 3.579MHz clock turn off, CPU and 32.768KHz clock turn on
• NORMAL Mode: 3.579MHz clock turn on, CPU and 32.768KHz clock turn on
„ Input port wake up function
„ Seven interrupt sources; 4 external, 3 internal
„ 84-pin chip (EM78862BH)
„ Port key scan function
„ Clock frequency 32.768KHz or RC mode
„ Eight R-option pins
This specification is subject to change without further notice.
Mar.01.2005 (V1.1) 1 of 36
EM78862B
8-Bit RISC Type Microprocessor
2.2 LCD
„ Software selectable LCD operation voltage
„
„
„
„
3
Common driver pins: 9
Segment driver pins: 60
1/4 bias
1/8, 1/9 duty
Applications
„ Data Bank
„ Message display box
„ Scientific calculator
87
86
85
84
83
82
81
S EG 47/P 83
88
S EG 48/P 84
89
S EG 51/P 87
S EG 50/P 86
90
S EG 55/P 93
S EG 54/P 92
91
S EG 49/P 85
92
S EG 52/P 90
93
S EG 56/P 94
94
S EG 58/P 96
S EG 57/P 95
95
S EG 53/P 91
96
P 72/IN T 2
P 71/IN T 1
P 76
P 75
97
S EG 59/P 97
10
98
P 70/IN T 0
OSCI
99
P 73/IN T 3
3
P 74
PLLC
P 77
Pin Configurations
R ES ET
4
80
79
78
77
SEG46/P82
76
SEG45/P81
75
SEG44/P80
OSCO
11
74
SEG43/P57
VDD
12
73
SEG42/P56
COM7
13
72
SEG41/P55
COM6
14
71
SEG40/P54
63
P60/COM8
62
TEST
61
GND
60
SEG39
59
SEG38
58
SEG37
57
SEG36
56
SEG35
55
SEG34
54
SEG33
53
SEG32
52
SEG31
51
SEG30
COM5
15
COM4
16
COM3
17
COM2
18
COM1
EM78862B
19
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
S EG 29
S EG 28
30
S EG 27
29
S EG 26
28
S EG 25
27
S EG 24
SEG6
S EG 23
S EG 22
26
S EG 21
SEG5
S EG 20
25
S EG 19
SEG4
S EG 18
24
S EG 17
SEG3
S EG 16
S EG 15
23
S EG 14
SEG2
S EG 13
22
S EG 12
SEG1
S EG 11
S EG 10
21
S EG 9
SEG0
S EG 8
20
S EG 7
COM0
50
Fig. 1 EM78862B Pin Configuration for Dice Form
2 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
4.1
Pin Description
Pin Name
Pin #
I/O Type
VDD
12
Power
Digital power and analog power
GND
61
Power
Digital and analog ground
OSCI
10
I
Input pin for 32.768 KHz oscillator or
installing a resistor for RC mode
OSCO
11
O
Output pin for 32.768 KHzoscillator
COM0 ~ COM7, COM8 20 ~ 13, 63
O
Common driver pins of LCD driver
SEG0 ~ SEG39
21 ~ 60
O
Segment driver pins of LCD driver
SEG40 ~ SEG59
71 ~90
O
Segment driver pins of LCD driver
3
I
Phase loop lock capacitor. Connect a capacitor
0.01u to 0.047u with GND
INT0 ~ INT3
91 ~ 94
I
PORT 7 (0) ~ PORT 7 (3) Interrupt Signals
( FALLING EDGE )
P5.4 ~ P5.7
71 ~ 74
I/O
63
I/O
91 ~ 98
I/O
PLLC
P6.0
Description
PORT 5 (INPUT or OUTPUT port per bit).
Shared with LCD segment signals
PORT 6 (INPUT or OUTPUT port per bit).
Shared with LCD common signals
PORT 7 (INPUT or OUTPUT port per bit).
P7.0 ~ P7.7
Internal Pull high function
Key scans function
PORT 8 (INPUT or OUTPUT port per bit)
P8.0 ~ P8.7
75 ~ 82
I/O
P9.0 ~ P9.7
83 ~ 90
I/O
PORT 9 (INPUT or OUTPUT port per bit)
“And” can be set as wake-up watchdog timer
TEST
62
I
Test pin during test mode only. Normally low
RESET
99
I
System reset pin ( LOW ACTIVE )
Shared with LCD segment signals
“And” is shared with Segment signal
This specification is subject to change without further notice.
Mar.01.2005 (V1.1) 3 of 36
EM78862B
8-Bit RISC Type Microprocessor
5
Functional Block Diagram
RAM
RAM
CPU
CPU
LCD
LCD DRIVER
LCD DRIVER
TIMING CONTROL
TIMING CONTROL
TIMER
TIMER
IO PORT
IO PORT
I/O
PLL
PLL
ROM
ROM
Fig. 2a System Overview Block Diagram
Xin Xout RC
Prescaler
R1(TCC)
Control Sleep
& Wake-up
on I/O Port
Stack
R2
ROM
WDT Timer
Oscillato
Timing rControl
General
RAM
Interruption
Control
Instruction
Register
ALU
R3
R5
Instruction
Decoder
R4
ACC
Data & Control Bus
RAM
PORT5
IOC5
R5
P54~P57
PORT6
IOC6
R6
P60
PORT7
IOC7
R7
P70~P77
PORT8
IOC8
R8
P80~P87
PORT9
IOC9
R9
P90~P97
Fig. 2b System Functional Block Diagram
4 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
6
Functional Descriptions
6.1
Operational Registers
6.1.1 R0 (Indirect Address Register)
R0 is not a physically implemented register. It is useful as indirect addressing pointer. Any
instruction using R0 as register actually accesses data pointed by the RAM Select Register
(R4).
6.1.2 R1 (TCC)
„ Increased by an external signal(16.384KHz or RC/2) , or by the instruction cycle clock.
„ Written and read by the program as any other register.
6.1.3 R2 (Program Counter)
The structure is depicted in Fig. 3 below.
„ Generates 16K × 13 on-chip ROM addresses to the relative programming instruction
codes.
„ "JMP" instruction allows the direct loading of the low 10 program counter bits.
„ "CALL" instruction loads the low 10 bits of the PC and PC+1, then push into the STACK
(14 bits).
„ "RET'' ("RETL k,” "RETI") instruction loads the program counter with the contents at the
top of stack.
„ "MOV R2, A" allows the loading of an address from the A register to the PC, and the 9th
and 10th bits are cleared to "0''.
„ "ADD R2, A" allows a relative address be added to the current PC, and contents of the
ninth and tenth bits are cleared to "0''.
„ "TBL" allows a relative address to be added into the current PC, and its 9th and 10th bits
content do not change. The most significant bit (A10~A13) will be loaded into the status
register (R5) with the contents of bits PS0~PS3 upon execution of a "JMP,'' "CALL,"
“MOV R2, A,'' "ADD R2, A,'' or ”TBL” instruction.
Fig. 3 Program Counter Organization
This specification is subject to change without further notice.
Mar.01.2005 (V1.1) 5 of 36
EM78862B
8-Bit RISC Type Microprocessor
Fig. 4 Data Memory Configuration
6.1.4 R3 (Status Register)
Bit 7
–
Bit 6
PAGE
Bit 5
0
Bit 4
T
Bit 3
P
Bit 2
Z
Bit 1
DC
Bit 0
C
Bit 0: (C) Carry flag
Bit 1: (DC) Auxiliary carry flag
Bit 2: (Z) Zero flag
Bit 3: (P) Power down bit. Set to 1 during power on or by a "WDTC" command and reset to 0
by a "SLEP" command.
Bit 4: (T) Time-out bit. Set to 1 by the "SLEP" and "WDTC" command or during power up; and
reset to 0 by WDT timeout.
Event
T
P
Remark
WDT wake-up from sleep mode
WDT time out (not sleep mode)
RESET wake up from sleep
Power up
Low pulse on RESET pin
0
0
1
1
X
0
1
0
1
X
Low active
X =Don't care
Bit 5: Unused, fixed at “0”
Bit 6: (PAGE) Change IOCB ~ IOCE to another page, 0/1 => page0 / page1
Bit 7: Unused
6 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
6.1.5 R4 (Register Bank Select Register)
Bit 7
RBK1
Bit 6
RBK0
Bit 5
FSR5
Bit 4
FSR4
Bit 3
FSR3
Bit 2
FSR2
Bit 1
FSR1
Bit 0
FSR0
Bits 0 ~ 5: Used to select up to 32 registers in indirect address mode of each bank
Bits 6 ~ 7: Determine which bank is activated among the 4 banks
Refer to Fig. 4; Data Memory Configuration (previous page) for configuration of the data
memory
6.1.6 R5 (Program Page Select Register)
Bit 7
R57
Bit 0 ~ 3:
Bit 6
R56
Bit 5
R55
Bit 4
R54
Bit 3
PS3
Bit 2
PS2
Bit 1
PS1
Bit 0
PS0
(PS0 ~ PS3) Page select bits as shown below:
PS3
PS2
PS1
PS0
Program Memory Page (Address)
0
0
0
0
Page 0
0
0
0
1
Page 1
0
0
1
0
Page 2
::
::
1
1
1
0
Page 14
1
1
1
1
Page 15
You can use PAGE instruction to change and maintain program page. Otherwise,
use far jump (FJMP) or far call (FCALL) MACRO instructions to program user's
code. ÉLAN’s complier supports program page maintenance and can change
your program by inserting instructions within its program.
Bit 4 ~ 7:
4-bit I/O registers of Port 5
6.1.7 R6 (Port 6)
Bit 7
-
Bit 6
-
Bit 5
-
Bit 4
-
Bit 3
-
Bit 0:
(R60) Port 6, single bit (Bit 0) I/O register
Bit 1 ~ 7:
Unused
Bit 2
-
Bit 1
-
Bit 0
R60
Bit 2
R72
Bit 1
R71
Bit 0
R70
6.1.8 R7 (Port 7)
Bit 7
R77
Bit 0 ~ 7:
Bit 6
R76
Bit 5
R75
Bit 4
R74
Bit 3
R73
Port 7 8-bit I/O registers
This specification is subject to change without further notice.
Mar.01.2005 (V1.1) 7 of 36
EM78862B
8-Bit RISC Type Microprocessor
6.1.9 R8 (Port 8)
Bit 7
R87
Bit 6
R86
Bit 5
R85
Bit 4
R84
Bit 3
R83
Bit 2
R82
Bit 1
R81
Bit 0
R80
Bit 4
R94
Bit 3
R93
Bit 2
R92
Bit 1
R91
Bit 0
R90
Bit 3
0
Bit 2
-
Bit 1
-
Bit 0
-
Bit 0 ~ 7: Port 8 8-bit I/O registers
6.1.10 R9 (Port 9)
Bit 7
R97
Bit 6
R96
Bit 5
R95
Bit 0 ~ 7: Port 9 8-bit I/O registers
6.1.11 RA (Mode Control Register)
Bit 7
IDLE
Bit 6
PLLEN
Bit 5
0
Bit 4
1
Bit 0 ~ 2: Unused
Bit 3:
Reserved. Clear this bit to ‘0.’
Bit 4:
Reserved. Always ‘1.’
Bit 5:
Reserved. Clear this bit to '0'.
Bit 6:
(Read/Write) PLL enable signal
0: Disable PLL
1: Enable PLL
The relation between 32.768K and 3.579M (X’TAL) is explained in Fig. 5 below.
Fig. 5 The Relation between 32.768KHz and 3.579MHz
Bit 7:
(IDLE) Sleep mode selection bit. This bit defines which SLEP instruction is to be
executed.
0: Sleep mode
1: Idle mode
When Sleep mode is defined, program is re-activated by Watch Dog time-out or
Port 9 signal input and resume running from the “Start vector” (0H).
When Idle mode is defined, program is re-activated by TCC clock or Watch Dog
time-out, or by Port 9, 7.0 ~ 7.3 signal input. Program will continue running from the
instruction that follows the “SLEP” instruction.
8 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
Wakeup Signal
SLEEP Mode
RA(7,6)=(0,0)
+ SLEP
TCC Time-Out
X
WDT Time-Out
RESET
Port 9
RESET
Port 7.0 ~ 7.3
X
IDLE Mode
RA(7,6)=(1,0)
+ SLEP
Wake-up
+ Interrupt
+ Next instruction
Wake-up
+ Next instruction
Wake-up
+ Next instruction
Wake-up
+ Interrupt
+ Next instruction
GREEN Mode
RA(7,6)=(x,0)
no SLEP
NORMAL Mode
RA(7,6)=(x,1)
no SLEP
Interrupt
Interrupt
RESET
RESET
X
X
Interrupt
Interrupt
NOTES: P7.0 ~ P7.3 wake-up function is controlled by IOCF (1, 2, 3, 7) and ENI instruction.
P7.0 wakeup signal is a RISING or FALLING signal defined by CONT register Bit 7.
Port 9, Port 7.1, Port 7.2, and Port 7.3 wake-up signals are a FALLING EDGE signal.
X=Don’t care
6.1.12 RB (Reserved)
Bit 7
1
Bit 6
1
Bit 5
1
Bit 4
1
Bit 3
1
Bit 2
1
Bit 1
1
Bit 0
1
Bit 0 ~ 7: Reserved. Set Bit 7 to Bit 0 to ‘1’
6.1.13 RC (2K RAM Address)
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
RAM_A7 RAM_A6 RAM_A5 RAM_A4 RAM_A3 RAM_A2 RAM_A1 RAM_A0
Bit 0 ~ 7: Select data bank RAM address of up to 256. IOCA is the register for bank selection.
6.1.14 RD (2K RAM Data)
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
RAM_D7 RAM_D6 RAM_D5 RAM_D4 RAM_D3 RAM_D2 RAM_D1 RAM_D0
Bit 0 ~ 7: 2K bytes RAM data transfer register
NOTE
Refer to Section 6.2.8; IOCA Register on how to select RAM bank.
6.1.15 RE (LCD Driver, WDT Control)
Bit 7
0
Bit 0:
Bit 6
WDTE
Bit 5
WUP9H
Bit 4
WUP9L
Bit 3
0
Bit 2
LCD_C2
Bit 1
LCD_C1
Bit 0
LCD_M
(LCD_M) LCD_M defines the LCD control methods, including duty (see table next
page).
This specification is subject to change without further notice.
Mar.01.2005 (V1.1) 9 of 36
EM78862B
8-Bit RISC Type Microprocessor
Bit 1~2: (LCD_C#) Defines LCD display mode; enable, disable, or blanking (see following
table).
LCD_C2
LCD_C1
LCD_M
LCD Display Control
Duty
Bias
0
0
0
Change duty
1/9
1/4
0
0
1
Disable (turn off LCD)
1/8
1/4
0
1
0
Blanking
1/9
1/4
0
1
1
Blanking
1/8
1/4
1
0
0
(Don’t care)
1/9
1/4
1
0
1
(Don’t care)
1/8
1/4
1
1
0
LCD display enable
1/9
1/4
1
1
1
LCD display enable
1/8
1/4
Bit 3:
Reserved. Clear this bit to ‘0’.
Bit 4:
(WUP9L) Port 9 low nibble Wake-Up Enable. Use to enable the low nibble wake-up
function in Port 9.
0: Disable
1: Enable
Bit 5:
(WUP9H) Port 9 high nibble Wake-Up Enable. Use to enable the high nibble
wake-up function in Port 9.
0: Disable
1: Enable
Bit 6:
(WDTE = Watch Dog Timer Enable)
Control bit is used to enable Watchdog timer. The relation between Bit 4 to Bit 6 is
illustrated in Fig. 6 below.
0: Disable
1: Enable
Bit 7:
Reserved. Clear this bit to ‘0’
Fig. 6 Wake-up Function and Control Signal
10 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
6.1.16 RF (Interrupt Status Register)
Bit 7
INT3
Bit 6
0
Bit 5
C8_2
Bit 4
C8_1
Bit 3
INT2
Bit 2
INT1
Bit 1
INT0
Bit 0
TCIF
Bit 0: (TCIF) TCC timer overflow interrupt flag. Set when TCC timer overflows.
Bit 1: (INT0) External INT0 pin interrupt flag
Bit 2: (INT1) External INT1 pin interrupt flag
Bit 3: (INT2) External INT2 pin interrupt flag
Bit 4: (C8_1) Internal 8 bit counter interrupt flag
Bit 5: (C8_2) Internal 8 bit counter interrupt flag
Bit 6: Unused. Clear to ‘0.’
Bit 7: (INT3) External INT3 pin interrupt flag
NOTE
1. “1” means interrupt request; “0” means non-interrupt
2. Refer to Section 6.7 (Interrupt) for reference on high to low edge trigger
3. IOCF is the interrupt mask register. You can read and clear this register.
6.1.17 R10 ~ R1F and R20 ~ R3F (General Purpose Register)
R10 ~ R1F & R20 ~ R3F (Banks 0~3) are general-purpose registers.
6.2
Special Purpose Registers
6.2.1 A (Accumulator, ACC)
Internal data transfer, or instruction operand holding. This is not an addressable register.
6.2.2 CONT (Control Register)
Bit 7
INT_EDGE
Bit 6
INT
Bit 5
TS
Bit 4
-
Bit 3
PAB
Bit 2
PSR2
Bit 1
PSR1
Bit 0
PSR0
Bit 0 ~ 2: (PSR0 ~ PSR2) TCC/WDT pre-scaler bits
PSR2
PSR1
PSR0
TCC Rate
WDT Rate
0
0
0
1:2
1:1
0
0
1
1:4
1:2
0
1
0
1:8
1:4
0
1
1
1:16
1:8
1
0
0
1:32
1:16
1
0
1
1:64
1:32
1
1
0
1:128
1:64
1
1
1
1:256
1:128
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)11 of 36
EM78862B
8-Bit RISC Type Microprocessor
Bit 3: (PAB) Pre-scaler assignment bit
0: For TCC use
1: For WDT use
Bit 4: Unused
Bit 5: (TS) TCC signal source
0: Internal instruction cycle clock
1: 16.384KHz or RC/2 (in RC mode)
Bit 6: (INT):INT enable flag. This bit is read only
0: Interrupt masked by DISI or hardware interrupt
1: Interrupt enabled by ENI/RETI instruction
Bit 7: INT_EDGE
0: P7.0 (INT0) interrupt source is a rising edge signal
1: P7.0 (INT0) interrupt source is a falling edge signal
NOTE
CONT is a readable and writable register.
6.2.3 IOC5 (Port 5 I/O Control Register)
Bit 7
IOC57
Bit 6
IOC56
Bit 5
IOC55
Bit 4
IOC54
Bit 3
0
Bit 2
0
Bit 0:
P5S is switch register for I/O port or LCD signal switching.
0: Select normal I/O port
1: Select SEG40~SEG43 output as LCD SEGMENT output
Bit 1:
Unused.
Bit 2:
Unused.
Bit 3:
Unused.
Bit 1
0
Bit 0
P5S
Bit 1
0
Bit 0
IOC60
Bit 4 ~ 7: Port 5 I/O direction control registers
0: Set the relative I/O pin as output
1: Set the relative I/O pin into high impedance
6.2.4 IOC6 (Port 6 I/O Control Register)
Bit 7
0
Bit 0:
Bit 6
0
Bit 5
0
Bit 4
0
Bit 3
0
Bit 2
0
(IOC60) Port 6 I/O direction control register
0: Set the relative I/O pins as output
1: Set the relative I/O pin into high impedance
Bit 2 ~ 7 Unused. Clear to ‘0’
NOTE
Refer to Section 6.2.12, IOCE (Bit 5) Register on how to switch Port 6 to normal I/O port.
12 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
6.2.5 IOC7 (Port 7 I/O Control Register)
Bit 7
IOC77
Bit 6
IOC76
Bit 5
IOC75
Bit 4
IOC74
Bit 3
IOC73
Bit 2
IOC72
Bit 1
IOC71
Bit 0
IOC70
Bit 1
IOC81
Bit 0
IOC80
Bit 0 ~ 7: (IOC70 ~ IOC77) Port 7 I/O direction control register
0: Set the relative I/O pins as output
1: Set the relative I/O pin into high impedance
6.2.6 IOC8 (Port 8 I/O Control Register)
Bit 7
IOC87
Bit 6
IOC86
Bit 5
IOC85
Bit 4
IOC84
Bit 3
IOC83
Bit 2
IOC82
Bit 0 ~ 7: (IOC80 ~ IOC87) Port 8 I/O direction control register
0: Set the relative I/O pins as output
1: Set the relative I/O pin into high impedance
NOTE
Refer to Section 6.2.8, IOCA (Bit6/7) Register below on how to switch Port 8 to
normal I/O port.
6.2.7
IOC9 (Port 9 I/O Control Register)
Bit 7
IOC97
Bit 6
IOC96
Bit 5
IOC95
Bit 4
IOC94
Bit 3
IOC93
Bit 2
IOC92
Bit 1
IOC91
Bit 0
IOC90
Bit 0 ~7: (IOC90 ~ IOC97) Port 9 I/O direction control register
0: Set the relative I/O pins as output
1: Set the relative I/O pin into high impedance
NOTE
Refer to Section 6.2.12, IOCE (Bit6/7) Register on how to switch Port 9 to normal I/O port.
6.2.8 IOCA (2K RAM Bank, Port 8 I/O, Page Control Register, R/W,
Default "00000000")
Bit 7
P8SH
Bit 6
P8SL
Bit 5
0
Bit 4
0
Bit 3
Bit 2
Bit 1
RAMBK2 RAMBK1 RAMBK0
Bit 0
0
Bit 0: Unused. Clear to ‘0’
Bit 1 ~ 3: (RAMBK0 ~ RAMBK2) Select 640 bytes RAM bank.
RAMBK_2
RAMBK_1
RAMBK_0
Note (Total Size)
0
0
0
RAM BANK0 (256 Bytes)
0
0
1
RAM BANK1 (256 Bytes)
0
1
0
RAM BANK2 (256 Bytes)
0
1
1
RAM BANK3 (256 Bytes)
1
0
0
RAM BANK4 (256 Bytes)
1
0
1
RAM BANK5 (256 Bytes)
1
1
0
RAM BANK6 (256 Bytes)
1
1
1
RAM BANK7 (256 Bytes)
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)13 of 36
EM78862B
8-Bit RISC Type Microprocessor
Bit 4 ~ 5: Unused. Clear the bits to ‘0’
Bit 6:
(P8SL) Port 8 low nibble switch
0: Normal I/O port
1: Segment output
Bit 7:
(P8SH) Port 8 high nibble switch
0: Normal I/O port
1: Segment output
6.2.9 IOCB (LCD Address, Counter 1 Preset Register)
6.2.9.1 Page 0 (LCD Address)
Bit 7
0
Bit 6
LCDA6
Bit 5
LCDA5
Bit 4
LCDA4
Bit 3
LCDA3
Bit 2
LCDA2
Bit 1
LCDA1
Bit 0
LCDA0
Bit 0 ~ 6: (LCDA0~LCDA6) LCD address
The LCD display data is stored in the data RAM. The relation between data area
and COM/SEG pin is as follows:
SEGMENT
IOCC (COM7 ~ COM0)
IOCB (Address)
SEG 0
00H
SEG 1
01H
:
1/8 DUTY
:
SEG 38
3AH
SEG 39
3BH
Unused
3CH
Unused
:
Unused
3FH
SEGMENT
Remarks
IOCC(COM 8)
IOCB(Address)
SEG 0
40H
SEG 1
41H
:
Remarks
1/9 DUTY
:
SEG 58
7AH
SEG 59
7BH
Unused
X
7CH
:
:
:
Bit 7: Unused. Fixed at ‘0’.
NOTE
Writable only when LCD is enabled. Read/Write when disabled.
14 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
6.2.9.2 Page 1 (Counter 1 Preset Register)
Bit 7
C1D7
Bit 6
C1D6
Bit 5
C1D5
Bit 4
C1D4
Bit 3
C1D3
Bit 2
C1D2
Bit 1
C1D1
Bit 0
C1D0
Bit 0 ~ 7: (C1D0~C1D7) 8 bit up counter (COUNTER1) preset and read out register
(write = preset ). After an interruption, it will count from “0”.
6.2.10 IOCC (LCD Data, Counter 2)
6.2.10.1 Page 0 (LCD Data)
Bit 7
LCDD7
Bit 6
LCDD6
Bit 5
LCDD5
Bit 4
LCDD4
Bit 3
LCDD3
Bit 2
LCDD2
Bit 1
LCDD1
Bit 0
LCDD0
Bit 2
C2D2
Bit 1
C2D1
Bit 0
C2D0
Bit 0 ~ 7: (LCDD0~LCDD7) LCD RAM data register
6.2.10.2 Page 1 (Counter 2)
Bit 7
C2D7
Bit 6
C2D6
Bit 5
C2D5
Bit 4
C2D4
Bit 3
C2D3
Bit 0 ~ 7: (C2D0~C2D7) 8 bit up-counter (COUNTER2) preset and read out register
(Write = preset). After an interruption, it will count from “00”.
6.2.11 IOCD (Pull-High Control Register, R-Option Register)
6.2.11.1 Page 0 (Pull-High Control Register)
Bit 7
PH77
Bit 6
PH76
Bit 5
PH75
Bit 4
PH74
Bit 3
PH73
Bit 2
PH72
Bit 1
PH71
Bit 0
PH70
Bit 0 ~ 7: (PH70~PH77) Control bit is used to enable the pull-high of Port 7 (#) pin.
0: Disable internal pull-high register
1: Enable internal pull-high register
6.2.11.2 Page 1 (R-Option Control Register)
Bit 7
RO7
Bit 6
RO6
Bit 5
RO5
Bit 4
RO4
Bit 3
RO3
Bit 2
RO2
Bit 1
RO1
Bit 0
RO 0
Bit 0 ~ 7: (RO0~RO7) Control bit is used to enable the R-Option of Port 9.0 ~ Port 9.7 pins.
0: Disable R-Option
1: Enable R-Option
RO is used for R-OPTION. Setting RO to ‘1’ will enable the status of R-option pin (P9.0 ~ P9.7)
to read by controller. Clearing RO will disable R-option function. If the R-option function is
used, you must connect the PORT9 pin to GND by 560K external registers. If the register is
connected/disconnected, the R9 will read as “ 0/1” when RO is set to ‘1’.
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)15 of 36
EM78862B
8-Bit RISC Type Microprocessor
6.2.12 IOCE (Port9 GPIO/LCD Segment, Port6 GPIO/LCD Com,
LCD Bias, Scan Key Signal, Port7 Open Drain, Counter 1/2 Clock
Source, Counter1 Pre-Scaler Control Register)
6.2.12.1 Page 0 (Port9 GPIO/LCD Segment, Port6 GPIO/LCD Com, LCD Bias,
Scan Key Signal Control Register)
Bit 7
P9SH
Bit 6
P9SL
Bit 5
P6S
Bit 4
BIAS3
Bit 3
BIAS2
Bit 2
BIAS1
Bit 1
0
Bit 0
SC
Bit 0: (SC) Scan key signal.
0: Disable scan key signal
1: Enable scan key signal
Once you enable this bit, all of the LCD signal will have a low pulse during a common
period. This pulse has 30µs width. Use the following procedures to implement the key
scans function:
a)
b)
c)
d)
Set Port7 as input port
Set IOCD Page 0 Port 7 to pull high
Enable scan key signal
Once a key is pressed, set RA (6)=1, and switch to normal mode
e) Blank LCD. Disable scan key signal
f) Set P9SL = 0, P9SH = 0. Port 9 sent probe signal to Port 7 and read Port 7 to get
the key.
Note that a probe signal instruction delay will occur before the next instruction is
performed.
g) Set P9SH = 1, P9SL =1. Define Port 9 as LCD signal and enable LCD.
NOTE
This procedure is also applicable to Port 6 and Port 8.
KEY5
P93
KEY1
KEY2
P92
KEY3
P91
KEY4
P90
P73
P72
P71
P70
Fig. 7 Key Scans Circuit
16 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
vdd
v1
v2
v3
vlcd
Gnd
Com2
vdd
v1
v2
v3
vlcd
Gnd
Seg
30us
Fig. 8 Key Scan Signal
Bit 1:
Port 7 PULL HIGH register option. Use default value.
Bit 2 ~ 4: (BIAS1~BIAS3) Control bits are used to choose LCD operation voltage.
Bit 5:
BIAS3
BIAS2
BIAS1
Ratio
LCD Vop (VDD=5V)
0
0
0
0.60 VDD
3.0V
0
0
1
0.66 VDD
3.3V
0
1
0
0.74 VDD
3.7V
0
1
1
0.82 VDD
4.0V
1
0
0
0.87 VDD
4.4V
1
0
1
0.93 VDD
4.7V
1
1
0
0.96 VDD
4.8V
1
1
1
1.00 VDD
5.0V
(P6S) Port 6 switch
0: Normal I/O port
1: Common output of LCD
Bit 6:
(P9SL) Port 9 low nibble switch
0: Normal I/O port
1: Segment output of LCD
Bit 7:
(P9SH) Port 9 high nibble switch
0: Normal I/O port
1: Segment output of LCD
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)17 of 36
EM78862B
8-Bit RISC Type Microprocessor
6.2.12.2 Page 1 (Port 7 Open Drain, Counter 1/2 Clock Source, Counter 1 Pre-Scaler)
Bit 7
OP77
Bit 6
OP76
Bit 0:
Unused.
Bit 1:
Unused.
Bit 5
C2S
Bit 4
C1S
Bit 3
PSC1
Bit 2
PSC0
Bit 1
0
Bit 0
0
Bit 1
INT0
Bit 0
TCIF
Bit 2 ~ 3: (PSC0~PSC1) Counter1 prescaler, reset=(0,0)
Bit 4:
PSC1
PSC0
Counter 1 Rate
0
0
1:1
0
1
1:4
1
0
1:8
1
1
Reserved
(C1S) Counter 1 source.
0: 32768Hz / RC
1: 3.579MHz, if enable PLL (Crystal mode)
Bit 5:
(C2S) Counter 2 source. Scale=1:1
0: 32768Hz / RC
1: 3.579MHz, if enable PLL (Crystal mode)
Bit 6:
(OP76) P76 open-drain control
0: Disable
1: Enable
Bit 7:
(OP77) P77 open-drain control
0: Disable
1: Enable
6.2.13 IOCF (Interrupt Mask Register)
Bit 7
INT3
Bit 6
0
Bit 5
C8_2
Bit 4
C8_1
Bit 3
INT2
Bit 2
INT1
Bit 0 ~ 5, & Bit7: Interrupt enable bit.
0: Disable interrupt
1: Enable interrupt
Bit 6: Reserved. Clear the bit to ‘0’
NOTE
IOCF Register is readable and writable.
18 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
6.3
TCC/WDT Pre-Scaler
„ An 8-bit counter is available as pre-scaler for the TCC or WDT. The pre-scaler is available
only to either the TCC or WDT at a time.
„ An 8-bit counter is available for TCC or WDT as determined by the status of Bit 3 (PAB) of
CONT register.
„ The pre-scaler ratio is described in Section 6.2.2 CONT (Control Register).
„ The TCC/WDT circuit diagram is shown in Fig. 9 below.
„ Both TCC and pre-scaler are cleared by instructions.
„ The pre-scaler will be cleared by the WDTC and SLEP instructions when running in WDT
mode.
„ However, pre-scaler will not be cleared by SLEP instruction when running in TCC mode.
CLK(=Fosc/2)
Data Bus
0
1
16.38KHz
SYNC
2 Cycles
or RC/2
0
1
OSCSEL
TS
PAB
TCC(R1)
TCC Overflow
Interrupt
0
8-BIT Counter
1
WDT
PAB
8-to-1 MUX
1
0
WDTE
PSR0~PSR2
MUX
PAB
WDT Timeout
Fig. 9 TCC WDT Block Diagram
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)19 of 36
EM78862B
8-Bit RISC Type Microprocessor
6.4
I/O Ports
The I/O registers, (Port 5, Port 6, Port 7, Port 8, and Port 9), are bi-directional tri-state I/O ports.
Port 7 can be pulled-high internally by software. Furthermore, P7.6 and P7.7 has its
open-drain output also defined through software. Port 9 features an input status changed
wake-up function. Each I/O pin can be defined as "input" or "output" pin by the I/O control
register (IOC5 ~ IOC9). The I/O registers and I/O control registers are both readable and
writable. The I/O interface circuits are shown in Fig. 10 below.
NOTE: Open-drain is not
shown in the figure.
Fig. 10 Port 5, Port 6, Port 7, & Port 8 I/O Port and I/O Control Register Circuit
6.5
RESET and Wake-up
RESET will occur during any of the following conditions:
„ Power on reset
„ WDT timeout (if WDT is enabled during SLEEP, GREEN, or NORMAL mode)
„ Port 9 wake-up (if WUP9H or WUP9L is enabled during SLEEP mode)
„ RESET pin pull low
Once a RESET occurs, the following functions are performed:
„ The oscillator will continue running
„ The Program Counter (R2) is set to all "0"
„ All I/O port pins are configured to input mode (high-impedance state)
„ The TCC/Watchdog timer and pre-scaler are cleared
„ The Watchdog timer is disabled
„ When power is switched on, the upper 3 bits of R3 and the upper 2 bits of R4 are cleared
„ The bits of the CONT register are set to all "1"
20 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
„ For other registers (Bit7 & Bit 0), refer below:
R5 = PORT
IOC5 = "11110000"
R6 = PORT
IOC6 = "11111111"
R7 = PORT
IOC7 = "11111111"
R8 = PORT
IOC8 = "11111111"
R9 = PORT
IOC9 = "11111111"
RA = "x00x0xxx
IOCA = "00000000"
RB = "11111111"
Page0 IOCB = "00000000"
RC = "00000000"
Page0 IOCC = "0xxxxxxx"
Page1 IOCC = "00000000"
RD = "xxxxxxxx"
Page0 IOCD = "00000000"
Page1 IOCD = "00000000"
RE = "00000000"
Page0 IOCE = "00000000"
Page1 IOCE = "00000000"
RF = "00000000"
IOCF = "00000000"
Page1 IOCB = "00000000"
The controller can be awakened from Sleep mode and Idle mode. The wake-up signals are
listed below.
Wake-Up Signal
TCC time out
IOCF Bit0=1
INT0 pin
IOCF Bit1=1
INT1 pin
IOCF Bit2=1
INT2 pin
IOCF Bit3=1
INT3 pin
IOCF Bit7=1
Sleep Mode
Idle Mode
Green Mode
Normal Mode
RA(7,6)=(0,0)
+ SLEP
RA(7,6)=(1,0)
+ SLEP
RA(7,6)=(x,0)
No SLEP
RA(7,6)=(x,1)
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
X
X
RESET
RESET
X
X
X
X
X
Wake-up
+ Interrupt
+ Next instruction
Wake-up
+ Interrupt
+ Next instruction
Wake-up
+ Interrupt
+ Next instruction
Wake-up
+ Interrupt
+ Next instruction
Wake-up
+ Interrupt
+ Next instruction
Port9 (input status
change wake-up)
RESET
Wake-up
+ Next instruction
WDT time out
RESET
Wake-up+ next
instruction
No SLEP
X=No function
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)21 of 36
EM78862B
8-Bit RISC Type Microprocessor
6.6
Oscillator
The oscillator system is used to generate the device clock. The oscillator system is
composed of an RC or crystal oscillator and a PLL oscillator as shown in the diagram below.
NOTE: Under RC oscillator mode, the pull-up resistor that connects to OSCI pin and OSC0 pin should
be floating.
Under 32768Hz crystal oscillator mode, the crystal is connected between OSCI pin and OSCO
pin. A 20~30pF capacitor should be connected between each of the pins and ground.
In Crystal mode, if the RA (Bit 6)=1, the system clock frequency can be tuned to 3.579MHz.
The initial value of OSCSEL bit is fixed at ‘1’ (crystal oscillator).
Fig. 11 Oscillator and PLL Function Block.
6.7
Interrupt
The EM78862B IC has two types internal interrupts which are falling edge triggered:
„ TCC timer overflow interrupt (internal)
„ Two 8-bit counters overflow interrupt
If these interrupt sources change signal from high to low, the RF register will generate '1' flag
to corresponding register if IOCF register is enabled.
RF is the interrupt status register which records the interrupt request in flag bit. IOCF is the
interrupt mask register. Global interrupt is enabled by ENI instruction and is disabled by DISI
instruction. When one of the interrupts (when enabled) is generated, it will cause the next
instruction to be fetched from address 008H. Once in the interrupt service routine, the source
of the interrupt can be determined by polling the flag bits in the RF register.
NOTE
The interrupt flag bit must be cleared in software before leaving the interrupt
service routine in order to prevent and avoid recursive interrupts.
There are four external interrupt pins, i.e., INT0, INT1, INT2, & INT3, and three internal
interrupts available:
„ External interrupt signals (INT0, INT1, INT2, and INT3) are from Port 7 Bit 0 to Bit 3. If
IOCF is enabled, then these signals will activate interrupt. Otherwise, these signals will be
treated as general input data.
„ Internal signals include TCC, CNT1, and CNT2.
22 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
After reset, the next instruction will be fetched from Address 000H and the hardware interrupt
is 008H.
After timeout, TCC will go to Address 008H when in GREEN mode or NORMAL mode. When
in SLEEP mode, TCC will run the next instruction after “SLEP” instruction. These two
conditions will set a RF flag.
NOTE
It is very important to save ACC, R3 and R5 when processing an interruption as
illustrated below:
Address
0x08
0x09
0x0A
0x0B
0x0C
0x0D
0x0E
:
:
:
:
:
:
:
:
6.8
Instruction
DISI
MOV
SWAP
SWAPA
MOV
MOV
MOV
:
:
MOV
MOV
SWAPA
MOV
SWAPA
RETI
A_BUFFER, A
A_BUFFER
0x03
R3_BUFFER, A
A, 0x05
R5_BUFFER, A
A, R5_BUFFER
0X05,A
R3_BUFFER
0X03,A
A_BUFFER
Remarks
; Disable interrupt
; Save ACC
; Save R3 status
; Save ROM page register
; Return R5
; Return R3
; Return ACC
LCD Driver
The data bank IC can drive LCD directly and has 60 segments and 9 commons that can drive
a total of 60*9 dots. LCD block is made up of LCD driver; display RAM, segment output pins,
common output pins, and LCD operating power supply pins.
Duty, bias, the number of segment, the number of common and frame frequency are
determined by LCD mode register and LCD control register.
The basic structure contains a timing control which uses the basic frequency 32.768KHz or
RC to generate the proper timing for different duty and display access. RE register is a
command register for LCD driver. The LCD display (disable, enable, & blanking) is controlled
by LCD_C and the driving duty and bias is decided by LCD_M. The display data is stored in
data RAM which address and data access are controlled by registers IOCB and IOCC.
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)23 of 36
EM78862B
8-Bit RISC Type Microprocessor
32.768KHz X'TAL or RC
IOCB (Address)
IOCC (Data)
LCD Timing Control
LCD RAM
LCD Duty Control
Display Data Control
Bias Control
LCD COMMON Control
LCD SEGMENT Control
Vdd - Vlcd
COM
SEG
RE(LCD_C,LCD_M)
Fig. 12 LCD Driver Control Block
6.8.1 LCD Driver Control
6.8.1.1 LCD Driver, WDT Control (RE)
Bit 7
0
Bit 0:
Bit 6
/WDTE
Bit 5
/WUP9H
Bit 4
/WUP9L
Bit 3
0
Bit 2
LCD_C2
Bit 1
LCD_C1
Bit 0
LCD_M
(LCD_M) LCD_M decides the methods, including duty.
Bit 1 ~ 2: (LCD_C#) decides the LCD display enable or blanking.
24 of 36
LCD_C2
LCD_C1
LCD_M
0
0
0
Change duty
LCD Display Control
Duty
Bias
1/9
1/4
0
0
1
Disable (turn off LCD)
1/8
1/4
0
1
0
Blanking
1/9
1/4
0
1
1
Blanking
1/8
1/4
1
0
0
X
1/9
1/4
1
0
1
X
1/8
1/4
1
1
0
LCD display enable
1/9
1/4
1
1
1
LCD display enable
1/8
1/4
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
6.8.2 LCD Display Area
The LCD display data is stored in the data RAM. The relation between data area and
COM/SEG pin is as shown below.
SEGMENT
IOCC (COM7 ~ COM0)
IOCB (Address)
SEG 0
00H
SEG 1
01H
Remarks
:
1/8 DUTY
:
SEG 58
3AH
SEG 59
3BH
Unused
3CH
Unused
:
Unused
3FH
SEGMENT
IOCC (COM 8)
IOCB (Address)
SEG 0
40H
SEG 1
41H
Remarks
:
1/9 DUTY
:
SEG 58
7AH
SEG 59
7BH
Unused
X
7CH
:
:
:
Unused
X
7FH
6.8.2.1 IOCB (LCD RAM Display Address)
Bit 7
0
Bit 6
LCDA6
Bit 5
LCDA5
Bit 4
LCDA4
Bit 3
LCDA3
Bit 2
LCDA2
Bit 1
LCDA1
Bit 0
LCDA0
Bit 0 ~ 6: (LCDA0~LCDA6) LCD address (up to 120)
Bit 7:
Unused. Fixed at ‘0’
NOTE
Write only when LCD is enabled. Read/Write when disabled.
6.8.2.2 IOCC (LCD RAM Display Data)
Bit 7
LCDD7
Bit 6
LCDD6
Bit 5
LCDD5
Bit 4
LCDD4
Bit 3
LCDD3
Bit 2
LCDD2
Bit 1
LCDD1
Bit 0
LCDD0
Bit 0 ~7: (LCDD0~LCDD7) LCD RAM display data register
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)25 of 36
EM78862B
8-Bit RISC Type Microprocessor
6.8.3 LCD COM and SEG Signal
COM Signal: The number of COM pins varies according to the duty cycle in use as shown in
the following table. In 1/8 Duty mode, COM8 must be opened. In 1/9 Duty
mode, COM0 ~ COM8 pins must be used.
Duty
1/8
1/9
COM0
COM1
COM2
COM3
COM4
COM5
COM6
COM7
COM8
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
X
O
X = open, O = select
SEG Signal: The 60 segment signal pins are connected to the corresponding display RAM
address 00h to 3Bh. When Duty mode is at 1/8, the required data address are
only those from Com0 ~ Com7 (located within 00h ~ 3Bh). However, when
Duty mode is at 1/9, all data address from Com0 ~ Com7 (located within 00h ~
3Bh) and Com8 (located within 40h ~ 7Bh) are needed.
When a bit of display RAM is 1, a select signal is sent to the corresponding segment pin, and
when the bit is 0, a non-select signal is sent to the corresponding segment pin.
COM, SEG, and Select/Non-Select signals are illustrated below.
frame
Vdd
V1
V2
V3
VLCD
com0
Vdd
V1
V2
V3
VLCD
com1
Vdd
V1
V2
V3
VLCD
com2
Vdd
V1
V2
V3
VLCD
seg
dark
Vdd
V1
V2
V3
VLCD
seg
light
Fig.13 LCD Waveform 1/4 Bias
26 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
6.8.4 LCD Bias Control
6.8.4.1 IOCE (Bias Control Register)
Bit 7
P9SH
Bit 6
P9SL
Bit 5
P6S
Bit 4
BIAS3
Bit 3
BIAS2
Bit 2
BIAS1
Bit 1
0
Bit 0
SC
Bit 2 ~ 4: (BIAS1~BIAS3) Control bits used to choose LCD operation voltage. See Fig. 14
below for the applicable circuit.
LCD Operating Voltage
LCD Vop (VDD=5V)
Ratio
000
3.0V
0.60 VDD
001
3.3V
0.66 VDD
010
3.7V
0.74 VDD
011
4.0V
0.82 VDD
100
4.4V
0.87 VDD
101
4.7V
0.93 VDD
110
4.8V
0.96 VDD
111
5.0V
1.00 VDD
Fig. 14 LCD Bias Circuit
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)27 of 36
EM78862B
8-Bit RISC Type Microprocessor
6.9
Code Options
The EM78862B IC is equipped with one CODE option register that is not a part of the normal
program memory. The option bits cannot be accessed during normal program execution.
Bit 11 Bit 10 Bit 9
OSCSEL
1
0
Bit 8
0
Bit 7
1
Bit 6
1
Bit 5
1
Bit 4
0
Bit 3
0
Bit 2 Bit 1 Bit 0
0
MCLK
1
Bit 0, 5, 6, 7, & 10: Reserved. Set these bits to “1”
Bit 2, 3, 4, 8, & 9: Reserved. Clear these bits to “0”
Bit 1: (MCLK) Main Clock select
0: 3.579MHz
1: 1.7895MHz
Bit 11: (OSCSEL) Oscillator select
0: RC mode
1: Crystal mode
The RC or crystal oscillator is selected by OSCSEL bit of code option.
6.10 Instruction Set
Each instruction in the instruction set is a 13-bit word divided into an OP code and one or more
operands. Normally, all instructions are executed within one single instruction cycle (one
instruction consists of 2 oscillator periods). Unless the program counter is changed by
instructions "MOV R2, A," "ADD R2, A," or by instructions of arithmetic or logic operation on
R2 (e.g., "SUB R2, A," "BS(C) R2, 6," "CLR R2," etc.). Under this condition, the execution
takes two instruction cycles.
If for some reasons, the specification of the instruction cycle is not suitable for certain
applications, try modifying the instruction as follows:
a) Change one instruction cycle to consist of 4 oscillator periods.
b) Execute within two instruction cycles, "JMP," "CALL," "RET," "RETL," & "RETI," or the
conditional skip ("JBS," "JBC," "JZ," "JZA," "DJZ," & "DJZA") instructions which were
tested to be true. Also execute within two instruction cycles the instructions that are
written to the program counter.
Furthermore, the instruction set has the following features:
„ Every bit of any register can be set, cleared, or tested directly.
„ The I/O register can be regarded as general register. That is, the same instruction can
operate on I/O register.
The symbol "R" in the instruction set represents a register designator that specifies which one
of the registers (including operational registers and general purpose registers) is to be utilized
by the instruction. "B" represents a bit field designator that selects the value for the bit, which
is located in the register "R", and affects operation. "K" represents an 8 or 10-bit constant or
literal value.
28 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
INSTRUCTION
BINARY
0 0000 0000 0000
HEX
0000
MNEMONIC
NOP
OPERATION
No Operation
STATUS AFFECTED
None
0 0000 0000 0001
0001
DAA
Decimal Adjust A
C
0 0000 0000 0010
0002
CONTW
A → CONT
None
0 0000 0000 0011
0003
SLEP
0 → WDT, Stop oscillator
T, P
0 0000 0000 0100
0004
WDTC
0 → WDT
T, P
0 0000 0000 rrrr
000r
IOW R
A → IOCR
None 1
0 0000 0001 0000
0010
ENI
Enable Interrupt
None
0 0000 0001 0001
0011
DISI
Disable Interrupt
None
0 0000 0001 0010
0012
RET
[Top of Stack] → PC
None
RETI
[Top of Stack] → PC,
Enable Interrupt
None
0 0000 0001 0011
0013
0 0000 0001 0100
0014
CONTR
CONT → A
None
0 0000 0001 rrrr
001r
IOR R
IOCR → A
None 1
0 0000 0010 0000
0020
TBL
R2+A → R2,
Bits 8~9 of R2 unchanged
Z, C, DC
0 0000 01rr rrrr
00rr
MOV R,A
A→R
None
0 0000 1000 0000
0080
CLRA
0→A
Z
0 0000 11rr rrrr
00rr
CLR R
0→R
Z
0 0001 00rr rrrr
01rr
SUB A,R
R-A → A
Z, C, DC
0 0001 01rr rrrr
01rr
SUB R,A
R-A → R
Z, C, DC
0 0001 10rr rrrr
01rr
DECA R
R-1 → A
Z
0 0001 11rr rrrr
01rr
DEC R
R-1 → R
Z
0 0010 00rr rrrr
02rr
OR A,R
A∨R→A
Z
0 0010 01rr rrrr
02rr
OR R,A
A∨R→R
Z
0 0010 10rr rrrr
02rr
AND A,R
A&R→A
Z
Z
0 0010 11rr rrrr
02rr
AND R,A
A&R→R
0 0011 00rr rrrr
03rr
XOR A,R
A⊕R→A
Z
0 0011 01rr rrrr
03rr
XOR R,A
A⊕R→R
Z
0 0011 10rr rrrr
03rr
ADD A,R
A+R→A
Z, C, DC
0 0011 11rr rrrr
03rr
ADD R,A
A+R→R
Z, C, DC
0 0100 00rr rrrr
04rr
MOV A,R
R→A
Z
0 0100 01rr rrrr
04rr
MOV R,R
R→R2
Z
0 0100 10rr rrrr
04rr
COMA R
/R → A
Z
0 0100 11rr rrrr
04rr
COM R
/R ( R
Z
0 0101 00rr rrrr
05rr
INCA R
R+1 ( A
Z
0 0101 01rr rrrr
05rr
INC R
R+1 ( R
Z
0 0101 10rr rrrr
05rr
DJZA R
R-1 ( A, skip if zero
None
0 0101 11rr rrrr
05rr
DJZ R
R-1 ( R, skip if zero
None
0 0110 00rr rrrr
06rr
RRCA R
R(n) ( A(n-1),
R(0) ( C, C ( A(7)
C
1
2
This instruction is applicable to IOC5 ~ IOC9, IOCA, IOCB, IOCC, IOCD, IOCE, & IOCF only.
Source and destination must be the same.
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)29 of 36
EM78862B
8-Bit RISC Type Microprocessor
INSTRUCTION
BINARY
MNEMONIC
OPERATION
STATUS AFFECTED
0 0110 01rr rrrr
06rr
RRC R
R(n) ( R(n-1),
R(0) ( C, C ( R(7)
C
0 0110 10rr rrrr
06rr
RLCA R
R(n) ( A(n+1),
R(7) ( C, C ( A(0)
C
0 0110 11rr rrrr
06rr
RLC R
R(n) ( R(n+1),
R(7) ( C, C ( R(0)
C
0 0111 00rr rrrr
07rr
SWAPA R
R(0-3) ( A(4-7),
R(4-7) ( A(0-3)
None
0 0111 01rr rrrr
07rr
SWAP R
R(0-3) ( R(4-7)
None
0 0111 10rr rrrr
07rr
JZA R
R+1 ( A, skip if zero
None
0 0111 11rr rrrr
07rr
JZ R
R+1 ( R, skip if zero
None
0 100b bbrr rrrr
0xxx
BC R,b
0 ( R(b)
None 3
0 101b bbrr rrrr
0xxx
BS R,b
1 ( R(b)
None 4
0 110b bbrr rrrr
0xxx
JBC R,b
if R(b)=0, skip
None
0 111b bbrr rrrr
0xxx
JBS R,b
if R(b)=1, skip
None
1 00kk kkkk kkkk
1kkk
CALL k
PC+1 ( [SP],
(Page, k) ( PC
None
1 01kk kkkk kkkk
1kkk
JMP k
(Page, k) ( PC
None
1 1000 kkkk kkkk
18kk
MOV A,k
k(A
None
1 1001 kkkk kkkk
19kk
OR A,k
A(k(A
Z
1 1010 kkkk kkkk
1Akk
AND A,k
A&k(A
Z
1 1011 kkkk kkkk
1Bkk
XOR A,k
A(k(A
Z
1 1100 kkkk kkkk
1Ckk
RETL k
k ( A, [Top of Stack] ( PC
None
1 1101 kkkk kkkk
1Dkk
SUB A,k
k-A ( A
Z, C, DC
1 1110 0000 0010
1E02
INT
PC+ 1 [SP], 001H ( PC
None
1 1110 1000 kkkk
1E8k
PAGE k
k->R5(3:0)
None
1 1111 kkkk kkkk
1Fkk
ADD A,k
k+A ( A
Z, C, DC
3
4
7
HEX
This instruction is not recommended for RF operation.
This instruction cannot operate under RF.
Absolute Maximum Ratings
RATING
30 of 36
SYMBOL
VALUE
UNIT
DC Supply Voltage
Vdd
–0.3 to 6
V
Input Voltage
Vin
–0.5 to Vdd +0.5
V
Operating Temperature Range
Ta
–40 to 85
°C
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
8
DC Electrical Characteristics
(Ta=0°C ~ 70°C, VDD=5V±5%, VSS=0V)
Symbol
Parameter
IIL1
Input Leakage Current for input
pins
IIL2
Input Leakage Current for
bi-directional pins
VIH
Input High Voltage
VIL
Input Low Voltage
Condition
Min
Type
Max
Unit
VIN = VDD, VSS
-
-
±1
µA
VIN = VDD, VSS
-
-
±1
µA
-
0.8VDD
-
VDD
V
-
VSS
-
0.2VDD
V
-
-
V
0.8
V
-
V
1.5
V
VIHT
Input High Threshold Voltage
RESET
2.0
VILT
Input Low Threshold Voltage
RESET
-
VIHX
Clock Input High Voltage
OSCI
3.5
VILX
Clock Input Low Voltage
OSCI
-
VHscan
Key scan Input High Voltage
Port 6 for key scan
3.5
-
-
V
VLscan
Key scan Input Low Voltage
Port 6 for key scan
-
-
1.5
V
Output High Voltage
(Port 6, 7, 8)
IOH = –1.6mA
0.8VDD
-
VDD
V
(Port 9)
IOH = –6.0mA
0.8VDD
-
VDD
V
Output Low Voltage
(Port6, 7, 8)
IOL = 1.6mA
VSS
-
0.2VDD
V
(Port 9)
IOL = 6.0mA
VSS
-
0.2VDD
V
Vcom
Com voltage drop
Io=+/- 50 uA
2.9
V
Vseg
Segment voltage drop
Io=+/- 50 uA
Vlcd
LCD drive reference voltage
Contrast adjustment
IPH
Pull-high current
ISB1
VOH1
VOL1
-
3.8
V
0.6VDD
-
VDD
V
Pull-high active input pin
at VSS
-
–10
–15
µA
Power down current
(SLEEP mode)
All input and I/O pin at
VDD, output pin floating,
WDT disabled
-
1
4
µA
ISB2
Power down current
(IDLE mode)
All input and I/O pin at
VDD, output pin floating,
WDT disabled, LCD
enabled
-
50
70
µA
ISB3
Low clock current
(GREEN mode)
CLK=32.768KHz, all
input and I/O pin at VDD,
output pin floating, WDT
disabled, LCD enabled
-
80
100
µA
ICC
Operating supply current
(NORMAL mode)
RESET=High,
CLK=3.579MHz, output
pin floating, LCD enabled
-
1.5
1.9
mA
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)31 of 36
EM78862B
8-Bit RISC Type Microprocessor
(Ta=0°C ~ 70°C, VDD=3V±5%, VSS=0V)
Symbol
9
Parameter
Condition
Min
Type
Max
Unit
ISB1
Power down current
(SLEEP mode)
All input and I/O pin at VDD,
output pin floating, WDT
disabled
1
2
µA
ISB2
Power down current
(IDLE mode)
All input and I/O pin at VDD,
output pin floating, WDT
disabled, LCD enabled
25
35
µA
ISB3
Low clock current
(GREEN mode)
CLK=32.768KHz, all input and
I/O pin at VDD, output pin
floating, WDT disabled, LCD
enabled
35
45
µA
ICC
Operating supply current RESET=High, CLK=3.579MHz,
output pin floating, LCD enable
(NORMAL mode)
0.9
1.2
mA
AC Electrical Characteristics
(Ta=0°C ~ 70°C, VDD=5V, VSS=0V)
Symbol
Parameter
Dclk
Input CLK duty cycle
Tins
Instruction cycle time
Tdrh
Device delay hold
time
Twdt
Watchdog timer
period
Description
OSC start up (32.768KHz)
(3.579MHz PLL)
32 of 36
Mar.01.2005 (V1.1)
Conditions
32.768K
3.579M
Min
Type
Max
Unit
45
50
55
%
-
µs
ns
-
ms
60
-
550
-
18
Ta = 25°C
18
Symbol
Min
Tosc
--
Type
ms
Max
400
10
Unit
ms
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
10 Timing Diagram
Fig. 15 AC Timing
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)33 of 36
EM78862B
8-Bit RISC Type Microprocessor
11 Application Circuit
11.1 Application with Crystal Mode
Fig. 16. Application with Crystal Mode
34 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.
EM78862B
8-Bit RISC Type Microprocessor
11.2 Application with RC Mode
Fig. 17. Application with RC Mode
This specification is subject to change without further notice.
Mar.01.2005 (V1.1)35 of 36
EM78862B
8-Bit RISC Type Microprocessor
36 of 36
Mar.01.2005 (V1.1)
This specification is subject to change without further notice.