4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
GENERAL DESCRIPTIONGENERAL DESCRIPTION
GENERAL DESCRIPTION
GENERAL DESCRIPTIONGENERAL DESCRIPTION
EM73361A is an advanced single chip CMOS 4-bit micro-controller. It contains 3K-byte ROM, 52-nibble RAM,
4-bit ALU, 13-level subroutine nesting, 22-stage time base, two 12-bit timer/counters for the kernel function.
EM73361A also contains 3 interrupt sources, 1 input port, 4 bidirection I/O ports, built-in watch-dog-timer
counter, tone generator and LCD driver (27x3 to 13x3).
Except low-power consumption and high speed, EM73361A also have a sleep mode operation for power saving.
FEATURESFEATURES
FEATURES
FEATURESFEATURES
• Operation voltage: 2.2V to 3.6V(clock frequency : 32K Hz).
• Clock source: Single clock system for crystal, connect a external resistor or external clock
source available by mask option.
• Instruction set: 109 powerful instructions.
• Instruction cycle time: 122µs for 32K Hz.
• ROM capacity: 3072 X 8 bits.
• RAM capacity: 52 X 4 bits.
• Input port: 1 port (P0)(Pull-up and pull-down resistor with wakeup function available by
mask option).
• Bidirection port: 4 ports (P4, P5, P6, P7) are available by mask option. (each I/O pin is push-pull
and open-drain available by mask option) P4.0 is high current pin (P4.0 and
TONE available by mask option). P4.2~P4.3, P5, P6 and P7 are shared with
SEG26-SEG13 by mask option.
• 12-bit timer/counter: Two 12-bit timer/counters are programmable for timer mode.
• Low voltage reset (LVR) : Reset at 1.5V, and reset release at 1.8V.
• Tone generator: There is a built-in tone generator.
• LCD driver: 27 X 3 to 13 X 3 dots available by mask option. Capacitor divider and resistor
divider are available by mask option.1/3, 1/2 and static three kinds of duty (1/2
bias) selectable. The programming method of LCD driver is I/O mapping.
• Built-in watch-dog-timer : The WDT is enabled or disabled by mask option.
• Power saving function: Sleep mode and Hold mode.
TONEBuilt-in tone generator output
VA, VB, VEEConnect the capacitors for LCD bias voltage
COM0~COM2LCD common output pins
SEG0~SEG12LCD segment output pins
TESTTie Vss as package type, no connecting as COB type
FUNCTION DESCRIPTIONSFUNCTION DESCRIPTIONS
FUNCTION DESCRIPTIONS
FUNCTION DESCRIPTIONSFUNCTION DESCRIPTIONS
Pin-typePin-type
Pin-type
Pin-typePin-type
FunctionFunction
Function
FunctionFunction
wakeup disable, pull-up
wakeup disable, pull-down
wakeup disable, none
mask option :TONE enable, push-pull, high current PMOS
TONE disable, open-drain
TONE disable, push-pull, high current PMOS
TONE disable, push-pull, low current PMOS
mask option :open-drain
push-pull
PROGRAM ROM ( 3K X 8 bits )PROGRAM ROM ( 3K X 8 bits )
PROGRAM ROM ( 3K X 8 bits )
PROGRAM ROM ( 3K X 8 bits )PROGRAM ROM ( 3K X 8 bits )
3 K x 8 bits program ROM contains user's program and some fixed data .
The basic structure of program ROM can be divided into 4 parts.
1. Address 000h: Reset start address.
2. Address 002h - 00Ch: 4 kinds of interrupt service routine entry addresses .
3. Address 00Eh-086h : SCALL subroutine entry address, only available at 00Eh,016h,01Eh,026h, 02Eh,
036h, 03Eh, 046h, 04Eh, 056h, 05Eh, 066h, 06Eh, 076h ,07Eh, 086h .
5. Address 000h - BFFh : Except used as above function, the other region can be used as user's program region.
address 3072 x 8 bits
000hReset start address
002hINT0 ; External interrupt service toutine entry address
004h
006hTRGA; Timer/counter A interrupt service routine entry address
008hTRGB; Timer/counter B interrupt service routine entry address
00AhTBI; Time base interrupt service routine entry address
00Ch INT1; External interrupt service routine entry address
00Eh
086h
.
.
.
BFFh
SCALL, subroutine call entry address
* This specification are subject to be changed without notice.
10.8.2001
4
Page 5
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
User's program and fixed data are stored in the program ROM. User's program is according the PC value
to send next executed instruction code. Fixed data can be read out by table-look-up instruction.
Table-look-up instruction is depended on the Data Pointer ( DP ) to indicate to ROM address, then to get the
ROM code data.
LDAXLDAX
LDAX
LDAXLDAX
LDAXILDAXI
LDAXI
LDAXILDAXI
Acc Acc
Acc
Acc Acc
Acc Acc
Acc
Acc Acc
←←
ROM[DP] ROM[DP]
←
ROM[DP]
←←
ROM[DP] ROM[DP]
←←
ROM[DP] ROM[DP]
←
ROM[DP]
←←
ROM[DP] ROM[DP]
LL
L
LL
,DP+1,DP+1
,DP+1
,DP+1,DP+1
HH
H
HH
DP is a 12-bit data register which can store the program ROM address to be the pointer for the ROM code data.
First, user load ROM address into DP by instruction "STADPL, STADPM, STADPH", then user can get 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 777h by table-look-up instruction.
There is total 52 - nibble data RAM from address 00 to 33h
Data RAM includes 3 parts: zero page region, stacks and data area.
Increment
Address
00h - 0Fh
10h - 1Fh
20h - 2Fh
30h - 33h
Level 0
Level 4
Level 8
Level 12
Level 1
Level 2
Level 5
Level 6
Level 9
Level 10
StackZero-page
Level 3
Level 7
Level 11
ZERO- PAGE:
From 00h to 0Fh is the location of zero-page. It is used as the pointer in zero -page addressing mode for the
instruction of "STD #k,y; ADD #k,y; CLR y,b; CMP k,y".
PROGRAM EXAMPLE: To wirte immediate data "07h" to address "03h" of RAM and to clear bit 2 of RAM.
There are 13 - level (maximum) stack for user using for subroutine (including interrupt and CALL). User
can assign any level be the starting stack by giving the level number to stack pointer (SP).
* This specification are subject to be changed without notice.
Increment
10.8.2001
5
Page 6
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
When user using any instruction of CALL or subroutine, before entry the subroutine, the previous PC address
will be saved into stack until return from those subroutines, the PC value will be restored by the data saved
in stack.
DATA AREA:
Except the special area used by user, the whole RAM can be used as data area for storing and loading general
data.
ADDRESSING MODE
(1) Indirect addressing mode:
Indirect addressing mode indicates the RAM address by specified HL register.
For example:
LDAM ; Acc ← RAM[HL]
STAM ; RAM[HL] ← Acc
(2) Direct addressing mode:
Direct addressing mode indicates the RAM address by immediate data.
For example: LDA x ; Acc← RAM[x]
STA x ; RAM[x] ← Acc
(3) Zero-page addressing mode
For zero-page region, user can using direct addressing to write or do any arithematic, comparsion or bit
manupulated operation directly.
For example: STD #k,y ; RAM[y] ← #k
ADD #k,y; RAM[y] ← RAM[y] + #k
PROGRAM COUNTER (3K ROM)PROGRAM COUNTER (3K ROM)
PROGRAM COUNTER (3K ROM)
PROGRAM COUNTER (3K ROM)PROGRAM COUNTER (3K ROM)
Program counter ( PC ) is composed by a 12-bit counter, which indicates the next executed address for the
instruction of program ROM.
For a 3K - byte size ROM, PC can indicate address form 000h - BFFh, for BRANCH and CALL instrcutions,
PC is changed by instruction indicating.
(1) Branch instruction:(1) Branch instruction:
(1) Branch instruction:
(1) Branch instruction:(1) Branch instruction:
SBR aSBR a
SBR a
SBR aSBR a
Object code: 00aa aaaa
Condition: SF=1; PC ← PC
( branch condition satisified )
11-6.a
PC Hold original PC value+1 aaaaaa
SF=0; PC← PC +1( branch condition not satisified)
PC Original PC value + 1
LBR aLBR a
LBR a
LBR aLBR a
Object code: 1100 aaaa aaaa aaaa
Condition: SF=1; PC ← a ( branch condition satisified)
PCaaaaaaaaaaaa
* This specification are subject to be changed without notice.
10.8.2001
6
Page 7
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
SF=0 ; PC ← PC + 2 ( branch condition not satisified )
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 following:
INT0 INT0
INT0 (External interrupt from P0.2)
INT0 INT0
PC000000000010
TRGATRGA
TRGA (Timer A overflow interrupt)
TRGATRGA
PC000000000110
TRGBTRGB
TRGB (Time B overflow interrupt)
TRGBTRGB
PC000000001000
TBITBI
TBI (Time base interrupt)
TBITBI
PC000000001010
* This specification are subject to be changed without notice.
10.8.2001
7
Page 8
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
INT1 INT1
INT1 (External interrupt from P0.0)
INT1 INT1
PC000000001100
(4) Reset operation:(4) Reset operation:
(4) Reset operation:
(4) Reset operation:(4) Reset operation:
PC000000000000
(5) Other operations:(5) Other operations:
(5) Other operations:
(5) Other operations:(5) Other operations:
For 1-byte instruction execution: PC + 1
For 2-byte instruction execution: PC + 2
ACCUMULATORACCUMULATOR
ACCUMULATOR
ACCUMULATORACCUMULATOR
Accumulator is a 4-bit data register for temporary data . For the arithematic, logic and comparative opertion
.., ACC plays a role which holds the source data and result .
FLAGSFLAGS
FLAGS
FLAGSFLAGS
There are four kinds of flag, CF ( Carry flag ), ZF ( Zero flag ), SF ( Status flag ) and GF ( General flag ),
these 4 1-bit flags are affected 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 executed .
(1) Carry Flag ( CF )
The carry flag is affected by following operation:
a. Addition : CF as a carry out indicator, when the addition operation has a carry-out, CF will be "1",
in another word, if the operation has no carry-out, CF will be "0".
b. Subtraction : CF as a borrow-in indicator, when the subtraction operation must has a borrow, in the CF
will be "0", in another word, if no borrow-in, CF will be "1".
c. Comparision: CF is as a borrow-in indicator for Comparision operation as the same as 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 : For TFCFC instruction, the content of CF sends into SF then clear itself "0".
For TTSFC instruction, the content of CF sends into SF then set itself "1".
(2) Zero Flag ( ZF )
ZF is affected by the result of ALU, if the ALU operation generate a "0" result, the ZF will be "1",
otherwise, the ZF will be "0".
(3) Status Flag ( SF )
The SF is affected by instruction operation and system status .
* This specification are subject to be changed without notice.
10.8.2001
8
Page 9
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
a. SF is initiated to "1" for reset condition .
b. Branch instruction is decided by SF, when SF=1, branch condition will be satisified, otherwise,
branch condition will not be satisified by SF = 0 .
(4) General Flag ( GF )
GF is a one bit general purpose register which can be set, clear, test by instruction SGF, CGF and TGS.
PROGRAM EXAMPLE:
Check following arithematic operation for CF, ZF, SF
The arithematic operation of 4 - bit data is performed in ALU unit . There are 2 flags can be affected by
the result of ALU operation, ZF and SF . The operation of ALU can be affected by CF only .
ALU STRUCTUREALU STRUCTURE
ALU STRUCTURE
ALU STRUCTUREALU STRUCTURE
ALU supported user arithematic operation function, including : addition, subtraction and rotaion.
DATA BUS
ALU
ZF CF SF GF
ALU FUNCTIONALU FUNCTION
ALU FUNCTION
ALU FUNCTIONALU FUNCTION
(1) Addition:
For instruction ADDAM, ADCAM, ADDM #k, ADD #k,y .... ALU supports addition function.
The addition operation can affect CF and ZF. For addition operation, if the result is "0", ZF will be "1",
otherwise, not equal "0", ZF will be "0", When the addition operation has a carry-out. CF will be "1",
otherwise, CF will be "0".
For instruction SUBM #k, SUBA #k, SBCAM, DECM... ALU supports user subtraction function . The
subtraction operation can affect CF and ZF, For subtraction operation, if the result is negative, CF will
* This specification are subject to be changed without notice.
10.8.2001
9
Page 10
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
be "0", it means 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 will be "1", otherwise, ZF will be "1".
EXAMPLE:
There are two kinds of rotation operation, one is rotation left, the other is rotation right.
RLCA instruction rotates Acc value to left, shift the CF value into the LSB bit of Acc and the shift out data
will be hold in CF.
MSBLSB
ACC
CF
RRCA instruction operation rotates Acc value to right, shift the CF value into the MSB bit of Acc and the
shift out data will be hold in CF.
MSBLSB
ACC
CF
PROGRAM EXAMPLE: To rotate Acc 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 REGISTERHL REGISTER
HL REGISTER
HL REGISTERHL REGISTER
HL register are two 4-bit registers, they are used as a pair of pointer for the address of RAM memory and also
2 independent temporary 4-bit data registers. For some instruction, L register can be a pointer to indicate the
pin number ( Port4, Port6, Port7 ) .
HL REGISTER STRUCTUREHL REGISTER STRUCTURE
HL REGISTER STRUCTURE
HL REGISTER STRUCTUREHL REGISTER STRUCTURE
HL REGISTER FUNCTIONHL REGISTER FUNCTION
HL REGISTER FUNCTION
HL REGISTER FUNCTIONHL REGISTER FUNCTION
3 2 1 0
H REGISTER
3 2 1 0
L REGISTER
(1)For instruction : LDL #k, LDH #k, THA, THL, INCL, DECL, EXAL, EXAH, HL register used as a
temporary register .
PROGRAM EXAMPLE: Load immediate data "5h" into L register, "Dh" into H register.
LDL #05h;
LDH #0Dh;
(2) For instruction LDAM, STAM, STAMI .., HL register used as a pointer for the address of RAM memory.
* This specification are subject to be changed without notice.
10.8.2001
10
Page 11
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
PROGRAM EXAMPLE: Store immediate data #Ah into RAM of address 35h.
LDL #5h;
LDH #3h;
STDMI #0Ah; RAM[35] ← Ah
(3) For instruction : SELP, CLPL, TFPL, L regieter be a pointer to indicate the bit of I/O port.
When LR = 0 - 1, indicate P4.0 - P4.1.
PROGRAM EXAMPLE: To set bit 1 of Port4 to "1"
LDL #01h;
SEPL ; P4.1 ← 1
STACK POINTER (SP)STACK POINTER (SP)
STACK POINTER (SP)
STACK POINTER (SP)STACK POINTER (SP)
Stack pointer is a 4-bit register which 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 accepted, the SP will be decreased one automatically, in another word, if
returning from a subroutine, the SP will be increased one .
The data transfer between ACC and SP is by instruction of "LDASP" and "STASP".
DATA POINTER (DP)DATA POINTER (DP)
DATA POINTER (DP)
DATA POINTER (DP)DATA POINTER (DP)
Data pointer is a 12-bit register which stores the address of ROM can indicate the ROM code data
specified by user (refer to data ROM).
CLOCK AND TIMING GENERATORCLOCK AND TIMING GENERATOR
CLOCK AND TIMING GENERATOR
CLOCK AND TIMING GENERATORCLOCK AND TIMING GENERATOR
The clock generator is supported by a single clock system, the clock source comes from crystal (resonator)
or RC oscillation, the working frequency range is 32 KHz to 100 KHz depending on the working voltage.
CLOCK AND TIMING GENERATOR STRUCTURECLOCK AND TIMING GENERATOR STRUCTURE
CLOCK AND TIMING GENERATOR STRUCTURE
CLOCK AND TIMING GENERATOR STRUCTURECLOCK AND TIMING GENERATOR STRUCTURE
The clock generator connects outside compoments ( crystal or resonator by XIN and XOUT pin for crystal
osc type, capacitor for RC osc type, these two type is decided by mask option) the clock generator generates
a basic system clock "fc".
When CPU sleeping, the clock generator will be stoped until the sleep condition released.
The system clock control generates 4 basic phase signals ( S1, S2, S3, S4 ) and system clock .
XIN
XIN/CLK
Mask option
sleep
fc
Mask option for choose Crystal or RC oscillation
System clock
clock generatorSystem clock control
XOUT
* This specification are subject to be changed without notice.
S1S2S3S4
10.8.2001
11
Page 12
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
XIN
XOUT
Crystal connection
CLOCK AND TIMING GENERATOR FUNCTIONCLOCK AND TIMING GENERATOR FUNCTION
CLOCK AND TIMING GENERATOR FUNCTION
CLOCK AND TIMING GENERATOR FUNCTIONCLOCK AND TIMING GENERATOR FUNCTION
Resistor connection
XIN
XOUT
The frequency of fc is the oscillation frequency for XIN, XOUT by crystal ( resonator) or by RC osc.
When CPU sleeps, the XOUT pin will be in "high" state .
The instruction cycle equal 4 basic clock fc.
1 instructure cycle = 4 / fc
TIMING GENERATOR AND TIME BASETIMING GENERATOR AND TIME BASE
TIMING GENERATOR AND TIME BASE
TIMING GENERATOR AND TIME BASETIMING GENERATOR AND TIME BASE
The timing generator produces the system clock from basic clock pulse which can be normal mode or slow
mode clock.
1 instruction cycle = 4 basic clock pulses
There are 22 stages time base .
Prescaler
Binary counter
fc
123
056 789 10 11 12 134212019 181716 15 14
When working in the single clock mode, the timebase clock source is come from fc.
Time base provides basic frequency for following function:
1. TBI (time base interrupt) .
2. Timer/counter, internal clock source.
3. Warm-up time for sleep - mode releasing.
TIME BASE INTERRUPT (TBI )TIME BASE INTERRUPT (TBI )
TIME BASE INTERRUPT (TBI )
TIME BASE INTERRUPT (TBI )TIME BASE INTERRUPT (TBI )
The time base can be used to generate a fixed frequency interrupt . There are 8 kinds of frequencies can be
selected by setting "P25"
Single clock mode
P25 3210
( initial value 0000 )
0 0 x x: Interrupt disable
0 1 0 0: Interrupt frequency XIN / 29 Hz
0 1 0 1: Interrupt frequency XIN / 2
0 1 1 0: Interrupt frequency XIN / 2
0 1 1 1: Interrupt frequency XIN / 2
1 1 0 0: Interrupt frequency XIN / 2
1 1 0 1: Interrupt frequency XIN / 2
1 1 1 0: Interrupt frequency XIN / 2
1 1 1 1: Interrupt frequency XIN / 2
1 0 x x: Reserved
10
Hz
12
Hz
13
Hz
14
Hz
15
Hz
16
Hz
17
Hz
* This specification are subject to be changed without notice.
10.8.2001
12
Page 13
EM73361AEM73361A
i
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
EM73361A only can support timer function for timerA and timerB independently.
For timerA, the counter data is saved in timer register TAH, TAM, TAL, which user can set counter initial
value and read the counter value by instruction "LDATAH(M,L), STATAH(M,L)" and timerB register is
TBH, TBM, TBL and W/R instruction "LDATBH (M,L), STATBH (M,L)".
The basic structure of timer/counter is composed by two same structure counter, these two counters can be
set initial value and send counter value to timer register, P28 and P29 are the command ports for timerA
and timer B, user can choose different internal clock rate by setting these two ports. When timer/counter
overflow, it will generate a TRGA(B) interrupt request to interrupt control unit.
INTERRUPT CONTROL
TRGA request
DATA BUS
12 BIT COUNTER
nternal clock
TIMER/COUNTER CONTROLTIMER/COUNTER CONTROL
TIMER/COUNTER CONTROL
TIMER/COUNTER CONTROLTIMER/COUNTER CONTROL
P28
TIMER CONTROL
TMSAIPSA
P29
TRGB request
12 BIT COUNTER
TIMER CONTROL
TMSBIPSB
internal clock
Timer/counter command port: P28 is the command port for timer/counterA and P29 is for the timer/
counterB.
Port 28
3 2 1 0
TMSA IPSA
Initial state: 0000
TIMER/COUNTER MODE SELECTION
TMSA (B) Function description
0 0Stop
0 1Reserved
Port 29
3 2 1 0
TMSB IPSB
Initial state: 0000
1 0Timer mode
1 1Reserved
INTERNAL PULSE-RATE SELECTION
IPSA(B) Function description
0 0XIN/2 Hz
0 1XIN/2 Hz
1 0XIN/2 Hz
1 1XIN/2 Hz
* This specification are subject to be changed without notice.
11
15
5
7
10.8.2001
13
Page 14
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
TIMER/COUNTER FUNCTIONTIMER/COUNTER FUNCTION
TIMER/COUNTER FUNCTION
TIMER/COUNTER FUNCTIONTIMER/COUNTER FUNCTION
Each timer/counter can execute the timer function independly.
TIMER MODE
For timer mode ,timer/counter increase one at any rising edge of internal pulse . User can choose 4 kinds
of internal pulse rate by setting IPSB for timerB (IPSA for timerA).
When timer/counter counts overflow, TRGB (TRGA) will be generated to interrupt control unit.
Internal pulse
TimerB (TimerA )value
nn+1n+2n+3n+4n+5n+6
n+7
PROGRAM EXAMPLE: To generate TRGA interrupt request after 60 ms with system clock XlN=32K Hz
NOTE:The preset value of timer/counter register is calculated as following procedure.
Internal pulse rate: XIN/2
5
; XIN = 32KHz
The time of timer counter count one = 25 /XIN = 32/32K=1ms
The number of internal pulse to get timer overflow = 60 ms/ 1ms = 60 = 03CH
The preset value of timer/counter register = 1000H - 03CH = 0FC4H
INTERRUPT FUNCTIONINTERRUPT FUNCTION
INTERRUPT FUNCTION
INTERRUPT FUNCTIONINTERRUPT FUNCTION
There are 3 internal interrupt sources and 2 external interrupt sources. Multiple interrupts are admitted
according the priority .
* This specification are subject to be changed without notice.
10.8.2001
15
Page 16
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
POWER SAVING FUNCTION ( Sleep / Hold function )POWER SAVING FUNCTION ( Sleep / Hold function )
POWER SAVING FUNCTION ( Sleep / Hold function )
POWER SAVING FUNCTION ( Sleep / Hold function )POWER SAVING FUNCTION ( Sleep / Hold function )
During sleep and hold condition, CPU holds the system's internal status with a low power consumption, for
the sleep mode, the system clock will be stoped in the sleep condition and system need a warm up time for
the stability of system clock running after wakeup . In the other way, for the hold mode, the system clock
does not stop at all and it does not need a warm-up time any way.
The sleep and hold mode is controlled by Port 16 and released by P0(0..3)/WAKEUP0..3.
P16 3 2 1 0
WM SE SWWT
SWWT Set wake-up warm-up time
0 0
0 1
1 0
1 1
17
2 /XIN
13
2 /XIN
15
2 /XIN
Hold mode
initial value :0000
WM Set wake-up release mode
01Wake-up in edge release mode
Reserved
SE Enable sleep/hold
0 Reserved
1 Enable sleep / hold rnode
Sleep and hold condition:
1. Osc stop ( sleep only ) and CPU internal status held .
2. Internal time base clear to "0".
3. CPU internal memory ,flags, register, I/O held original states.
4. Program counter hold the executed address after sleep release.
Release condition:
1. Osc start to oscillating.(sleep only).
2. Warm-up time passing ( sleep only ).
3. According PC to execute the following program.
There is one kind of sleep/hold release mode .
1. Edge release mode:
Release sleep/hold condition by the falling edge of any one of P0(0..3)/WAKEUP0..3.
Note : There are 4 independent mask options for wakeup function in EM73360. So, the wakeup function
of P0(0..3)/WAKEUP0..3 are enabled or disabled inpendently.
LCD DRIVERLCD DRIVER
LCD DRIVER
LCD DRIVERLCD DRIVER
EM73361A can directly drive the liquid crystal display (LCD) and has 27 segment, 3 common output pins. There
are total 27 x 3 dots can be display. The VDD, VEE and VSS pins are the bias voltage inputs of the LCD driver.
The VA and VB are used to the voltage double for 3V system. The method of LCD programming is I/O
mapping.
CONTROL OF LCD DRIVERCONTROL OF LCD DRIVER
CONTROL OF LCD DRIVER
CONTROL OF LCD DRIVERCONTROL OF LCD DRIVER
The LCD driver control command register is P27. When LDC is 00, the LCD is disabled. When LDC is 01,
the LCD is blanking,
* This specification are subject to be changed without notice.
10.8.2001
16
Page 17
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
the COM pins are inactive and the SEG pins continously output the display data. When LDC is 11, the LCD
driver enables, the power swich is turned on and it cannot be turned off forever except the CPU is reseted or
sleeping. Users must enable the LCD driver by self when the CPU is waked up.
There are four kinds of driving methods can be selected by DUTY (P27.0~P27.1). The driving waveforms of
LCD driver are as below :
1/3 duty (1/2 bias)1/2duty (1/2 bias)Static
C
C
SEG0
SEG1
SEG2
C
O
O
O
M
M
M
2
1
0
:
COM0
COM1
COM2
SEG0
SEG0-COM0
ON
ON
OFF
SEG0-COM1
OFF
Frame
Frame
Frame
LCD Frame frequency : According to the drive method to set the frame frequency.
Driving methodFrame frequency (Hz)
1/3 duty43 x (3/3) = 43
1/2 duty43 x (3/2) = 64
Static43
The relation between LCD display data and driving method
Driving methodbit3bit2bit1bit0
1/3 duty-COM2COM1COM0
1/2 duty--COM1COM0
Static---COM0
LCD drive voltage
EM73361A provides 2 kinds of LCD bias methods, capacitor divider and resistor divider, when the LCD bias
method is capacitor divider,the VA is connected a capacitor to VB and the VEE is connected a capacitor
to VSS. The output of VEE is 1.5V for LCD bias voltage. When the LCD bias method is resistor divider, the
VA, VB and VEE are floating.
* This specification are subject to be changed without notice.
10.8.2001
17
Page 18
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
• Resistor divider• Capacitor divider
VA
VB
LCD DISPLAY OPERATIONLCD DISPLAY OPERATION
LCD DISPLAY OPERATION
LCD DISPLAY OPERATIONLCD DISPLAY OPERATION
1.5V
EE
V
V
DD
V
SS
0.1F
3V
VA
VB
EE
V
V
DD
V
SS
3V
The LCD programming method is I/O mapping and P10~P12 are must be used.
Address register of LCD display buffer
It is a 5-bit register to specify address for LCD display buffer.
Port11Port10
3 2 1 03210Initial value :0000 0000
A4A3 A2A1 A0
EM73361AEM73361A
EM73361A
EM73361AEM73361A
Data register of LCD display buffer
P12 is a 3-bit data register to read or write LCD display buffer.
Port12
3 2 1 0Initial value : 0000
D2 D1D0
TONE GENERATORTONE GENERATOR
TONE GENERATOR
TONE GENERATORTONE GENERATOR
EM73361A has a built-in tone generator. It is a binary down counter. When the CPU is reseted or sleeping, the
tonegenerator is disabled and the output (P4.0/TONE) is high.
P30.0
P23, P24
fo
High
Output
control
TONE
TONE
XIN
Tone
generator
Tone generator command register
Port30 3 2 1 0
***SMInitial value : 0000
SM Sound generator mode
0Tone generator disable
1Tone generator enable
* This specification are subject to be changed without notice.
10.8.2001
18
Page 19
EM73361AEM73361A
c
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
Tone frequency register
The 8-bit tone frequency register is P24 and P23. The tone frequency will be changed when user output the
different data to P23. Thus, the data must be output to P24 before P23 when user want to change the 8-bit
tone frequency (TF).
Watch-dog-timer can help user to detect the malfunction (runaway) of CPU and give system a time up signal every
certain time . User can use the time up signal to give system a reset signal when system is fail. When CPU is reseted
or sleeping, the watch-dog-timer is disabled. Users must enable the watch-dog-timer by self when CPU is waked
up.
The basic structure of watch-dog-timer control is composed by a 4-stage binary counter and a control unit . the
WDT counter counts for a certain time to check the CPU status, if there is no malfunction happened, the counter
will be cleared and counting . Otherwise, if there is a malfunction happened, the WDT control will send a WDT
signal ( low active ) to outside, user can use this signal to reset CPU . The WDT checking period is assign by
P21 ( WDT command port )
13
fc/2
ounter clear request
WDT counter
0 1 2 3
WDT CONTROL
P21
WDT
command PORT
system reset
P4.1 OUTPUT DATA
R
S
P4.1 OUTPUT
DATA LATCH
F/F
Q
P4.1
P21 is the control port of watchdog timer, and the watchdog timer timeup signal is output by P4.1/WDT, user can
use this timeup signal (active low) to reset CPU and initialize system.
Port 213210Initial value :0000
CWC* *WDT
CWCClear watchdog timer counter
0Clear counter then return to 1
1Nothing
WDTSet watchdog timer detect time
03 x 213/fc=3 x 213/32 KHz=0.75 sec
17 x 213/fc=7 x 213/32K Hz=1.75 sec
* This specification are subject to be changed without notice.
10.8.2001
19
Page 20
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
PROGRAM EXAMPLE
To enable WDT with
LDIA #0000B
OUTA P21; set WDT detection time and clear WDT counter
RESETTING FUNCTIONRESETTING FUNCTION
RESETTING FUNCTION
RESETTING FUNCTIONRESETTING FUNCTION
When CPU in normal working condition and RESET pin holds in low level for three instruction cycles at least,
then CPU begins to initialize the whole internal states, and when RESET pin changes to high level, CPU begins
to work in normal condition.
The CPU internal state during reset condition is as following table :
Hardware condition in RESET stateInitial value
Program counter000h
Status flag01h
Interrupt enable flip-flop ( EI )00h
MASK0 ,1, 2, 300h
Interrupt latch ( IL )00h
P10, 11, 12, 16, 21, 25, 27, 28, 29, 3000h
P4, 5, 6, 7, 23, 240Fh
XINStart oscillation
3 x 213/fc detection ftime.
The RESET pin is a hysteresis input pin and it has a pull-up resistor available by mask option.
The simplest RESET circuit is connect RESET pin with a capacitor to VSS and a diode to VDD.
RESET
* This specification are subject to be changed without notice.
10.8.2001
20
Page 21
EM73361A I/O PORT DESCRIPTION :EM73361A I/O PORT DESCRIPTION :
EM73361A I/O PORT DESCRIPTION :
EM73361A I/O PORT DESCRIPTION :EM73361A I/O PORT DESCRIPTION :
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
PortPort
Port
PortPort
0EInput port , wakeup function
1---2---3---4EInput portEOutput port, P4.0/TONE,P4.1/WDT, P4(2..3)
9---10--IAddress register of LCD display bufferlow nibble
11--IAddress register of LCD display bufferhigh nibble
12--IData register of LCD display buffer
13---14---15---16ISleep/Hold mode control register
17-18-19-20-21IWatch-dog-timer control register
22-23ISound effect frequency registerlow nibble
24ISound effect frequency registerhigh nibble
25ITimebase control register
26-27ILCD control register
28ITimer/counter A control register
29ITimer/counter B control register
30ISound effect command register
31--
Input functionInput function
Input function
Input functionInput function
Output functionOutput function
Output function
Output functionOutput function
/SEG(26..25)
NoteNote
Note
NoteNote
* This specification are subject to be changed without notice.
10.8.2001
21
Page 22
ABSOLUTE MAXIMUM RATINGSABSOLUTE MAXIMUM RATINGS
ABSOLUTE MAXIMUM RATINGS
ABSOLUTE MAXIMUM RATINGSABSOLUTE MAXIMUM RATINGS
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
* This specification are subject to be changed without notice.
10.8.2001
23
Page 24
RESET PIN TYPERESET PIN TYPE
RESET PIN TYPE
RESET PIN TYPERESET PIN TYPE
TYPE RESET-A
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
RESET
INPUT PIN TYPEINPUT PIN TYPE
INPUT PIN TYPE
INPUT PIN TYPEINPUT PIN TYPE
TYPE INPUT-HTYPE INPUT-J
OSCILLATION PIN TYPEOSCILLATION PIN TYPE
OSCILLATION PIN TYPE
OSCILLATION PIN TYPEOSCILLATION PIN TYPE
TYPE OSC-ATYPE OSC-F
XIN
mask option
WAKEUP function
mask option
: mask option
WAKEUP function
mask option
input data
special function
control input
: mask option
XIN
Crystal
Osc.
XOUT
* This specification are subject to be changed without notice.
XOUT
RC Osc.
(inverter)
10.8.2001
24
Page 25
I/O PIN TYPEI/O PIN TYPE
I/O PIN TYPE
I/O PIN TYPEI/O PIN TYPE
TYPE I/OTYPE I/O-D
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
mask option
TYPE I/O
TYPE I/O-NTYPE I/O-O
TYPE I/O
: mask option
: mask option
TYPE I/O-P
path B
path A
Input
data
path B
path A
Output
MUX
data
latch
special function
path B
path A
Output
data
latch
Special function output
Input
data
Output
data
control output
Input
data
Output
data
TYPE I/O
Special function
output
Output
data
latch
Output
data
: mask option
Path A :For set and clear bit of port instructions, data goes through path A from output data latch to CPU.
Path B :For input and test instructions, data from output pin go through path B to CPU and the output data latch
will be set to high.
* This specification are subject to be changed without notice.
10.8.2001
25
Page 26
APPLICATION CIRCUITAPPLICATION CIRCUIT
APPLICATION CIRCUIT
APPLICATION CIRCUITAPPLICATION CIRCUIT
VBA T
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
VBA T
0.1µF
3V
RESET
Buzzer
0.1µF
VDD
P0.0
P0.1
P0.2
TONE
P4.0/TONE
RESET
VSS
VA
VB
VEE
XOUT
XIN
SEG0~
SEG12
COM0~
COM2
0.1µF
Capacitor
driver
X'tal osc type
32.768KHz
RC osc type
LCD PANNEL
Resistor driver
VEE
20P
20P
EM73361A
* This specification are subject to be changed without notice.
XOUT
XIN
10.8.2001
26
Page 27
PAD DIAGRAMPAD DIAGRAM
PAD DIAGRAM
PAD DIAGRAMPAD DIAGRAM
SEG2
SEG1
SEG0
COM1
COM0
V
VB
VA
XIN
XOUT
EM73361AEM73361A
EM73361A
EM73361AEM73361A
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT4-BIT MICRO-CONTROLLER FOR LCD PRODUCT