EM78P312N
8-BIT
Microcontroller
Green Product
Specification
D
OC
. V
ERSION
1.0
ELAN MICROELECTRONICS CORP.
October 2006
Trademark Acknowledgments:
IBM is a registered trademark and PS/2 is a trademark of IBM.
Windows is a trademark of Microsoft Corporation.
ELAN and ELAN logo
are trademarks of ELAN Microelectronics Corporation.
Copyright
©
2006 by ELAN Microelectronics Corporation
All Rights Reserved
Printed in Taiwan
The contents of this specification are subject to change without further notice. ELAN Microelectronics assumes 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 confirmed order.
In no event shall ELAN Microelectronics be made responsible for any claims attributed to errors, omissions, or
other inaccuracies in the information or material contained in this specification. ELAN Microelectronics shall not
be liable for direct, indirect, special incidental, or consequential damages arising from the use of such information
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 prohibited.
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.
ELAN MICROELECTRONICS CORPORATION
Headquarters:
No. 12, Innovation Road 1
Hsinchu Science Park
Hsinchu, Taiwan 30077
Tel: +886 3 563-9977
Fax: +886 3 563-9966
http://www.emc.com.tw
Hong Kong:
Elan (HK) Microelectronics
Corporation, Ltd.
Flat A, 19F., World Tech Centre
95 How Ming Street, Kwun Tong
Kowloon , HONG KONG
Tel: +852 2723-3376
Fax: +852 2723-7780
elanhk@emc.com.hk
Shenzhen:
Elan Microelectronics
Shenzhen, Ltd.
SSMEC Bldg., 3F, Gaoxin S. Ave.
Shenzhen Hi-Tech Industrial Park
Shenzhen, Guandong, CHINA
Tel: +86 755 2601-0565
Fax: +86 755 2601-0500
USA:
Elan Information
Technology Group (U.S.A.)
1821 Saratoga Ave., Suite 250
Saratoga, CA 95070
U.S.A.
Tel: +1 408 366-8225
Fax: +1 408 366-8220
Europe:
Elan Microelectronics Corp.
(Europe)
Siewerdtstrasse 105
8050 Zurich, SWITZERLAND
Tel: +41 43 299-4060
Fax: +41 43 299-4079
http://www.elan-europe.com
Shanghai:
Elan Microelectronics
Shanghai, Ltd.
23/Bldg. #115 Lane 572, Bibo Road
Zhangjiang Hi-Tech Park
Shanghai, CHINA
Tel: +86 21 5080-3866
Fax: +86 21 5080-4600
Contents
Contents
1
2
3
4
5
General Description.....................................................................................................1
Features ........................................................................................................................1
Pin Assignment ............................................................................................................1
Pin Description.............................................................................................................2
Function Description...................................................................................................3
5.1
5.2
5.3
5.4
5.5
5.6
5.7
Functional Block Diagram .................................................................................... 3
Operating Registers ............................................................................................. 4
Special Purpose Registers ................................................................................. 19
CPU Operation Mode ......................................................................................... 23
AD Converter...................................................................................................... 24
Time Base Timer and Keytone Generator ......................................................... 26
UART (Universal Asynchronous Receiver/Transmitter)..................................... 28
5.7.1
5.7.2
5.7.3
5.7.4
UART Mode ...................................................................................................... 29
Transmitting ...................................................................................................... 29
Receiving .......................................................................................................... 30
Baud Rate Generator ....................................................................................... 30
Serial Clock....................................................................................................... 32
Shift Direction and Sample Phase.................................................................... 32
Transfer Mode .................................................................................................. 32
Timer Mode....................................................................................................... 36
Counter Mode ................................................................................................... 36
Window Mode ................................................................................................... 36
5.8
SPI (Serial Peripheral Interface) ........................................................................ 31
5.8.1
5.8.2
5.8.3
5.9
Timer/Counter 2.................................................................................................. 35
5.9.1
5.9.2
5.9.3
5.10 Timer/Counter 3.................................................................................................. 37
5.10.1 Timer Mode....................................................................................................... 38
5.10.2 Counter Mode ................................................................................................... 38
5.10.3 Capture Mode ................................................................................................... 38
5.11 Timer/Counter 4.................................................................................................. 39
5.11.1
5.11.2
5.11.3
5.11.4
Timer Mode....................................................................................................... 40
Counter Mode ................................................................................................... 40
PDO Mode ........................................................................................................ 40
PWM Mode ....................................................................................................... 41
5.12 TCC/WDT & Prescaler ....................................................................................... 41
5.13 I/O Ports.............................................................................................................. 42
Product Specification (V1.0) 10.03.2006
•
iii
Contents
5.14 Reset and Wake-up............................................................................................ 42
5.14.1
5.14.2
5.14.3
5.14.4
Reset ................................................................................................................ 42
Wake-up from Sleep Mode ............................................................................... 43
Wake-up from Idle Mode .................................................................................. 43
The Status of RST, T, and P of the Status Register .......................................... 48
5.15 Interrupt .............................................................................................................. 49
5.16 Oscillator............................................................................................................. 50
5.16.1 Oscillator Modes ............................................................................................... 50
5.16.2 Crystal Oscillator/Ceramic Resonators (Crystal) .............................................. 50
5.16.3 External RC Oscillator Mode ............................................................................ 52
5.17 Code Option Register......................................................................................... 53
5.17.1 Code Option Register (Word 0) ........................................................................ 53
5.17.2 Customer ID Register ....................................................................................... 54
5.18 Power-on Considerations ................................................................................... 54
5.18.1 External Power-on Reset Circuit ...................................................................... 54
5.18.2 Residue-Voltage Protection .............................................................................. 55
6
5.19 Instruction Set..................................................................................................... 56
Absolute Maximum Ratings .....................................................................................58
6.1
Absolute Maximum Ratings ............................................................................... 58
6.2 Recommended Operating Conditions................................................................ 58
Electrical Characteristics..........................................................................................59
7.1
7.2
7.3
DC Electrical Characteristics.............................................................................. 59
AC Electrical Characteristic................................................................................ 62
Timing Diagram .................................................................................................. 63
7
APPENDIX
A
Package Type: ............................................................................................................64
Specification Revision History
Doc. Version
1.0
Initial Version
Revision Description
Date
2006/10/03
iv
•
Product Specification (V1.0) 10.03.2006
EM78P312N
8-Bit Microcontroller
1
General Description
The EM78P312N is an 8-bit microprocessor with low-power, high-speed CMOS technology and
high noise immunity.
It
has an on-chip 4K×13-bits Electrical One Time Programmable Read Only Memory (OTP-ROM). It provides
multi-protection bits
to prevent intrusion of user’s OTP memory codes. Seven Option bits are also available to meet
user’s requirements. With its OTP-ROM feature, the EM78P312N provides a convenient way of developing and verifying
user’s programs. Moreover, this OTP device offers 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.
2
Features
CPU configuration
4K×13 bits on-chip ROM
144×8 bits on-chip registers (SRAM)
8-level stacks for subroutine nesting
Less than 3.5mA at 5V/8MHz
Typically 0.8
μA,
during sleep mode
Typically 1.1
μA,
during idle mode
I/O port configuration
4 bidirectional I/O ports : P6, P7, P8, P9
22 I/O pins
10 Programmable pull-down I/O pins
10 programmable pull-high I/O pins
External interrupt : P60, P61, P73, P80
Operating voltage range:
OTP version
Operating voltage range:2.5v~5.5v
Operating temperature range:
-40~85°C
Operating frequency range:
Main clock
8 bits Timer/Counter
TCC: 8-bit real time clock/counter with overflow
interrupt
TC3: Timer/Counter/Capture
TC4: Timer/Counter/ PWM (pulse width modulation) /
PDO (Programmable divider output)
8-bit channels Analog-to-Digital Converter with 10-bit
resolution
Time Base Timer:(1Hz~16kHz at 8MHz)
Key tone output:(1kHz~8kHz at 8MHz)
8-bit channels Analog-to-Digital Converter with 10-bit
resolution
Fifteen available interrupts:
WDT time-out interrupt
TCC overflow interrupt
Time base timer interrupt (the first falling edge of the
source clock)
Serial UART transmit interrupt
Serial UART receive interrupt
Serial UART receive error interrupt
Four External interrupt
ADC completion interrupt
TC2 overflow interrupt
TC3 overflow interrupt
TC4 overflow interrupt
Serial SPI interrupt
Special features
Programmable free running watchdog timer
Two clocks per instruction cycle
Power-on Reset
High noise immunity
Power saving Sleep mode
Selectable Oscillation mode
Package type:
28-pin DIP 600 mil: EM78P312NP
28-pin Skinny DIP 300 mil: EM78P312NAK
28-pin Skinny DIP 400 mil: EM78P312N
28-pin SOP 300 mil: EM78P312NM
28-pin SSOP 209 mil: EM78P312NS
•
Crystal mode:
•
ERC mode:
DC ~ 20MHz/2clks @ 5V; DC ~100ns inst. cycle @ 5V
DC ~ 8MHz/2clks @ 3V;DC ~ 250ns inst. cycle @ 3V
DC ~ 16MHz/2clks @ 5V;DC ~ 125ns inst. cycle @ 5V
DC ~ 8MHz/2clks @ 3V;DC ~ 250ns inst. cycle @ 3V
Peripheral configuration
Serial peripheral interface (SPI) available
Universal asynchronous receiver transmitter interface
(UART)available
16 bits Counter/Timer
TC2: Timer/Counter/Window
3
Pin Assignment
(ACLK)
OSCO
OSCI
TEST
(AD0) P90
(AD1) P91
(AD2) P92
(AD3) P93
(AD4) P94
(AD5) P95
(AD6) P96
(AD7/VREF) P97
(TC3, INT3) P80
(TC4, /PWM, /PDO) P81
VSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
28
27
26
25
24
23
22
21
20
19
18
17
16
15
VDD
/RESET
(VPP)
P67
(DINCK)
P66
(DATAIN)
P65
(PGMB)
P64 (/SS)(OEB)
P63 (/TONE)
P62 (TC2)
P61 (INT1)
P60 (/INT0)
P73 (/SLEEP, /INT5)
P72 (TX,SO)
P71(RX,SI)
P70 (/SCK)
EM78P312N
Fig. 3- Pin Assignment
Product Specification (V1.0) 10.03.2006
(This specification is subject to change without further notice)
•
1