EM78P447N EMC ELAN Microelectronics Corp
EM78P447N EMC ELAN Microelectronics Corp
EM78P447N EMC ELAN Microelectronics Corp
EM78P447N
OTP ROM
EM78P447N
8-BIT MICRO-CONTROLLER
Version 1.0
EM78P447N
OTP ROM
Application Note
1. GENERAL DESCRIPTION
EM78P447N is an 8-bit microprocessor with low-power and high-speed CMOS technology and high
noise immunity. It is equipped with 4K*13-bits Electrical One Time Programmable Read Only Memory
(OTP-ROM). It provides three PROTECTION bits to prevent user’s code in the OTP memory from being
intruded. Seven OPTION bits are also available to meet user’s requirements.
With its OTP-ROM feature, the EM78P447N is able to offer a convenient way of developing and
verifying user’s programs. Moreover, user can take advantage of ELAN Writer to easily program his
development code.
2. FEATURES
3. PIN ASSIGNMENT
P55 1 32 P56
P54 2 31 P57
TCC 1 28 /RESET Vss 1 28 /RESET TCC 3 30 /RESET
VDD 2 27 OSCI TCC 2 27 OSCI VDD 4 29 OSCI
NC 3 26 OSCO VDD 3 26 OSCO NC 5 28 OSCO
Vss 4 25 P77 /INT 4 25 P77 Vss 6 27 P77
EM78P447NBWM
EM78P447NBP
/INT 5 24 P76 P50 5 24 P76 /INT 7 26 P76
P50 6 23 P75 P51 6 23 P75 P50 8 25 P75
EM78P447NAS
EM78P447NAM
EM78P447NAP
4. FUNCTION DESCRIPTION
OSCI OSCO /R E S E T
TCC /IN T
W D T T im e r
P C STACK 1
O s c illa to r/T im in g
STACK 2
C o n tro l
P re s c a le STACK 3
r ROM STACK 4
STACK 5
W DT
T im -e o u t
In te rru p t
C o n tro l In s tru c tio n
R e g is te r
R 1 (T C C ) ALU
In s tru c tio n
S le e p RAM D ecoder
& R3
W ake ACC
C o n tro l
R4
IO C 5 IO C 6 IO C 7
R5 R6 R7
R0 is not a physically implemented register. Its major function is to act as an indirect addressing pointer.
Any instruction using R0 as a pointer actually accesses data pointed by the RAM Select Register (R4).
• The contents of the prescaler counter will be cleared only when TCC register is written a value.
R3
000H
A11 A10 A9 A8 A7 ~ A0 Hardware Vector 001H
Software Vector 002H
CALL
RET
User Memory
RETL
On-chip Program
Space
RETI
00 PAGE0 0000~03FF Stack Level 1 Memory
01 PAGE1 0400~07FF Stack Level 2
10 PAGE2 0800~0BFF Stack Level 3
11 PAGE3 0C00~0FFF Stack Level 4
Stack Level 5 Reset Vector FFFH
10
︰ General Registers
1F
20
: Bank0 Bank1 Bank2 Bank3
3E
4. R3 (Status Register)
7 6 5 4 3 2 1 0
GP PS1 PS0 T P Z DC C
• Bit 7 (GP) General read/write bit.
• Bits 6 (PS1) ~ 5 (PS0) Page select bits. PS1~PS0 are used to pre-select a program memory page.
When executing a "JMP", "CALL", or other instructions which causes the program counter to
change (e.g. MOV R2, A), PS1~PS0 are loaded into the 11th and 12th bits of the program counter
and select one of the available program memory pages. Note that RET (RETL, RETI) instruction
does not change the PS0~PS1 bits. That is, the return will always be to the page from where the
subroutine was called, regardless of the PS1~PS0 bits current setting.
PS1 PS0 Program memory page [Address]
0 0 Page 0 [000-3FF]
0 1 Page 1 [400-7FF]
1 0 Page 2 [800-BFF]
1 1 Page 3 [C00-FFF]
• Bit 4 (T) Time-out bit. Set to 1 with the "SLEP" and "WDTC" commands, or during power up, and
reset to 0 with the WDT time-out.
• 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 2 (Z) Zero flag. Set to "1" if the result of an arithmetic or logic operation is zero.
• Bit 1 (DC) Auxiliary carry flag.
• Bit 0 (C) Carry flag
0: TCC
1: WDT
• Bit 2 (PSR2) ~ Bit 0 (PSR0) TCC/WDT prescaler 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
1
<Note>: Vdd = 5V, set up time period = 16.2ms ± 30%
Vdd = 3V, set up time period = 19.6ms ± 30%
This specification is subject to change without prior notice. 14 10.21.2004 (V1.0)
EM78P447N
OTP ROM
Oscillator
Reset
Q PR D
CLK VCC
Q
CL
from S/W
P60~P67
VCC
/WUE
/PHEN
P74~P75
Fig. 5 Sleep Mode and Wake-Up Circuits on I/O Ports Block Diagram
• R1 (TCC) is an 8-bit timer/counter. The clock source of TCC can be internal or external clock input
(edge selectable from TCC pin). If TCC signal source is from internal clock, TCC will increase by 1 at
every instruction cycle (without prescaler). Referring to Fig. 6, CLK=Fosc/2 or CLK=Fosc/4
selection is determined by the CODE Option bit CLK status. CLK=Fosc/2 is used if CLK bit is "0",
and CLK=Fosc/4 is used if CLK bit is "1". If TCC signal source comes from external clock input, TCC
is increased by 1 at every falling edge or rising edge of TCC pin.
• The watchdog timer is a free running on-chip RC oscillator. The WDT will keep on running even after
the oscillator driver has been turned off (i.e. in sleep mode). During normal operation or sleep mode,
a WDT time-out (if enabled) will cause the device to reset. The WDT can be enabled or disabled any
time during normal mode by software programming. Refer to WDTE bit of IOCE register. Without
prescaler, the WDT time-out period is approximately 18 ms1 (default).
0 1
TCC M M SYNC
Pin U U TCC(R1)
2 cycles
1 X X
0
TE
TCC overflow interrupt
TS PAB
0
M
U 8-bit Counter
WDT
X
1
8-to-1 MUX PSR0~PSR2
WDTE PAB
(in IOCE) 0 1
MUX PAB
WDT timeuot
1
<Note>: Vdd = 5V, set up time period = 16.2ms ± 30%
Vdd = 3V, set up time period = 19.6ms ± 30%
This specification is subject to change without prior notice. 16 10.21.2004 (V1.0)
EM78P447N
OTP ROM
PCRD
Q PR D
CLK PCWR
Q
CL
IOD
PORT Q PR D
CLK PDWR
Q CL
0 M PDRD
U
1 X
Fig. 7 (a) The I/O Port and I/O Control Register Circuit
PCRD
VCC ROC
Q PR D
Weakly
Pull- up CLK PCWR
Q
CL
IOD
PORT Q PR
D
CLK PDWR
Q CL
0 M PDRD
Rex* U
1 X
The device is kept in a RESET condition for a period of approx. 18ms1 (one oscillator start-up timer
period) after the reset is detected. Once the RESET occurs, the following functions are performed (refer
to Fig.8).
The sleep (power down) mode is asserted by executing the “SLEP” instruction. While entering sleep
mode, WDT (if enabled) is cleared but keeps on running. The controller can be awakened by-
1
NOTE: Vdd = 5V, set up time period = 16.2ms ± 30%
Vdd = 3V, set up time period = 19.6ms ± 30%
The above two cases will cause the controller EM78P447N to reset. The T and P flags of R3 can be
used to determine the source of the reset (wake-up).
In addition to the basic SLEEP1 MODE, EM78P447N has another sleep mode (designated as SLEEP2
MODE and is invoked by clearing the IOCE register “SLPC” bit). In the SLEEP2 MODE, the controller
can be awakened by-
(A) Any of the wake-up pins is “0” as illustrated in Figure. 5. Upon waking, the controller will continue to
execute the succeeding address. Under this case, before entering SLEEP2 MODE, the wake-up
function of the trigger sources (P60~P67 and P74~P75) should be selected (e.g., input pin) and
enabled (e.g., pull-high, wake-up control). It should be noted that after waking up, the WDT is enabled
if the Code Option bit ENWDT is “0”. The WDT operation (to be enabled or disabled) should be
appropriately controlled by software after waking up.
(B) WDT time-out (if enabled) or external reset input on /RESET pin will trigger a controller reset.
If Port6 Input Status Changed Wake-up is used to wake-up the EM78P447S (Case [a] above), the
following instructions must be executed before entering SLEEP2 mode:
IOW RB
MOV A, @ xx01xxx1b ; Disable WDT
IOW RE
Note:
After waking up from the SLEEP2 mode, WDT is automatically enabled. The WDT enabled/disabled
operation after waking up from SLEEP2 mode should be appropriately defined in the software.
To avoid reset from occurring when the port6 status changed interrupt enters into interrupt vector or is
used to wake-up the MCU, the WDT prescaler must be set above 1:1 ratio.
Change
** To execute next instruction after the ”SLPC” bit status of IOCE register being on high-to-low transition.
X: Not used. U: Unknown or don’t care. P: Previous value before reset. t: Check Table 5
1. A power-on condition,
2. A high-low-high pulse on /RESET pin, and
3. Watchdog timer time-out.
The values of T and P (listed in Table 5 below) are used to verify the event that triggered the processor
to wake up.
Table 6 shows the events that may affect the status of T and P.
VDD
D Q
CLK
Oscillator CLK
CLR
Power-on
Reset
Voltage
Detector
WDTE
/RESET
4.6 Interrupt
The EM78P447N has two interrupts listed below:
R3F is the interrupt status register that records the interrupt requests in the relative flags/bits. IOCF is
the interrupt mask register. The global interrupt is enabled by the ENI instruction and is disabled by the
DISI instruction. When one of the interrupts (enabled) occurs, the next instruction will be fetched from
address 001H. Once in the interrupt service routine, the source of an interrupt can be determined by
polling the flag bits in R3F. The interrupt flag bit must be cleared by instructions before leaving the
interrupt service routine and before interrupts are enabled to avoid recursive interrupts.
The flag (except ICIF bit) in the Interrupt Status Register (R3F) is set regardless of the status of its mask
bit or the execution of ENI. Note that the outcome of R3F are the logic AND of R3F and IOCF (refer to
Fig. 9). The RETI instruction ends the interrupt routine and enables the global interrupt (the execution of
ENI).
When an interrupt is generated by the INT instruction (enabled), the next instruction will be fetched from
address 002H.
VCC
P
D R Q IRQn
/IRQn CLK _ INT
C Q RFRD IRQm
L
RF
ENI/DISI
P IOD
Q R D
_ CLK
C IOCFWR
IOCF Q L
/RESET
IOCFRD
RFWR
4.7 Oscillator
1. Oscillator Modes
The EM78P447N can operate in three different oscillator modes, i.e., high XTAL (HXT) oscillator
mode, low XTAL (LXT) oscillator mode, and External RC oscillator mode (ERC) oscillator mode.
User can select one of them by programming MS, HLF and HLP in the Code Option Register. Table
7 depicts how these three modes are defined.
The maximum limit for operational frequencies of crystal/resonator under different VDDs is listed in
Table 8.
OSCO
EM 78P447S
C1
OSCI
EM 78P447S
XTAL
OSCO
RS C2
VCC
Rext
OSCI
Cext
EM 78P447S
Word 0 Word 1
Bit12~Bit0 Bit12~Bit0
Vdd
R
/RESET
D
EM78P447N
Rin
C
Vdd Vdd
EM78P447N 33K
Q1 10K
/RESET
40K
1N4684
Vdd Vdd
EM78P447N R1
Q1
/RESET
40K R2
If for some reasons, the specification of the instruction cycle is not suitable for certain applications, try
modifying the instruction as follows:
Case (A) is selected by the CODE Option bit, called CLK. One instruction cycle consists of two oscillator
clocks if CLK is low, and four oscillator clocks if CLK is high.
Note that once the 4 oscillator periods within one instruction cycle is selected as in Case (A), the internal
clock source to TCC should be CLK=Fosc/4, not Fosc/ 2 as indicated in Fig. 5.
(1) Every bit of any register can be set, cleared, or tested directly.
(2) The I/O register can be regarded as general register. That is, the same instruction can operate
on I/O register.
The symbol "R" 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.
INSTRUCTION
HEX MNEMONIC OPERATION STATUS AFFECTED
BINARY
0 0000 0000 0000 0000 NOP No Operation 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 <Note1>
This specification is subject to change without prior notice. 32 10.21.2004 (V1.0)
EM78P447N
OTP ROM
INSTRUCTION
HEX MNEMONIC OPERATION STATUS AFFECTED
BINARY
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
[Top of Stack] → PC,
0 0000 0001 0011 0013 RETI None
Enable Interrupt
0 0000 0001 0100 0014 CONTR CONT → A None
0 0000 0001 rrrr 001r IOR R IOCR → A None <Note1>
R2+A → R2,
0 0000 0010 0000 0020 TBL Z,C,DC
Bits 8~9 of R2 unchanged
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
0 0010 11rr rrrr 02rr AND R,A A&R→R Z
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→R 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
R(n) → A(n-1),
0 0110 00rr rrrr 06rr RRCA R C
R(0) → C, C → A(7)
R(n) → R(n-1),
0 0110 01rr rrrr 06rr RRC R C
R(0) → C, C → R(7)
R(n) → A(n+1),
0 0110 10rr rrrr 06rr RLCA R C
R(7) → C, C → A(0)
R(n) → R(n+1),
0 0110 11rr rrrr 06rr RLC R C
R(7) → C, C → R(0)
R(0-3) → A(4-7),
0 0111 00rr rrrr 07rr SWAPA R None
R(4-7) → A(0-3)
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 <Note2>
0 101b bbrr rrrr 0xxx BS R,b 1 → R(b) None <Note3>
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
PC+1 → [SP],
1 00kk kkkk kkkk 1kkk CALL k None
(Page, k) → PC
This specification is subject to change without prior notice. 33 10.21.2004 (V1.0)
EM78P447N
OTP ROM
INSTRUCTION
HEX MNEMONIC OPERATION STATUS AFFECTED
BINARY
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], 002H → PC None
1 1111 kkkk kkkk 1Fkk ADD A,k k+A → A Z,C,DC
<Note1> This instruction is applicable to IOC5 ~ IOC7, IOCB, IOCE, IOCF only.
<Note2> This instruction is not recommended for R3F operation.
<Note3> This instruction cannot operate under R3F.
2.4
2.0 2.0
TE S T P O IN T S
0.8 0.8
0.4
CLK
/R ES ET
T d rh
CLK
TCC
T tcc
Items Rating
Temperature under bias -40°C to 85°C
Storage temperature -65°C to 150°C
Input voltage VSS-0.3V to VDD+0.5V
Output voltage VSS-0.3V to VDD+0.5V
Operating Frequency (2clk) 32.768KHz to 20MHz
Operating Voltage 2.5V to 5.5V
6. DC ELECTRICAL CHARACTERISTICS
0
2.5 3 3.5 4 4.5 5 5.5
Vdd(Volt)
2
1.8
Typ 25 ℃
1.6
1.4
Max (-40 ℃ to 85 ℃)
1.2
Vth(Volt)
Min (-40 ℃ to 85 ℃)
1
0.8
0.6
0.4
0.2
0
2.5 3 3.5 4 4.5 5 5.5
VDD(Volt)
-5 -2
-10 -4
Ioh(mA)
Ioh(mA)
Min 85 ℃ Min 85 ℃
-15 -6
Typ 25 ℃ Typ 25 ℃
-20 -8
Max -40 ℃
Max -40 ℃
-25 -10
0 1 2 3 4 5 0 0.5 1 1.5 2 2.5 3
Voh(Volt) Voh(Volt)
Fig.18 Port5, Port6, and Port7 Voh vs. Fig.19 Port5, Port6, and Port7 Voh vs. Ioh,
Ioh,VDD=5V VDD=3V
80 35
Max -40 ℃ Max -40 ℃
70
30
60
Typ 25 ℃ 25
Typ 25 ℃
50
Iol(mA)
Iol(mA)
20
Min 85 ℃
40
Min 85 ℃
15
30
10
20
10 5
0 0
0 1 2 3 4 5 6 0 0.5 1 1.5 2 2.5 3
Vol(Volt) Vol(Volt)
Fig. 20 Port5, and Port6 Vol vs, Iol, VDD=5V Fig. 21 Port5, and Port6 Vol vs. Iol, VDD=3V
Vol/Iol (5V)
Vol/Iol (3V)
100 45
90 40
Max -40 ℃ Max -40 ℃
80 35
70
30
Typ 25 ℃ Typ 25 ℃
60
25
Iol(mA)
Iol(mA)
50
Min 85 ℃ 20
Min 85 ℃
40
15
30
10
20
10 5
0 0
0 1 2 3 4 5 6 0 0.5 1 1.5 2 2.5 3
Vol(Volt) Vol(Volt)
Fig. 22 Port7 Vol vs. Iol, VDD=5V Fig. 23 Port7 Vol vs. Iol, VDD=3V
WDT Time_out
35
30
25
Max 85 ℃
WDT period (mS)
20 Max 75 ℃
Typ 25 ℃
15
Min 0 ℃
Min -40 ℃
10
0
2 3 4 5 6
VDD (Volt)
1.2
1
Frequency(M Hz)
R=5.1k
0.8
0.6
R=10k
0.4
0.2
R=100k
0
2.5 3 3.5 4 4.5 5 5.5
VDD(Volt)
1.005
1
Fosc/Fosc(25℃)
0.995
3V
0.99
5V
0.985
0.98
-40 -20 0 20 40 60 80
Temperature(℃)
Fig. 26 Typical RC OSC Frequency vs. Temperature(R and C are ideal component)
Four conditions exist with the operating current ICC1 to ICC4. these conditions are as follows:
21
Typ ICC2
18
Current (uA)
15 Typ ICC1
12
9
-40 -20 0 20 40 60 80
Temperature (℃)
27 Max ICC2
24
Current (uA)
Max ICC1
21
18
15
-40 -20 0 20 40 60 80
Temperature (℃)
4
3.5 Typ ICC4
Current (mA)
3
2.5
Typ ICC3
2
1.5
1
0.5
-40 -20 0 20 40 60 80
Temperature (℃)
3
Max ICC3
2.5
2
1.5
1
-40 -20 0 20 40 60 80
Temperature (℃)
Two conditions exist with the standby current ISB1 and ISB2. these conditions are as follow:
9
Current (uA)
Typ ISB2
3
Typ ISB1
0
-40 -20 0 20 40 60 80
Temperature (℃)
Max ISB2
9
6
3
Max ISB1
0
-40 -20 0 20 40 60 80
Temperature (℃)
20
15
10
5
0
2 2.5 3 3.5 4 4.5 5 5.5 6
VDD (Volt)
2.5
2
I(mA)
1.5
Max
1
Min
0.5
0
0 1 2 3 4 5 6
Volt(V)
40
35
30
25
Max
I(uA)
20
15
Min
10
5
0
0 1 2 3 4 5 6
Volt(V)
APPENDIX
Package Types:
OTP MCU Package Type Pin Count Package Size
EM78P447NAP DIP 28 600 mil
EM78P447NAM SOP 28 300 mil
EM78P447NAS SSOP 28 209 mil
EM78P447NBP DIP 32 600 mil
EM78P447NBWM SOP 32 450 mil
Package Information
28-Lead plastic dual inline package(DIP)- 600 mil