EM73A89B is an advanced single chip CMOS 4-bit micro-controller. It contains 16K-byte ROM, 1012-nibble
RAM, 4-bit ALU, 13-level subroutine nesting, 22-stage time base, two 12-bit timer/counters for the kernel
function, and one high speed conter. EM73A89B also equipped with 6 interrupt sources, 3~7 I/O ports (including
1 input port and 2~7 bidirection ports), LCD display (64x16 or 64x32), built-in watch-dog-timer and speech
synthesizer.
It's low power consumption and high speed feature are further strengten with DUAL, SLOW, IDLE and STOP
operation mode for optimized power saving.
FEATURES
Operation voltage: 2.2V to 3.6V.
Clock source: Dual clock system. Low-frequency oscillator is 32KHz. Crystal oscillator or RC
Instruction set: 107 powerful instructions.
Instruction cycle time: 0.85µs for 9.2M or 1.7µs for 4.6M Hz selected by mask option(high speed clock).
ROM capacity: 16K x 8 bits.
RAM capacity: 1012 x 4 bits.
Input port: 1 port (P0.0-P0.3), IDLE/STOP releasing function is available by mask option.
Bidirection port: 2~7 ports (P1, P2, P4, P5, P6, P7, P8). IDLE/STOP release function for P8(0..
Built-in watch-dog-timer counter : It is available by mask option.
12-bit timer/counter: Two 12-bit timer/counters are programmable for timer, event counter and pulse
Built-in time base counter : 22 stages.
Subroutine nesting: Up to 13 levels.
High speed counter: The high speed counter includes one 8-bit high speed counter and a resistor to
LCD driver: 64x32 or 64x16 dots, 1/32 or 1/16 duty, 1/5 bias by mask option.
Speech synthesizer: 992K speech data ROM (use as 992K nibbles data ROM).
PWM or current D/A: Output selection by mask option.
Power saving function: SLOW, IDLE, STOP operation modes.
Package type: Chip form 126 pins.
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
Preliminary
oscillator by mask option and high-frequency oscillator is a built-in internal
oscillator.
122µs for 32768 Hz (low speed clock, frequency double).
(each input pin has a pull-up and pull-down resistor available by mask option).
3) is available by mask option. P1, P2, P5, P6, P7 are shared with LCD pins.
width measurement mode.
Internal interrupt . . . . . . 2 timer overflow interrupts, 1 time base interrupt.
1 speech/HTC interrupt.
frequency oscillator. It has resistor to frequrncy oscillation mode, melody mode
and auto load timer mode.
* This specification are subject to be changed without notice.
CLKOSC-GCapacitor connecting pin for internal high frequency oscillator.
LXINOSC-B/OSC-H Crystal/Resistor connecting pin for low speed clock source.
LXOUTOSC-BCrystal connecting pin for low speed clock source.
P0(0..3)/WAKEUP0..3INPUT-B4-bit input port with IDLE/STOP releasing function
P4.0(RX),P4.2(RY),I/O-X13-bit bidirection I/O pins or RF oscillation input pins.
P4.3(RZ)mask option :open-drain (apply to RF oscillation)
high current push-pull
normal current push-pull
low current push-pull
mask option :open-drain
high current push-pull
normal current push-pull
low current push-pull
* This specification are subject to be changed without notice.
8.16.2001
2
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
Preliminary
SymbolPin-typeFunction
P8.0(INT1)/WAKEUPA I/O-X12-bit bidirection I/O port with external interrupt sources input and IDLE
P8.2(INT0)/WAKEUPC/STOP releasing function
mask option :wakeup enable, normal current push-pull
wakeup ensable, low current push-pull
wakeup disable, high current push-pull
wakeup disable, normal current push-pull
wakeup disable, low current push-pull
wakeup disable, open drain
P8.1(TRGB)/WAKEUPB I/O-X12-bit bidirection I/O port with time/counter A,B external input and IDLE
P8.3(TRGA)/WAKEUPD/STOP releasing function
mask option :wakeup enable, normal current push-pull
wakeup ensable, low current push-pull
wakeup disable, high current push-pull
wakeup disable, normal current push-pull
wakeup disable, low current push-pull
wakeup disable, open drain
VCA, VCB, V1~V6LCD bias voltage pins
BZ1/VOPWM or current D/A output pin for speech synthesizer by mask option
BZ2PWM output pin for speech synthesizer
TESTTie Vss as package type, no connecting as COB type.
*16 COMMONS :
COM0~COM15LCD common output pins
SEG0~SEG59LCD segment output pins
P1(0..3)/SEG63..60I/O-P4-bit bidirection I/O pins with LCD segment pins
Reset start address
INT0 ; interrupt service routine entry address
SPI or HTCI
TRGA
TRGB
TBI
INT1
SCALL, subroutine call entry address
Bank 1
Bank 2
Bank 3
Subroutine call entry address
designated by [LCALL a]
instruction
Data table for
[LDAX],[LDAXI]
instruction
* This specification are subject to be changed without notice.
8.16.2001
4
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
User's program and fixed data are stored in the program ROM. User's program is executed using the PC value
Preliminary
to fetch an instruction code.
The 16Kx8 bits program ROM can be divided into 4 banks. There are 4Kx8 bits per bank.
The program ROM bank is selected by P3(1..0). The program counter is a 13-bit binary counter. The PC and
P3 are initialized to "0" during reset.
When P3(1..0)=00B or 11B, the bank0 and bank1 of program ROM will be selected. P3(1..0)=01B, the bank0
and bank2 will be selected. P3(1..0)=10B, the bank0 and bank3 will be selected.
P3=xx00B
AddressP3=xx11BP3=xx01BP3=xx10B
0000h
:
:Bank0Bank0Bank0
0FFFh
1000h
:
:Bank1Bank2Bank3
1FFFh
PROGRAM EXAMPLE:
BANK 0
START::
:
:
LDIA#00H; set program ROM to bank1
OUTA P3
BXA1
:
XA ::
:
LDIA#01H; set program ROM to bank2
OUTA P3
BXB1
:
XB ::
:
LDIA#02H; set program ROM to bank3
OUTA P3
BXC1
:
Fixed data can be read out by table-look-up instruction. Table-look-up instruction is requires the Data point
(DP) to indicate the ROM address in obtaining the ROM code data (Except bank 0) :
LDAXAcc
LDAXIAcc
←←
← ROM[DP]
←←
←←
← ROM[DP]
←←
L
,DP+1
H
DP is a 12-bit data register that stores the program ROM address as pointer for the ROM code data.
User has to initially load ROM address into DP with instructions "STADPL", and "STADPM, STADPH",
then to obtain the lower nibble of ROM code data by instruction "LDAX" and higher nibble by instruction
"LDAXI".
PROGRAM EXAMPLE: Read out the ROM code of address 1777h by table-look-up instruction.
* This specification are subject to be changed without notice.
SEG29
SEG30
SEG31
SEG32
SEG33
SEG34
SEG35
SEG36
SEG37
SEG38
SEG39
SEG40
SEG41
SEG42
SEG43
SEG44
SEG45
SEG46
SEG47
SEG48
SEG49
SEG50
SEG51
SEG52
SEG53
SEG54
SEG55
SEG56
SEG57
SEG58
SEG59
SEG60
SEG61
8.16.2001
SEG62
SEG63
7
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
Preliminary
ZERO- PAGE:
From 000h to 00Fh is the zero-page location. It is used as the zero-page address mode pointer for the
instruction of "STD #k,y; ADD #k,y; CLR y,b; CMP k,y".
PROGRAM EXAMPLE: To write immediate data "07h" to RAM [03] and to clear bit 2 of RAM [0Eh].
STD #07h, 03h ; RAM[03] ← 07h
CLR 0Eh,2 ; RAM[0Eh]
STACK:
There are 13 - level (maximum) stack levels that user can use for subroutine (including interrupt and CALL).
User can assign any level be the starting stack by providing the level number to stack pointer (SP).
When an instruction (CALL or interrupt) is invoked, before enter the subroutine, the previous PC address
is saved into the stack until returned from those subroutines, the PC value is restored by the data saved in stack.
DATA AREA:
← 0
2
Except the area used by user's application, the whole RAM can be used as data area for storing and loading
general data.
ADDRESSING MODE
The 1012 nibble data memory consists of four banks (bank 0 ~ bank 3). There are 244x4 bits (address
000h~0F3h) in bank 0 and 768x4 bits (address 100h ~ 3FFh) in bank 1 ~ bank 3.
The bank is selected by P9.
P9Initial value : * * 0 0
* * RBK
RBKRAM bank
0 0Bank0
0 1Bank1
1 0Bank2
1 1Bank3
The Data Memory consists of three Address mode, namely -
(1) Indirect addressing mode:
The address in the bank is specified by the HL registers.
P9(1,0)
HRLR
RAM address
* This specification are subject to be changed without notice.
8.16.2001
8
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
Preliminary
PROGRAM EXAMPLE: Load the data of RAM address "143h" to RAM address "032h".
OUT#0001B,P9; RAM bank1
LDL#3h; LR← 3
LDH# 4h; HR← 4
LDAM; Acc← RAM[134h]
OUT#0000B,P9; RAM bank0
LDL#2h; LR← 2
LDH# 3h; HR← 3
STAM; RAM[023h]← Acc
(2) Direct addressing mode:
The address in the bank is directly specified by 8 bits code of the second byte in the instruction field.
instruction field
xxxxxxxx
P9(1,0)
EM73A89B
RAM address
PROGRAM EXAMPLE: Load the data of RAM address "143h" to RAM address "023h".
OUT#0001B,P9
LDA43h; Acc← RAM[143h]
OUT#0000B,P9
STA23h; RAM[023h]← Acc
(3) Zero-page addressing mode:
The zero-page is in the bank 0 (address 000h~00Fh). The address is the lower 4 bits code of the second byte
in the instruction field.
xxxxxxxx
instruction field
yyyy
0000
yyyy
RAM address
PROGRAM EXAMPLE: Write immediate "0Fh" to RAM address "005h".
STD#0Fh, 05h; RAM[05h]← 0Fh
00
* This specification are subject to be changed without notice.
8.16.2001
9
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
PROGRAM COUNTER (16K ROM)
Preliminary
Program counter ( PC ) is composed by a 13-bit counter, which indicates the next executed address for the
instruction of program ROM instruction.
For BRANCH and CALL instructions, PC is changed by instruction indicating. PC only can indicate the address
from 0000h-1FFFh. The bank number is decided by P3.
(1) Branch instruction:
SBR a
Object code: 00aa aaaa
Condition: SF=1; PC ← PC
( branch condition satisified )
12-6.a
PC Hold original PC value+1aaaaaa
SF=0; PC← PC +1( branch condition not satisified )
PC Original PC value + 1
LBR a
Object code: 1100 aaaa aaaa aaaa
Condition: SF=1; PC ← PC
( branch condition satisified )
12.a
Hold
PC
a a a a a a aaaaaa
+2
SF=0; PC← PC +2( branch condition not satisified )
Condition: SF=1; PC ← a ( branch condition satisified )
PCaaaaaaaaaaaa a
SF=0 ; PC ← PC + 3 ( branch condition not satisified )
PCOriginal PC value + 3
(2) Subroutine instruction:
SCALL a
Object code: 1110 nnnn
Condition : PC ← a ; a=8n+6 ; n=1..Fh ; a=86h, n=0
PC00000aaaaa aaa
LCALL a
Object code: 0100 0aaa aaaa aaaa
Condition: PC ← a
* This specification are subject to be changed without notice.
8.16.2001
10
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
Preliminary
PC00aaaaaaaaaa a
RET
Object code: 0100 1111
Condition: PC ← STACK[SP]; SP + 1
PCThe return address stored in stack
RT I
Object code: 0100 1101
Condition : FLAG. PC ← STACK[SP]; EI ← 1; SP + 1
PCThe return address stored in stack
(3) Interrupt acceptance operation:
When an interrupt is accepted, the original PC is pushed into stack and interrupt vector will be loaded into
PC. The interrupt vectors are as follows :
INT0 (External interrupt from P8.2)
PC00000000000 1 0
SPI (speech end interrupt)
PC000000000010 0
TRGA (Timer A overflow interrupt)
PC0000000000 1 1 0
TRGB (Time B overflow interrupt)
PC00000000 0 1 0 0 0
TBI (Time base interrupt)
PC00000000 0 1 0 1 0
INT1 (External interrupt from P8.0)
PC00000000 0 1 1 0 0
(4) Reset operation:
PC00000000000 0 0
* This specification are subject to be changed without notice.
8.16.2001
11
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
Preliminary
(5) Other operations:
For 1-byte instruction execution: PC + 1
For 2-byte instruction execution: PC + 2
For 3-byte instruction execution: PC + 3
ACCUMULATOR
Accumulator(ACC) is a 4-bit data register for temporary data storage. For the arithematic, logic and
comparative opertion.., ACC plays a role which holds the source data and result.
FLAGS
There are three kinds of flag, CF ( Carry flag ), ZF ( Zero flag ) and SF ( Status flag ), these three 1-bit flags
are included by the arithematic, logic and comparative .... operation.
All flags will be put into stack when an interrupt subroutine is served, and the flags will be restored after
RTI instruction is executed.
(1) Carry Flag ( CF )
The carry flag is affected by the following operations:
a. Addition : CF as a carry out indicator, under addition operation, when a carry-out occures, the CF is "1",
likewise, if the operation has no carry-out, CF is "0".
b. Subtraction : CF as a borrow-in indicator, under subtraction operation, when a borrow occures, the CF
is "0", likewise, if there is no borrow-in, the CF is "1".
c. Comparision : CF as a borrow-in indicator for Comparision operation as in the subtraction operation.
d. Rotation : CF shifts into the empty bit of accumulator for the rotation and holds the shift out data after
rotation.
e. CF test instruction : Under TFCFC instruction, the CF content is sent into SF then clear itself as "0".
Under TTSFC instruction, the CF content is sent into SF then set itself as "1".
(2) Zero Flag ( ZF )
ZF is affected by the result of ALU, if the ALU operation generates a "0" result, the ZF is "1", likewise, the
ZF is "0".
(3) Status Flag ( SF )
The SF is affected by instruction operation and system status.
a. SF is initiated to "1" for reset condition.
b. Branch instruction is decided by SF, when SF=1, branch condition is satisified, likewise, when SF = 0,
branch condition is unsatisified.
* This specification are subject to be changed without notice.
8.16.2001
12
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
PROGRAM EXAMPLE:
Preliminary
Check following arithematic operation for CF, ZF, SF
The arithematic operation of 4-bit data is performed in ALU unit. There are 2 flags that can be affected by
the result of ALU operation, ZF and SF. The operation of ALU is affected by CF only.
ALU STRUCTURE
ALU supported user arithematic operation functions, including Addition, Subtraction and Rotaion.
DATA BUS
ALU
ZF CF SF
ALU FUNCTION
(1) Addition:
ALU supports addition function with instructions ADDAM, ADCAM, ADDM #k, ADD #k,y .... .
The addition operation affects CF and ZF. Under addition operation, if the result is "0", ZF will be "1",
otherwise, ZF will be "0". When the addition operation has a carry-out, CF will be "1", otherwise, CF will
be "0".
ALU supports subtraction function with instructions SUBM #k, SUBA #k, SBCAM, DECM... . The
subtraction operation affects CF and ZF. Under subtraction operation, if the result is negative, CF will
be "0", and a borrow out, otherwise, if the result is positive, CF will be "1". For ZF, if the result of subtraction
operation is "0", the ZF is "1", likewise, ZF is "1".
* This specification are subject to be changed without notice.
8.16.2001
13
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
EXAMPLE:
Preliminary
Operation Carry Zero
8-4=410
7-F= -8(1000)00
9-9=011
(3) Rotation:
Two types of rotation operation are available, one is rotation left, the other is rotation right.
RLCA instruction rotates Acc value counter-clockwise, shift the CF value into the LSB bit of Acc and hold
the shift out data in CF.
MSBLSB
ACC
CF
RRCA instruction operation rotates Acc value clockwise, shift the CF value into the MSB bit of Acc and
hold the shift out data in CF.
MSBLSB
ACC
CF
PROGRAM EXAMPLE: To rotate Acc clockwise (right) and shift a "1" into the MSB bit of Acc.
TTCFS; CF ← 1
RRCA; rotate Acc right and shift CF=1 into MSB.
HL REGISTER
HL register are two 4-bit registers, they are used as a pair of pointer for the RAM memoryaddress. They are
used as also 2 independent temporary 4-bit data registers. For certain instructions, L register can be a pointer
to indicate the pin number (Port4 only).
HL REGISTER STRUCTURE
3 2 1 0
H REGISTER
3 2 1 0
L REGISTER
HL REGISTER FUNCTION
(1) HL register is used as a temporary register for instructions : LDL #k, LDH #k, THA, THL, INCL, DECL,
EXAL, EXAH.
PROGRAM EXAMPLE:
LDL #05h;
LDH #0Dh;
Load immediate data "5h" into L register, "0Dh" into H register.
(2) HL register is used as a pointer for the address of RAM memory for instructions : LDAM, STAM, STAMI ..
PROGRAM EXAMPLE: Store immediate data "#0Ah" into RAM of address 35h.
* This specification are subject to be changed without notice.
8.16.2001
14
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
Preliminary
LDL #5h;
LDH #3h;
STDMI #0Ah; RAM[35] ← Ah
(3) L register is used as a pointer to indicate the bit of I/O port for instructions : SELP, CLPL, TFPL,
(When LR = 0 indicate P4.0)
PROGRAM EXAMPLE: To set bit 0 of Port4 to "1"
LDL#00h;
SEPL ; P4.0 ← 1
STACK POINTER (SP)
Stack pointer is a 4-bit register that stores the present stack level number.
Before using stack, user must set the SP value first, CPU will not initiate the SP value after reset condition.
When a new subroutine is received, the SP is decreased by one automatically, likewise, if returning from a
subroutine, the SP is increased by one.
The data transfer between ACC and SP is done with instructions "LDASP" and "STASP".
DATA POINTER (DP)
Data pointer is a 12-bit register that stores the ROM address can indicating the ROM code data specified
by user (refer to data ROM).
CLOCK AND TIMING GENERATOR
The clock generator is supported by a dual clock system. The high-frequency oscillator is internal oscillator.
The low-frequency oscillator may be sourced from crystal, the working frequency is 32 KHz.
CLOCK GENERATOR STRUCTURE
There are two clock generator for system clock control unit, P14 is the status register that hold the CPU
status. P16, P19 and P22 are the command register for system clock mode control.
CLK
LXIN
LXOUT
High-frequency
generator
Low-frequency
generator
fc
System clock
fs
mode control
P14
P16
P19
P22
LXIN
LXOUT
Crystal connection
VDD
* This specification are subject to be changed without notice.
System control
R
LXIN
open
RC oscillator connection
R=2.2MΩ
LXOUT
8.16.2001
15
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
SYSTEM CLOCK MODE CONTROL
Preliminary
The system clock mode controller can start or stop the high-frequency and low-frequency clock oscillator
and switch between the basic clocks. EM73A89B has four operation modes (DUAL, SLOW, IDLE and
STOP operation modes).
The 4-bit µc is in the DUAL operation mode when the CPU is reseted. This mode is dual clock system
(high-frequency and low-frequency clocks oscillating). It can be changed to SLOW or STOP operation
mode with the command register (P22 or P16).
LCD display, speech synthesizer and sound generator are available for the DUAL operation mode.
SLOW OPERATION MODE
The SLOW operation mode is single clock system (low-frequency clock oscillating). It can be changed to
the DUAL operation mode with the command register (P22), STOP operation mode with P16 and IDEL
operation mode with P19.
LCD display is available for the SLOW operation mode. Speech synthesizer and sound generator are
disabled in this mode.
* This specification are subject to be changed without notice.
8.16.2001
16
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
P223210Initial value : ***0
Preliminary
* ** SOM
SOMSelect operation mode
0DUAL operation mode
1SLOW operation mode
P1432 10 Initial value : 0000
ACT WKS SINT CPUS
CPUSCPU statusWKSWakeup status
0DUAL operation mode0Wakeup not by internal timer
1SLOW operation mode1Wakeup by internal timer
Port14 is the status register for CPU. P14.0 (CPU status) is a read-only bit. P14.2 (wakeup status) will be
set as "1" when CPU is waked by internal timer. P14.2 will be cleared as "0" when user out data to P14.
P14.1 is the interrupt source selector (refer to interrupt). P14.3 is the speech acknowledge signal (refer to
speech synthesizer control).
IDLE OPERATION MODE
The IDLE operation mode suspends all CPU functions except the low-frequency clock oscillation and the
LCD driver. It keeps the internal status with low power consumption without stopping the slow clock
oscillator and LCD display.
LCD display is available for the IDLE operation mode. The high speed counter and speech synthesizer are
disabled in this mode. The IDLE operation mode will be wakeup and return to the SLOW operation mode by
the internal timing generator or I/O pins (P0(0..3)/WAKEUP 0..3 and P8(0..3)/WAKEUPA..D).
0 1Enable IDLE mode0 0P0(0..3), P8(0..3) pin input
* *no function0 1P0(0..3), P8(0..3) pin input and 1 sec signal
1 0P0(0..3), P8(0..3) pin input and 0.5 sec signal
1 1P0(0..3), P8(0..3) pin input and 15.625 ms signal
STOP OPERATION MODE
The STOP operation mode suspends system operation and holds the internal status immediately before the
suspension with low power consumption. This mode will be released by reset or I/O pins (P0(0..3)/
WAKEUP 0..3 or P8(0..3)/WAKEUP A..D).
LCD display, high speed counter and speech synthesizer are disabled in this mode.
* This specification are subject to be changed without notice.
8.16.2001
17
EM73A89B
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
Preliminary
P163210Initial value : *000
* SWWT
SWWTEnable STOP mode
1 0 1Enable STOP mode
* * *no function
GENERAL PURPOSE REGISTER (P10)
P10 is a 4-bit general purpose register which can be read, written and rested by all I/O instructions.
(including : INA, INM, OUT, OUTA, OUTM, SEP, CLP, TTP, TFP)
PROGRAM EXAMPLE:
CHIP ROM16K
;--------RAM define area-----------------
DSEG
ORG10H
HLBUF:RES2; HL buffer for interrupt
P9BUF:RES1; P9 (RAM bank) buffer for interrupt