The contents of this specification are subject to change without further notice. ELAN Microelectronics assume s no
responsibility concerning the accuracy , adequacy, or completeness of this specification. ELAN Microelectronics
makes no commitment to update, or to keep current the information and material contained in this specification.
Such information and material may change to conform to each confirm ed order.
In no event shall ELAN Microelectronics be made responsible for any claims attributed to errors, omissions, or
other inaccuracies in the informat ion or material contai ned in this specifi cation. ELAN Mi croelectronics shall n ot
be liable for direct, indirect, special incidental, or cons equenti al dama ges arising f rom the us e of such i nformat ion
or material.
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 such 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 prohib ited.
NO PART OF THIS SPECIFICATION MAY BE REPRODUCED OR TRANSMITTED IN ANY FORM OR BY
ANY MEANS WITHOUT THE EXPRESSED WRITTEN PERMISSION OF ELAN MICROELECTRONICS.
(This specification is subject to change without further notice)
Contents
Specification Revision History
Doc. Version Revision Description Date
0.9 Preliminary version 2007/03/20
1.0 Initial released version 2007/10/19
vi •
Product Specification (V1.0) 10.19.2007
(This specification is subject to change without further notice)
EM78P221/2N
8-Bit Microcontroller with OTP ROM
Read Me First !
Comparison between V-Package and U-Package version
This series of microcontrollers comprise of the older V-package version and the newer
U-package version. In the newer U-package version, a Code Option NRM is added
and various features such as Crystal mode Operating frequency range, IRC mode
wake-up time, WDT Time-out time, Comparator function and Pins function have been
modified to favorably meet users’ requirements. The following table is provided for
quick comparison between the two package version and for user convenience in the
choice of the most suitable product for their application.
EM78P221/222N-VEM78P221/222N-U
Crystal mode Operating
frequency range at 0°C~ 70°C
IRC mode wake-up time
Sleep mode → Normal mode
Condition: 5V, 4MHz
P52, P53 Function Output only Input / Output
Comparator Function Comparator only Comparator / OPA
WDT Time-out time
(Prescaler = 1 : 1)
Condition: VDD = 5V
Code Option
DC ~ 12MHz, 4.0V
DC ~ 8MHz, 3.0V
DC ~ 4MHz, 2.1V
64μs 10μs
16.5 ms ± 30 % 15.2 ms ± 30 %
×
DC ~ 16MHz, 4.5V
DC ~ 8MHz, 3.0V
DC ~ 4MHz, 2.1V
Added a Code Option NRM
EM78P221/2N-V Package version EM78P221/2N-U Package version
Product Specification (V1.0) 10.19.2007 • 1
(This specification is subject to change without further notice)
EM78P221/2N
8-Bit Microcontroller with OTP ROM
1 General Description
EM78P221N and EM78P222N are 8-bit microprocessors designed and developed with low-power and high-speed CMOS
technology. Each device in the series has as an on-chip 4K×13-bit Electrical One Time Programmable Read Only Memory
(OTP-ROM). Each provides a protection bit to prevent intrusion of user’s OTP memory code. Two Code option bits are
also available to meet user’s requirements.
With its enhanced OTP-ROM features, each device provides a convenient way of developing and verifying user’s
programs. Moreover, this OTP devices offer the advantages of easy and effective program updates, using development
and programming tools. User can avail of the ELAN Writer to easily program his development code.
Crystal type: Output terminal for crystal oscillator.
RC type: Clock output with a duration of one instruction cycle
time.
External clock signal input.
If it remains at a logic low, the device will be reset
Wake-up from sleep mode when pin status changes
Voltage on /RESET must not exceed Vdd during normal mode
External interrupt pin
Power supply
Ground
Product Specification (V1.0) 10.19.2007
4 •
(This specification is subject to change without further notice)
4.2 EM78P221N
Symbol Pin No. Type Function
P50~P57
P60~P67
P70~P73
P77
P81
CINCIN+
CO
OSCI
OSCO
/RESET
INT0~INT1
VDD
VSS
1~2
11~14
22~23
6 ~ 10
15~17
5
21 ~ 18
24 I/O
18
19
20
23 I
22 O
24 I
5, 20 I
3 -
4 -
I/O
I/O
I/O
I
I
O
EM78P221/2N
8-Bit Microcontroller with OTP ROM
8-bit General purpose input/output pins
Default value at power-on reset.
8-bit General purpose input/output pins
Default value at power-on reset
5-bit General purpose input/output pins
Default value at power-on reset
P72 and P73 are open drain pins when used as output pins of
the ICE220N simulator.
1-bit General purpose input or output open-drain pin
Default value at power-on reset
“-“ : input pin of Vin- of the comparator
“+” : input pin of Vin+ of the comparator
Pin CO is the comparator output
Defined by CMPCON (Bank 1-RA) <3 : 4>
Crystal type: Output terminal for crystal oscillator
RC type: Clock output with a duration of one instruction cycle
time.
External clock signal input.
If it remains at logic low, the device will be reset
Wake-up from sleep mode when pin status changes
Voltage on /RESET must not exceed Vdd during normal mode
External interrupt pin
Power supply
Ground
Product Specification (V1.0) 10.19.2007 • 5
(This specification is subject to change without further notice)
EM78P221/2N
8-Bit Microcontroller with OTP ROM
5 Block Diagram
P8
P80
P81
P70
P71
P72
P73
P74
P75
P76
P77
P60
P61
P62
P63
P64
P65
P66
P67
P50
P51
P52
P53
P54
P55
P56
P57
P7
P6
P5
ACC
ROM
Instruction
Register
Instruction
Decoder
ALU
R3 (Status
Reg.)
PC
8-level stack
(13 bit)
Interrupt
Control
Register
Interrupt
Circuit
R4
Ext.
OSC.
Int.
RC
Oscillation
Generation
Reset
Mux
.
RAM
Ext.
RC
WDT
TCC
Port
change
LVR
Comparator
TCC
Port 6
Ext INT
Cin+ Cin- CO
Fig. 5-1 EM78P221/2N Functional Block Diagram
6 •
(This specification is subject to change without further notice)
Product Specification (V1.0) 10.19.2007
EM78P221/2N
8-Bit Microcontroller with OTP ROM
6 Function Description
6.1 Register Configuration
Address Bank 0 Registers Bank 1 Registers Bank 2 Registers Bank 3 Registers
2. When using ICE, some registers code options are set. Refer to Section 6.2 for detailed Registers Description.
3. Registers with * can only be used in ICE220N simulator.
Product Specification (V1.0) 10.19.2007 • 7
(This specification is subject to change without further notice)
EM78P221/2N
8-Bit Microcontroller with OTP ROM
6.2 Registers Description
6.2.1 A (Accumulator)
Internal data transfer operation, or instruction operand holding usually involves the
temporary storage function of the Accumulator. The Accumulator is not an
addressable register.
6.2.2 CONT (Control Register)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
INTE INT TS TE PSTE PST2 PST1 PST0
Bit 7 (INTE): INT signal edge
0 = interrupt occurs at the rising edge on the INT0 and INT1 pin
1 = interrupt occurs at the falling edge on the INT0 and INT1 pin
Bit 6 (INT): Interrupt enable flag
0 = masked by DISI or hardware interrupt
1 = enabled by the ENI/RETI instructions
This bit is readable only.
Bit 5 (TS): TCC signal source
0 = internal instruction cycle clock. If P56 is used as I/O pin, TS must be 0.
1 = transition on the TCC pin
Bit 4 (TE): TCC signal edge
0 = increment if the transition from low to high takes place on the TCC pin
1 = increment if the transition from high to low takes place on the TCC pin.
Bit 3 (PSTE): Prescaler enable bit for TCC
0 = prescaler disable bit. TCC rate is 1:1
1 = prescaler enable bit. TCC rate is set as Bit 2 ~ Bit 0.
When the Comparator output status change is used to enter interrupt
vector or to wake-up from sleep, the CMPWE bit must be set to
“Enable“.
Bit 0 (CMPIF): Comparator interrupt flag. Set when a change occurs in the output of
Comparator. Reset by software.
0 = no interrupt occurs
1 = with interrupt request
NOTE
■ Bank 0-RE <7, 0> can be cleared by instruction but cannot be set.
■ Bank1-RE <0> is an interrupt mask register.
■ Interrupt results from "logic AND" of Bank 0-RE <7, 0> and Bank 1-RE <0>, with
instruction “ENI”.
6.2.14 Bank 0-RF (Interrupt Status Register)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
0 0 0 0 0 EX0IF ICIF TCIF
Bits 7~3: not used bits, fixed to 0 all the time
Bit 2 (EX0IF): External interrupt flag. Set by INT0 pin. Reset by software.
0 = no interrupt occurs
1 = with interrupt request
Product Specification (V1.0) 10.19.2007
12 •
(This specification is subject to change without further notice)
EM78P221/2N
8-Bit Microcontroller with OTP ROM
Bit 1 (ICIF): Port 6 input status change interrupt flag. Set when Port 6 input changes.
Reset by software.
0 = no interrupt occurs
1 = with interrupt request
Bit 0 (TCIF): TCC overflow interrupt flag. Set when TCC overflows. Reset by software.
0 = no interrupt occurs
1 = with interrupt request
NOTE
■ Bank 0-RF <2, 1, 0> can be cleared by instruction but cannot be set.
■ Bank1-RF <2, 1, 0> is an interrupt mask register.
■ Interrupt results from "logic AND" of Bank 0-RF <2, 1, 0> and Bank 1-RF <2, 1, 0>
with instruction “ENI”.
6.2.15 Bank 1-R5 ~R7 (I/O Port Control Register)
Bits 7~0: 0 = defines the relative I/O pin as output
1 = puts the relative I/O pin into high impedance
Bank 1-R5, R6 and R7 registers are all readable and writable.
6.2.16 Bank 1-R8 (I/O Port Control Register)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
0 0 0 0 0 0 C81 C80
Bits 7~2: not used, fixed to 0 all the time
Bits 1~0 (C81~C80): 0 = defines the relative I/O pin as output 1 = puts the relative I/O pin into high impedance
With Simulator]: P80 and P81 are General I/O pins
[With EM78P221/2N]: P80 is General input or output, but P81 is input or open-drain
output pin.
Product Specification (V1.0) 10.19.2007 • 13
(This specification is subject to change without further notice)
EM78P221/2N
8-Bit Microcontroller with OTP ROM
6.2.17 Bank 1-R9 (Reserve)
Bits 7~0: not used, fixed to 0 all the time
6.2.18 Bank 1-RA (CMPCON: Comparator Control Register)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
EIS1 EIS0 CMPOUT CMPCOS1 CMPCOS00 0 0
Bit 7 (EIS1): Control bit used to define the function of the P71 (/INT1) pin
0 = P71, normal I/O pin 1 = /INT1, external interrupt pin. In this case, the I/O control bit of P71
(Bit 1 of Bank 1-R7) must be set to "1"
Bit 6 (EIS0): Control bit used to define the function of the P77 (/INT0) pin
0 = P77, normal I/O pin 1 = /INT0, external interrupt pin. In this case, the I/O control bit of P77
(Bit 7 of Bank 1-R7) must be set to "1"
NOTE
When EIS is "0," the path of /INT is masked. When EIS is "1," the status of /INT
pin can also be read by way of reading Port 7 (Bank 0-R7). Refer to Fig. 6-4 (I/O
Port and I/O Control Register Circuit for P77 (/INT0) and P71 (/INT1) under
Section 6.4 (I/O Ports).
EIS0 and EIS1 are both readable and writable.
The highest priority of P71/INT1/CO2 is INT1. When EIS1=0, the working type
of P71/INT1/CO is determined by CMPCOS1 and CMPCOS0.
Bit 5 (CMPOUT): The result of the comparator output
Bit 4 ~ Bit 3 (CMPCOS1 ~ CMPCOS0): Comparator Select bits
CMPCOS1 CMPCOS0 Function Description
0 0
0 1
1 0
1 1 Used as OP and P71 is OP output pin (CO)
Comparator is not used. P72, P73 and P71 are
normal I/O pins
P72 and P73 are Comparator input pins and P71
is normal I/O pin
P72 and P73 are Comparator input pins and P71
is Comparator output pin (CO)
Bits 2~0: not used, fixed to 0 all the time
Product Specification (V1.0) 10.19.2007
14 •
(This specification is subject to change without further notice)
EM78P221/2N
8-Bit Microcontroller with OTP ROM
6.2.19 Bank 1-RB (Pull-down Control Register)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
/PD7 /PD6 /PD5 /PD4 /PD3 /PD2 /PD1 /PD0
Bank 1-RB register is both readable and writable
Bit 7 (/PD7): Control bit used to enable the pull-down function of the P67 pin
0 = Enable internal pull-down function
1 = Disable internal pull-down function
Bit 6 (/PD6): Control bit used to enable the pull-down function of the P66 pin.
Bit 5 (/PD5): Control bit used to enable the pull-down function of the P65 pin.
Bit 4 (/PD4): Control bit used to enable the pull-down function of the P64 pin.
Bit 3 (/PD3): Control bit used to enable the pull-down function of the P63 pin.
Bit 2 (/PD2): Control bit used to enable the pull-down function of the P62 pin.
Bit 1 (/PD1): Control bit used to enable the pull-down function of the P61 pin.
Bit 0 (/PD0): Control bit used to enable the pull-down function of the P60 pin.
6.2.20 Bank 1-RC (Open-Drain Control Register)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
/OD7 /OD6 /OD3 /OD2 /OD5 /OD4 /OD1 /OD0
Bank 1-RC register is both readable and writable.
Bit 7 (OD7): Control bit used to enable the open-drain output of the P57 pin.
0 = Enable open-drain output
1 = Disable open-drain output
Bit 6 (OD6): Control bit used to enable the open-drain output of the P56 pin.
Bit 5 (OD5): Control bit used to enable the open-drain output of the P55 pin.
Bit 4 (OD4): Control bit used to enable the open-drain output of the P54 pin.
Bit 3 (OD3): Control bit used to enable the open-drain output of the P53 pin.
Bit 2 (OD2): Control bit used to enable the open-drain output of the P52 pin.
Bit 1 (OD1): Control bit used to enable the open-drain output of the P51 pin.
Bit 0 (OD0): Control bit used to enable the open-drain output of the P50 pin.
Product Specification (V1.0) 10.19.2007 • 15
(This specification is subject to change without further notice)
Loading...
+ 49 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.